next up previous contents index
Next: Arrays Up: XDR Functions Previous: Structures

Strings

Since the original XDR string function uses malloc/free (see section 5.7.7 on this problem) we provide a function with the same functionality which uses the GRAPE memory management functions instead:

bool_t g_xdr_string(XDR *xdrp, char **str)
Again a pointer to the string (char array) is needed as second parameter.

You should always use this function which also supports NULL strings to write strings, for an example see the Scene "xdr" method below.

Using strings might lead to machine-dependent data, see section 5.7.7 for a discussion of this problem.



SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.