Name

XmHTMLGetHeadAttributes - obtain the contents of the HEAD section of the currently displayed document.

Synopsis

Boolean XmHTMLGetHeadAttributes(Widget w, XmHTMLHeadAttributes *head, unsigned char mask_bits)

Description

XmHTMLGetHeadAttributes returns the contents of the document head as well as the contents of the <!DOCTYPE> tag.

w
Specifies the parent Widget ID. This must be a widget of class xmHTMLWidgetClass;
*head
Specifies a pointer to a structure of type XmHTMLHeadAttributes (see below);
mask_bits
Specifies which fields of the document head should be returned. Multiple masking bits can be OR'ed together;

Upon return, the requested fields of the XmHTMLHeadAttributes structure will be filled with the contents of the corresponding tags of the document head.

Calling XmHTMLGetHeadAttributes with the HeadClear bit set will cause this function to free all fields of the XmHTMLHeadAttributes structure. Therefore, one must initialize all fields of this structure to NULL before it is used for the first time. Subsequent calls to this function with the same structure do not require re-initialization, nor explicit use of the HeadClear bit, as allocated fields will be released as needed.

Structures

	/* possible mask_bit values */
	#define HeadClear    ((unsigned char)0)
	#define HeadDocType  (1<<0)
	#define HeadTitle    (1<<1)
	#define HeadIsIndex  (1<<2)
	#define HeadBase     (1<<3)
	#define HeadMeta     (1<<4)
	#define HeadLink     (1<<5)
	#define HeadScript   (1<<6)
	#define HeadStyle    (1<<7)
	#define HeadAll      ((unsigned char)~0)

	/* Head member information. */
	typedef struct{
		String doctype;          /* doctype data                           */
		String title;            /* document title                         */
		Boolean is_index;        /* true when the <isindex> element exists */
		String base;             /* value of the <base> element            */
		int num_meta;            /* number of META info to process         */
		XmHTMLMetaDataPtr meta;  /* array of META info to process          */
		int num_link;            /* number of LINK info to process         */
		XmHTMLLinkDataPtr link;  /* array of LINK info to process          */
		String style_type;       /* value of the style type tag            */
		String style;            /* <style></style> contents               */
		String script_lang;      /* value of the language tag              */
		String script;           /* <script></script> contents             */
	}XmHTMLHeadAttributes;

	/* Link member information. */
	typedef struct{
		String url;              /* value of URL attribute   */
		String rel;              /* value of REL attribute   */
		String rev;              /* value of REV attribute   */
		String title;            /* value of TITLE attribute */
	}XmHTMLLinkDataRec, *XmHTMLLinkDataPtr;

	/* Meta member information. */
	typedef struct{
		String http_equiv;       /* value of HTTP-EQUIV attribute */
		String name;             /* value of NAME attribute       */
		String content;          /* value of CONTENT attribute    */
	}XmHTMLMetaDataRec, *XmHTMLMetaDataPtr;
For a detailed explanation of the members of the above structures, see XmHTMLHeadAttributes(3X)

Return Value

True when a HEAD section was found in the currently displayed document. When no such section was found, False is returned indicating that all requested flags, except HeadDocType, could not be honored.

See Also

XmHTML(3X), XmHTMLGetTitle(3X), XmHTMLHeadAttributes(3X)

XmHTML, October 7, 1997