Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XtConvert(3x) — HP-UX 9.10

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtConvertAndStore(1)

 

NAME

XtConvert − convert resource type. 

Synopsis

void XtConvert(object, from_type, from, to_type, to_return)

    Widget object;
    String from_type;
    XrmValuePtr from;
    String to_type;
    XrmValuePtr to_return;

Inputs

objectSpecifies the object to use for additional arguments (if any are needed); may be of class Object or any subclass thereof. 

from_typeSpecifies the source type. 

fromSpecifies the value to be converted. 

to_typeSpecifies the destination type. 

Outputs

to_returnReturns the address and the size of the converted value. 

Availability

Superseded by XtConvertAndStore(). 

Description

XtConvert() looks up the appropriate resource converter registered to convert from_type to to_type, computes any additional arguments required by that converter (see XtSetTypeConverter() for an explanation of how these arguments are computed) and then calls XtDirectConvert() or XtCallConverter() depending on whether the converter procedure is an "old-style" or a "new-style" converter.  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. 

Usage

As of Release 4, XtConvert() is superseded by the more general function XtConvertAndStore().  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 Also

XtConvertAndStore(1). 

Copyright O’Reilly & Assoc.  —  X Toolkit Intrinsics Reference Manual © O’Reilly & Associates

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026