XStringListToTextProperty(3X) XStringListToTextProperty(3X)NAME XStringListToTextProperty, XTextPropertyToStringList, XFreeStringList, XTextProperty - convert string lists and return the XTextProperty structure SYNOPSIS Status XStringListToTextProperty(list, count, text-prop- return) char **list; int count; XTextProperty *text-prop-return; Status XTextPropertyToStringList(text-prop, list-return, count-return) XTextProperty *text-prop; char ***list-return; int *count-return; void XFreeStringList(list) char **list; DESCRIPTION The XStringListToTextProperty function sets the specified XTextProperty to be of type STRING (format 8) with a value representing the concatenation of the specified list of null-separated character strings. An extra byte containing a null (which is not included in the nitems member, described below) is stored at the end of the value member of text-prop-return. If insufficient memory is available for the new value string, XStringListToTextProperty does not set any members of the XTextProperty structure and returns 0. Otherwise, it returns a nonzero status. To free the storage for the value member, use XFree. The XTextPropertyToStringList function returns a list of strings representing the null-separated elements of the specified XTextProperty structure. The data in text-prop must be of type STRING and format 8. Multiple elements of the property (for example, the strings in a disjoint text selection) are separated by a null character (encoding 0). The contents of the property are not null-terminated. If insufficient memory is available for the list and its ele- ments, XTextPropertyToStringList sets no return values and returns 0. Otherwise, it returns a nonzero status. To free the storage for the list and its contents, use XFreeStringList. The XFreeStringList function releases memory allocated by XTextPropertyToStringList. November, 1990 1
XStringListToTextProperty(3X) XStringListToTextProperty(3X)Arguments These functions accept the following arguments: count Specifies the number of strings. count-return Returns the number of strings. list Specifies the list of strings to be freed. list Specifies a list of null-terminated character strings. list-return Returns a list of null-terminated character strings. text-prop Specifies the XTextProperty structure to be used. text-prop-return Returns the XTextProperty structure. Structures The XTextProperty structure is defined as follows. typedef struct { unsigned char *value;/* property data */ Atom encoding;/* type of property */ int format; /* 8, 16, or 32 */ unsigned long nitems;/* number of items in value */ } XTextProperty; SEE ALSO XAllocClassHint(3X), XAllocIconSize(3X), XAllocSizeHints(3X), XAllocWMHints(3X), XFree(3X), XSetCommand(3X), XSetTransientForHint(3X), XSetTextProperty(3X), XSetWMClientMachine(3X), XSetWMColormapWindows(3X), XSetWMIconName(3X), XSetWMName(3X), XSetWMProperties(3X), XSetWMProtocols(3X)Xlib - C Language Interface2 November, 1990