NAME
XStringListToTextProperty, XTextPropertyToStringList, XFreeStringList, XTextProperty - convert string lists and text property structure
SYNTAX
Status XStringListToTextProperty(char **_l_i_s_t, int _c_o_u_n_t,
XTextProperty *_t_e_x_t___p_r_o_p___r_e_t_u_r_n);
Status XTextPropertyToStringList(XTextProperty *_t_e_x_t___p_r_o_p, char
***_l_i_s_t___r_e_t_u_r_n, int *_c_o_u_n_t___r_e_t_u_r_n);
void XFreeStringList(char **_l_i_s_t);
ARGUMENTS
-
_c_o_u_n_t
Specifies the number of strings.
-
-
_c_o_u_n_t___r_e_t_u_r_n
Returns the number of strings.
-
-
_l_i_s_t
Specifies the list of strings to be freed.
-
-
_l_i_s_t
Specifies a list of null-terminated character strings.
-
-
_l_i_s_t___r_e_t_u_r_n
Returns a list of null-terminated character strings.
-
-
_t_e_x_t___p_r_o_p
Specifies the
-
_X_T_e_x_t_P_r_o_p_e_r_t_y
structure to be used.
-
_t_e_x_t___p_r_o_p___r_e_t_u_r_n
Returns the
-
_X_T_e_x_t_P_r_o_p_e_r_t_y
structure.
DESCRIPTION
The
_X_S_t_r_i_n_g_L_i_s_t_T_o_T_e_x_t_P_r_o_p_e_r_t_y
function sets the specified
_X_T_e_x_t_P_r_o_p_e_r_t_y
to be of type STRING (format 8) with a value representing the
concatenation of the specified list of null-separated character strings.
An extra null byte (which is not included in the nitems member)
is stored at the end of the value field of text_prop_return.
The strings are assumed (without verification) to be in the STRING encoding.
If insufficient memory is available for the new value string,
_X_S_t_r_i_n_g_L_i_s_t_T_o_T_e_x_t_P_r_o_p_e_r_t_y
does not set any fields in the
_X_T_e_x_t_P_r_o_p_e_r_t_y
structure and returns a zero status.
Otherwise, it returns a nonzero status.
To free the storage for the value field, use
_X_F_r_e_e.
The
_X_T_e_x_t_P_r_o_p_e_r_t_y_T_o_S_t_r_i_n_g_L_i_s_t
function returns a list of strings representing the null-separated elements
of the specified
_X_T_e_x_t_P_r_o_p_e_r_t_y
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 NULL (encoding 0).
The contents of the property are not null-terminated.
If insufficient memory is available for the list and its elements,
_X_T_e_x_t_P_r_o_p_e_r_t_y_T_o_S_t_r_i_n_g_L_i_s_t
sets no return values and returns a zero status.
Otherwise, it returns a nonzero status.
To free the storage for the list and its contents, use
_X_F_r_e_e_S_t_r_i_n_g_L_i_s_t.
The
_X_F_r_e_e_S_t_r_i_n_g_L_i_s_t
function releases memory allocated by
_X_m_b_T_e_x_t_P_r_o_p_e_r_t_y_T_o_T_e_x_t_L_i_s_t,
_X_u_t_f_8_T_e_x_t_P_r_o_p_e_r_t_y_T_o_T_e_x_t_L_i_s_t
and
_X_T_e_x_t_P_r_o_p_e_r_t_y_T_o_S_t_r_i_n_g_L_i_s_t
and the missing charset list allocated by
_X_C_r_e_a_t_e_F_o_n_t_S_e_t.
STRUCTURES
The
_X_T_e_x_t_P_r_o_p_e_r_t_y
structure contains:
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(3X11),
XAllocIconSize(3X11),
XAllocSizeHints(3X11),
XAllocWMHints(3X11),
XFree(3X11),
XSetCommand(3X11),
XSetTransientForHint(3X11),
XSetTextProperty(3X11),
XSetWMClientMachine(3X11),
XSetWMColormapWindows(3X11),
XSetWMIconName(3X11),
XSetWMName(3X11),
XSetWMProperties(3X11),
XSetWMProtocols(3X11)
_X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e