Header file defining the Structured data callback API. More...
Data Structures | |
struct | sw_datum |
Structured data instance type. More... | |
struct | sw_data_api |
A structure containing callback functions for structured data access. More... | |
struct | sw_data_match |
A structure used for extracting multiple values from an array or dictionary in one go. More... | |
Macros | |
#define | SW_DATUM_INVALID {SW_DATUM_TYPE_INVALID} |
Auto/static initializer for sw_datum invalid values. More... | |
#define | SW_DATUM_NOTHING {SW_DATUM_TYPE_NOTHING} |
Auto/static initializer for sw_datum nothing values. More... | |
#define | SW_DATUM_NULL {SW_DATUM_TYPE_NULL} |
Auto/static initializer for sw_datum null values. More... | |
#define | SW_DATUM_INTEGER(_int) {SW_DATUM_TYPE_INTEGER, 0,0,0, NULL, 0, { (void *)((intptr_t)(_int)) }} |
Auto/static initializer for sw_datum integer values. More... | |
#define | SW_DATUM_BOOLEAN(_bool) {SW_DATUM_TYPE_BOOLEAN, 0,0,0, NULL, 0, { (void *)((intptr_t)(_bool)) }} |
Auto/static initializer for sw_datum boolean values. More... | |
#define | SW_DATUM_STRING(_str) {SW_DATUM_TYPE_STRING, 0,0,0, NULL, sizeof("" _str "") - 1, {(const void *)("" _str "")}} |
Auto/static initializer for sw_datum string values. More... | |
#define | SW_DATUM_NAME(_str) {SW_DATUM_TYPE_STRING, SW_DATUM_SUBTYPE_NAME_STRING,0,0, NULL, sizeof("" _str "") - 1, {(const void *)("" _str "")}} |
Auto/static initializer for sw_datum name values. More... | |
#define | SW_DATUM_ARRAY(_array, _len) {SW_DATUM_TYPE_ARRAY, 0,0,0, NULL, (_len), { (void *)(_array) }} |
Auto/static initializer for sw_datum array values. More... | |
#define | SW_DATUM_STACK(_stack, _len) {SW_DATUM_TYPE_ARRAY, SW_DATUM_SUBTYPE_STACK_ARRAY,0,0, NULL, (_len), { (void *)(_stack) }} |
Auto/static initializer for sw_datum stack values. More... | |
#define | SW_DATUM_DICT(_dict, _len) {SW_DATUM_TYPE_DICT, 0,0,0, NULL, (_len), { (void *)(_dict) }} |
Auto/static initializer for sw_datum dictionary values. More... | |
#define | SW_DATA_ARRAY_LENGTH(_array) (sizeof(_array) / sizeof((_array)[0])) |
Count the members of a local data array. Useful for statically initialising arrays. | |
#define | SW_DATA_DICT_LENGTH(_dict) (SW_DATA_ARRAY_LENGTH(_dict) >> 1) |
Count the members of a local data dictionary. Useful for statically initialising dictionaries. | |
#define | SW_DATUM_0_0F 0 |
A constant of real value 0.0 for use with the SW_DATUM_FLOAT() static initializer. | |
#define | SW_DATUM_1_0F 1065353216 |
A constant of real value 1.0 for use with the SW_DATUM_FLOAT() static initializer. | |
#define | SW_DATUM_0_5F 1056964608 |
A constant of real value 0.5 for use with the SW_DATUM_FLOAT() static initializer. | |
#define | SW_DATUM_FLOAT(_real) {SW_DATUM_TYPE_FLOAT, 0,0,0, NULL, 0, { (void *)((intptr_t)(_real)) }} |
Auto/static initializer for sw_datum float values, for use with the defined constants that can be used with this initializer. More... | |
#define | SW_DATUM_REQUIREDKEY(type, name) {SW_DATUM_BIT_##type,SW_DATUM_STRING(""name""),SW_DATUM_NOTHING} |
A key initializer macro to help build the sw_data_match structure. More... | |
#define | SW_DATUM_OPTIONALKEY(type, name) {SW_DATUM_BIT_##type|SW_DATUM_BIT_NOTHING,SW_DATUM_STRING(""name""),SW_DATUM_NOTHING} |
A key initializer macro to help build the sw_data_match structure. More... | |
Typedefs | |
typedef HqnResult | sw_data_result |
Type of return values from sw_data_api functions. More... | |
typedef struct sw_data_api | sw_data_api |
Type definition for the structured data interface implementation. | |
typedef struct sw_datum | sw_datum |
Structured data instance type. More... | |
typedef struct sw_data_match | sw_data_match |
A structure used for matching multiple datum entries in one go. | |
typedef struct sw_data_iterator | sw_data_iterator |
An opaque type used by the data provider to iterate data structures. | |
Functions | |
HqnResult | swdata_result_translate (sw_data_result result) |
Translate a data API-specific error code to a generic HqnResult error code. More... | |
void | sw_datum_get_integer (const sw_datum *datum, int value, sw_data_result result) |
A utility macro to extract an integer value from a sw_datum object of integer or float type. More... | |
void | sw_datum_get_real (const sw_datum *datum, float_or_double_specifier type, float_or_double value, sw_data_result result) |
A utility macro to extract a real value from a sw_datum object of integer or float type. More... | |
Header file defining the Structured data callback API.
Copyright (C) 2023 Global Graphics Software Ltd. All rights reserved.
This source code contains the confidential and trade secret information of Global Graphics Software Ltd. It may not be used, copied or distributed for any reason except as set forth in the applicable Global Graphics license agreement.