next up previous contents index
Next: System Defined Attributes Up: Data Types Previous: Data Types

Attribute Values

 

Attribute values  are normally treated by LINCKS as blocks of memory ended by a zero. They No attributes except the few listed below are dedicated for any particular use, and therefore the interpretation of attribute values is left to the application program. The following declaration (found in liblincks.h and sunlincks.h) should be used for communicating attribute values.

typedef struct {
    int attsize;
    char *attvalue;
} attrval;

The field attsize  contains the block size in number of bytes, while the field attvalue  contains the (lowest) memory address for the block. The memory block pointed to by attvalue do not need to by terminated by a zero byte and can contain any number of zero bytes.

The function GA_GETATTR()    , which retrieves an attribute value, allocates a block for (a copy of) the value, and fills in the length and address of the block in the attrval record provided by the caller. The application program is responsible for free'ing the block.



Martin Sjolin
Thu Jun 15 20:41:59 MET DST 1995