PreviousNext

The OM_STRING Macro

The OM_STRING macro creates a string data value. Data strings are of type OM_string, as shown from this code fragment from the xom.h header file:

/*String */

typedef struct {

OM_string_length length;

void *elements;

} OM_string;

#define OM_STRING(string) \

{ (OM_string_length)(sizeof(string)-1), string }

A string is specified in terms of its length or whether or not it terminates with a NULL. OM_string_length is the number of octets by which the string is represented, or it is the OM_LENGTH_UNSPECIFIED value if the string terminates with a NULL.

The bits of a bit string are represented as a sequence of octets. The first octet stores the number of unused bits in the last octet. The bits in the bit string, beginning with the first bit and proceeding to the trailing bit, are placed in bits 7 to 0 of the second octet. These are followed by bits 7 to 0 of the third octet, then by bits 7 to 0 of each octet in turn, followed by as many bits as are required of the final octet commencing with bit 7.