XtDirectConvert()XtDirectConvert()NameXtDirectConvert - explicitly invoke an "old-style" resource converter
and cache result.
Synopsis
void XtDirectConvert(converter, args, num_args, from, to_return)
XtConverter converter;
XrmValuePtr args;
Cardinal num_args;
XrmValuePtr from;
XrmValuePtr to_return;
Inputs
converter Specifies the "old-style" conversion procedure to be called.
args Specifies the argument list that contains the additional
arguments needed to perform the conversion (often NULL).
num_args Specifies the number of additional arguments (often zero).
from Specifies the value to be converted.
Outputs
to_return Returns the converted value.
DescriptionXtDirectConvert() looks in the converter cache to see if the named con‐
version procedure has previously been called with the specified argu‐
ments. If so, it sets the cached resource address and size in
to_return and returns. If no cached value is found, it sets
to_return->addr to NULL and to_return->size to zero and calls converter
with its remaining arguments. The results of the conversion are stored
in the cache and returned in to_return.
If the conversion is successful, to_return->addr will be non-NULL. The
data at this address must be copied immediately by the caller, because
it may be in static storage owned by the type converter procedure.
UsageXtDirectConvert() invokes an "old-style" converter of type XtConverter.
In Release 4, more flexible (and incompatible) "new-style" converters
of type XtTypeConverter were added. Old-style converters are still in
use, and if you have to invoke one explicitly, you must use XtDirect‐
Convert(). If you are writing your own converter, you should use the
new style.
XtConvertAndStore() provides a higher level interface to resource con‐
version, and is easier to use in most cases. It works with both old-
style and new-style converters.
You do not often need, in applications or widgets, to convert between
resource types directly. Generally you can rely on the Intrinsics
resource management code to perform all necessary conversions for you.
When writing a resource converter, however, you may find that you need
to invoke another converter.
Structures
typedef struct {
unsigned int size;
XPointer addr;
} XrmValue, *XrmValuePtr;
See AlsoXtAppAddConverter(1), XtCallConverter(1), XtConvertAndStore(1), XtSet‐
TypeConverter(1),
XtConverter(2), XtTypeConverter(2).
Xt - Resource Management XtDirectConvert()