XtOffset man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

XtOffset()							    XtOffset()

Name
  XtOffset  -  determine  the  byte  offset of a field within a structure
  pointer type.

Synopsis
  Cardinal XtOffset(pointer_type, field_name)

Inputs
  pointer_type
	     Specifies a type that is declared as a pointer to the struc‐
	     ture.

  field_name Specifies	the name of the field in the structure pointed to
	     by pointer_type.

Returns
  The offset in bytes of the named field from the beginning of the struc‐
  ture type pointed to by pointer_type.

Description
  XtOffset()  is  a  macro that computes the offset of a named field in a
  structure, given the field name and a type which points to  the  struc‐
  ture.

Usage
  XtOffset()  has  been superseded by XtOffsetOf() which takes the struc‐
  ture type itself rather than a pointer to the structure, and is defined
  in a more portable way.

  XtOffset()  is  usually  used	 to determine the location of an variable
  within a structure when initializing a resource list.	 It  is	 used  by
  widget  writers,  and	 anyone	 who needs to fetch application resources
  with XtGetApplicationResources().  Resource fields are defined in terms
  of offsets from a base address from the beginning of a widget.  Thus, a
  resource value can be kept up to date by the Resource	 Manager  without
  any  knowledge  of the instance structure of the widget; it uses just a
  relative byte offset.

Background
  XtOffset() is a macro defined as follows for most architectures:

     #define XtOffset(p_type,field)	((Cardinal) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))

See Also
  XtOffsetOf(1).

Xt - Utilities							    XtOffset()
[top]

List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net