Harlequin RIP SDK

Structured data instance type. More...

#include "swdataapi.h"

Data Fields

unsigned char type
 
unsigned char subtype
 
unsigned char flags
 
unsigned char owner_data
 
const void * owner
 
size_t length
 
union {
   const void *   opaque
 
   const char *   string
 
   int   integer
 
   HqBool   boolean
 
   float   real
 
value
 

Detailed Description

Structured data instance type.

Modules may create raw sw_datum values, including arrays and dictionaries (associative arrays), but must ensure that all fields are initialised properly. Static initializers are provided which can be used to initialise local datums, which can then be used directly or copied to initialise dynamically allocated datums.

For a raw sw_datum array of n elements, value.opaque points to a contiguous array of n sw_datum items. For a dictionary of n key/value pairs it points to a contiguous array of n * 2 sw_datum items. (Raw stacks are not useful because their size cannot be safely changed, so push and pop are not supported.) The owner field must be set to NULL for raw datums created by a module, and should never be modified for data provided to the module. Note however it is possible for a module to implement the sw_data_api itself and hence build 'owned' datums.

Modules may treat all arrays and dictionaries as opaque and use the api access methods even for values it has created itself. However, arrays and dictionaries with a non-NULL owner are always opaque and their contents can only be accessed using the API.

Field Documentation

◆ boolean

HqBool sw_datum::boolean

Value for booleans (TRUE or FALSE).

◆ flags

unsigned char sw_datum::flags

No flags defined yet, initialise to zero.

◆ integer

int sw_datum::integer

Value of integers.

◆ length

size_t sw_datum::length

Length of a string, array or dictionary.

◆ opaque

const void* sw_datum::opaque

One of the opaque structured types.

◆ owner

const void* sw_datum::owner

The owner of opaque values. The module should set to NULL for objects it creates, and should never alter this field for opaque objects provided by the RIP.

◆ owner_data

unsigned char sw_datum::owner_data

Data value defined and used by the owner of the data. Initialise to zero for objects created by the module.

◆ real

float sw_datum::real

Value for reals.

◆ string

const char* sw_datum::string

Pointer to an unterminated read-only string.

◆ subtype

unsigned char sw_datum::subtype

Normally zero, see SW_DATUM_SUBTYPES.

◆ type

unsigned char sw_datum::type

One of the SW_DATUM_TYPES values.

◆ 

union { ... } sw_datum::value

A union containing the value of the datum. The branch of the value to use depends on the type field.


The documentation for this struct was generated from the following file: