dsotyptostr
dsotyptostr |
Purpose
Get a string representation from a module type reference.
Synopsis
int dsotyptostr(XPRMcontext ctx,int type, void *value, char *str, int size);
Arguments
ctx
|
Mosel's execution context
|
type
|
Code of the external type
|
value
|
Entity to convert
|
str
|
Destination buffer
|
size
|
Size of
str
|
Return value
Size of the generated string (excluding the terminating null byte) or -1 in case of error.
Further information
1. This function calls directly the
tostring routine of the module (See section
Table of types). It is therefore recommended to check whether the type supports this functionality before using this function (see
gettypeprop).
2. The returned length might be larger than
size-1. In this case this return value is the minimum buffer size (not including the terminating null byte) required to generate the text representation and the destination string
str is not populated.
3. The flag
XPRM_TFSTR_BIN might be added to the type code in order to retrieve a binary representation of the object.
Related topics