GSP
Quick Navigator

Search Site

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

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  XMTREGISTERENUMCONVERTER (3)

NAME

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

CONTENTS

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)

ARGUMENTS

INPUTS
type The representation type for which the converter is to be registered. This string must be permanently allocated.
names A sorted array of names for each enumerated value. These names and this array must be permanently allocated.
values An array of enumerated values that correspond to each of the strings in the names array. This array must be permanently allocated.
num_values The number of elements in the names and values arrays.
prefixes 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.

DESCRIPTION

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.

SEE ALSO

Chapter 8, Utility Functions.
Search for    or go to Top of page |  Section 3 |  Main Index


Xmt XMTREGISTERENUMCONVERTER (3) Motif Tools

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