Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages
XmtRegisterEnumConverter(3) FreeBSD Library Functions Manual XmtRegisterEnumConverter(3)

XmtRegisterEnumConverter(), XmtConvertStringToEnum() - a resource converter for enumerated types.

#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)

The representation type for which the converter is to be registered. This string must be permanently allocated.
A sorted array of names for each enumerated value. These names and this array must be permanently allocated.
An array of enumerated values that correspond to each of the strings in the names array. This array must be permanently allocated.
The number of elements in the names and values arrays.
A NULL-terminated array of strings which may optionally appear as prefixes of the strings in the names array. These strings and this array must be permanently allocated.

XmtConvertStringToEnum() 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.

Chapter 8, Utility Functions.
Motif Tools Xmt

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.