|
NAMEXmtRegisterEnumConverter(), XmtConvertStringToEnum() - a resource converter for enumerated types.SYNOPSIS#include <Xmt/Converters.h>
Boolean XmtConvertStringToEnum(Display *dpy, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *data) void XmtRegisterEnumConverter(String type, String *names, int *values, int num, String *prefixes) ARGUMENTSINPUTS
DESCRIPTIONXmtConvertStringToEnum() is a ``new-style'' resource converter of type XtTypeConverter. It is a generalized resource converter appropriate for converting any enumerated type. It is intended to be registered with the Xt resource conversion mechanism rather than being invoked directly, so its arguments are not documented here.XmtRegisterEnumConverter() registers XmtConvertStringToEnum() for the representation type type. The converter is registered so that type, names, values, num_values, and prefixes are passed to it in its args argument. names is an array of strings that will be recognized by the converter. It must be in alphabetical order so that it can be searched with a binary search algorithm. values is an array of integers that specifies the enumerated value that corresponds to each string in the names array. These values are specified as integers, but the converter will work correctly even when conversion is requested to a one-byte or a two-byte value. To save space in widget instance records, enumerated values are often stored in one byte unsigned char fields. prefixes is a NULL-terminated array of strings that specify optional prefixes that the converter will recognize in front of any string it converts. Each of these prefixes is optional, but if they do occur, they must appear in the order specified in this array. All of the strings and arrays passed to this function must be permanent-their values must not change, and if they are in allocated memory, that memory must not be freed for the life time of the application. This is generally ensured by using statically initialized arrays. SEE ALSOChapter 8, Utility Functions.
Visit the GSP FreeBSD Man Page Interface. |