ADTF
3.18.2
|
Public C-API for Data Description Language. More...
Go to the source code of this file.
Typedefs | |
typedef void * | DDL_CAPI_Handle_T |
A handle for a ddl description. More... | |
typedef void * | DDL_CAPI_Codec_Handle_T |
A handle for encoding/decoding a specific struct. More... | |
Enumerations | |
enum | DDL_CAPI_DataRepresentation { DDL_CAPI_Data_serialized = 0 , DDL_CAPI_Data_deserialized } |
Enum type for the representation of the input data. More... | |
enum | type_t { data_type , enum_type , struct_type } |
Enum type for the representation of struct element data type. More... | |
Functions | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_string_free (char **const memory) |
Frees a string at memory . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_stringarray_free (const DDL_CAPI_Handle_T ddl, size_t count, char ***const memory) |
Frees a string array at memory . More... | |
A_UTIL_DLL_EXPORT const char * | ddl_capi_last_error (const DDL_CAPI_Handle_T ddl) |
Returns the last error for the given ddl . More... | |
A_UTIL_DLL_EXPORT const char * | ddl_capi_last_codecerror (const DDL_CAPI_Codec_Handle_T ddl) |
Returns the last error for the given codec . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_load_from_file (const char *path, DDL_CAPI_Handle_T *const ddl) |
Loads a ddl from a file with the given path . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_load_from_string (const char *xml, DDL_CAPI_Handle_T *const ddl) |
Loads a ddl from the xml string. More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_free (DDL_CAPI_Handle_T *const ddl) |
Frees a ddl handle. More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_ddl_tostring (const DDL_CAPI_Handle_T ddl, char **const xml) |
Returns the xml string for a ddl handle. More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_ddl_tofile (const DDL_CAPI_Handle_T ddl, const char *path) |
Saves a ddl at the given file path . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_structs (const DDL_CAPI_Handle_T ddl, size_t *const count, char ***const struct_names) |
Retrieve all structs_names defined in the ddl . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_struct_data (const DDL_CAPI_Handle_T ddl, const char *name, size_t *const alignment) |
Retrieve the alignment for a given struct name . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_struct_elements (const DDL_CAPI_Handle_T ddl, const char *name, size_t *const count, char ***const struct_elements) |
Retrieve all struct_elements names for a given struct name . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_element_data (const DDL_CAPI_Handle_T ddl, const char *struct_name, const char *element_name, char **const type_name, type_t *const typeOfType, size_t *const arraysize, size_t *const bytepos, size_t *const bitpos, size_t *const alignment, size_t *const byteorder) |
Retrieve data for a given element element_name of struct struct_name . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_type_data (const DDL_CAPI_Handle_T ddl, const char *type_name, bool *const predefined, size_t *const numbits, size_t *const arraysize) |
Retrieve data for a given type type_name . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_enum_data (const DDL_CAPI_Handle_T ddl, const char *enum_name, char **const type, bool *const predefined, size_t *const count, char ***const entry_names, char ***const entry_values) |
Retrieve data for a given enum enum_name . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_resolve_type (const DDL_CAPI_Handle_T ddl, const char *type, char **const xml) |
Retrieve a minimalistic DDL that only resolves the specified type . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_struct_buffer_size (const DDL_CAPI_Handle_T ddl, const char *struct_name, const DDL_CAPI_DataRepresentation representation, size_t *const data_size) |
Returns the data_size of struct_name in the specified representation . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_create (const DDL_CAPI_Handle_T ddl, const char *struct_name, void *const data, const size_t data_size, const DDL_CAPI_DataRepresentation representation, DDL_CAPI_Codec_Handle_T *const codec) |
Creates a codec for the given struct_name . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_free (DDL_CAPI_Codec_Handle_T *const codec) |
Frees a codec handle. More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_get_element_index (const DDL_CAPI_Codec_Handle_T codec, const char *element, size_t *const index) |
Gets the index of the specified element . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_set_element_byIndex (const DDL_CAPI_Codec_Handle_T codec, const size_t index, const void *data) |
Sets the data of the element specified by index . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_set_element_byName (const DDL_CAPI_Codec_Handle_T codec, const char *element, const void *data) |
Sets the data of element . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_get_substruct_index (const DDL_CAPI_Codec_Handle_T codec, const char *substruct, size_t *const index) |
Gets the index of the specified substruct . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_set_substruct_byIndex (const DDL_CAPI_Codec_Handle_T codec, const size_t index, const void *data, const size_t data_size) |
Sets the data of the sub-struct specified by index . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_set_substruct_byName (const DDL_CAPI_Codec_Handle_T codec, const char *substruct, const void *data, const size_t data_size) |
Sets the data of substruct . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_get_array_index (const DDL_CAPI_Codec_Handle_T codec, const char *array, size_t *const index) |
Gets the index of the specified array . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_get_array_size (const DDL_CAPI_Codec_Handle_T codec, const char *array, size_t *const data_size) |
Gets the size of the specified array . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_set_array_byIndex (const DDL_CAPI_Codec_Handle_T codec, const size_t index, const void *data, const size_t data_size) |
Stores data into the array specified by index . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_set_array_byName (const DDL_CAPI_Codec_Handle_T codec, const char *array, const void *data, const size_t data_size) |
Writes data to the location of array . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_get_element_byIndex (const DDL_CAPI_Codec_Handle_T codec, size_t index, void *const data) |
Gets the data of the element specified by index . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_get_element_byName (const DDL_CAPI_Codec_Handle_T codec, const char *element, void *const data) |
Gets the data of element . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_get_substruct_byIndex (const DDL_CAPI_Codec_Handle_T codec, const size_t index, void *const data, const size_t data_size) |
Copies the substruct specified by index into data in the format and representation specified by codec . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_get_substruct_byName (const DDL_CAPI_Codec_Handle_T codec, const char *substruct, void *const data, const size_t data_size) |
Copies the substruct into data in the format and representation specified by codec . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_get_array_byIndex (const DDL_CAPI_Codec_Handle_T codec, const size_t index, void *const data, const size_t size) |
Copies the array specified by index into data in the format and representation specified by codec . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_get_array_byName (const DDL_CAPI_Codec_Handle_T codec, const char *array, void *const data, const size_t size) |
Copies the array into data in the format and representation specified by codec . More... | |
A_UTIL_DLL_EXPORT int32_t | ddl_capi_codec_transform (const DDL_CAPI_Codec_Handle_T dest, const DDL_CAPI_Codec_Handle_T source) |
Writes all elements from source into destination . More... | |
Public C-API for Data Description Language.
Copyright @ 2023 VW Group. All rights reserved. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
Definition in file ddl_capi.h.
typedef void* DDL_CAPI_Codec_Handle_T |
A handle for encoding/decoding a specific struct.
It is optained by calling ddl_capi_codec_create
and must be freed using ddl_capi_codec_free
.
Definition at line 41 of file ddl_capi.h.
typedef void* DDL_CAPI_Handle_T |
A handle for a ddl description.
It is optained by calling ddl_capi_load_from_file
or ddl_capi_load_from_string
and must be freed using ddl_capi_free
.
Definition at line 34 of file ddl_capi.h.
Enum type for the representation of the input data.
Enumerator | |
---|---|
DDL_CAPI_Data_serialized | value for serialized representation |
DDL_CAPI_Data_deserialized | value for deserialized representation |
Definition at line 46 of file ddl_capi.h.
enum type_t |
Enum type for the representation of struct element data type.
Enumerator | |
---|---|
data_type | value for data type |
enum_type | value for enum type |
struct_type | value for struct type |
Definition at line 54 of file ddl_capi.h.
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_create | ( | const DDL_CAPI_Handle_T | ddl, |
const char * | struct_name, | ||
void *const | data, | ||
const size_t | data_size, | ||
const DDL_CAPI_DataRepresentation | representation, | ||
DDL_CAPI_Codec_Handle_T *const | codec | ||
) |
Creates a codec
for the given struct_name
.
The returned handle codec
must be freed with ddl_capi_codec_free
. data
must be valid until the codec
handle is freed. data_size
must be large enough to hold the struct data (
[in] | ddl | handle of type DDL_CAPI_Handle |
[in] | struct_name | name of the struct to en-/decode |
[in] | data | pointer to an allocated memory region of size data_size to use |
[in] | data_size | size of the memory region |
[in] | representation | representation of the data |
[out] | codec | a handle of type DDL_CAPI_Codec_Handle |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_free | ( | DDL_CAPI_Codec_Handle_T *const | codec | ) |
Frees a codec
handle.
Must be called after a successful call to function ddl_capi_codec_create to clean up memory. Successful means that ddl_capi_codec_create returns a valid pointer even if return is not 0.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_get_array_byIndex | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const size_t | index, | ||
void *const | data, | ||
const size_t | size | ||
) |
Copies the array specified by index
into data
in the format and representation specified by codec
.
data_size
bytes are copied into data
which must be big enough. Additionally data_size
must be the size of the array in the format and representation specified by codec
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | index | index specifying the array |
[in] | data | pointer to the memory where the array data should be stored |
[in] | size | size of the array in bytes |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_get_array_byName | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const char * | array, | ||
void *const | data, | ||
const size_t | size | ||
) |
Copies the array
into data
in the format and representation specified by codec
.
data_size
bytes are copied into data
which must be big enough. Additionally data_size
must be the size of the array in the format and representation specified by codec
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | array | path to the array relative to the codec |
[in] | data | pointer to the memory where the array data should be stored |
[in] | size | size of the array in bytes |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_get_array_index | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const char * | array, | ||
size_t *const | index | ||
) |
Gets the index
of the specified array
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | array | path to the array relative to the codec |
[out] | index | index of the array |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_get_array_size | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const char * | array, | ||
size_t *const | data_size | ||
) |
Gets the size
of the specified array
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | array | path to the array relative to the codec |
[out] | data_size | the byte size of the given array |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_get_element_byIndex | ( | const DDL_CAPI_Codec_Handle_T | codec, |
size_t | index, | ||
void *const | data | ||
) |
Gets the data
of the element specified by index
.
data
must be big enough to store the element.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | index | index specifying the elemenet |
[in] | data | pointer to the memory where the element data should be stored |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_get_element_byName | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const char * | element, | ||
void *const | data | ||
) |
Gets the data
of element
.
data
must be big enough to store the element.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | element | path to the element relative to the codec |
[in] | data | pointer to the memory where the element data should be stored |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_get_element_index | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const char * | element, | ||
size_t *const | index | ||
) |
Gets the index
of the specified element
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | element | path to the element relative to the codec |
[out] | index | index of that element |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_get_substruct_byIndex | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const size_t | index, | ||
void *const | data, | ||
const size_t | data_size | ||
) |
Copies the substruct specified by index
into data
in the format and representation specified by codec
.
data_size
bytes are copied into data
which must be big enough. Additionally data_size
must be the size of the substruct in the format and representation specified by codec
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | index | index specifying the sub-struct |
[in] | data | pointer to the memory where the sub-struct data should be stored |
[in] | data_size | size of the sub-struct in bytes |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_get_substruct_byName | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const char * | substruct, | ||
void *const | data, | ||
const size_t | data_size | ||
) |
Copies the substruct
into data
in the format and representation specified by codec
.
data_size
bytes are copied into data
which must be big enough. Additionally data_size
must be the size of the substruct in the format and representation specified by codec
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | substruct | path to the sub-struct relative to the codec |
[in] | data | pointer to the memory where the sub-struct data should be stored |
[in] | data_size | size of the sub-struct in bytes |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_get_substruct_index | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const char * | substruct, | ||
size_t *const | index | ||
) |
Gets the index
of the specified substruct
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | substruct | path to the sub-struct relative to the codec |
[out] | index | index of the sub-struct |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_set_array_byIndex | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const size_t | index, | ||
const void * | data, | ||
const size_t | data_size | ||
) |
Stores data
into the array specified by index
.
data
must be in the format and representation specified by codec
. Additionally data_size
must be the size of the array in the format and representation specified by codec
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | index | index of the array |
[in] | data | pointer to the data the array should be set to |
[in] | data_size | size of data in bytes |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_set_array_byName | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const char * | array, | ||
const void * | data, | ||
const size_t | data_size | ||
) |
Writes data
to the location of array
.
data
must be in the format and representation specified by codec
. Additionally data_size
must be the size of the array in the format and representation specified by codec
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | array | path to the array relative to the codec |
[in] | data | pointer to the data the array should be set to |
[in] | data_size | size of data in bytes |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_set_element_byIndex | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const size_t | index, | ||
const void * | data | ||
) |
Sets the data
of the element specified by index
.
data
must be a pointer to memory with at least the same size as the element specified by the index.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | index | index of the element |
[in] | data | pointer to the data the element should be set to |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_set_element_byName | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const char * | element, | ||
const void * | data | ||
) |
Sets the data
of element
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | element | path to the element relative to the codec |
[in] | data | pointer to the data the element should be set to |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_set_substruct_byIndex | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const size_t | index, | ||
const void * | data, | ||
const size_t | data_size | ||
) |
Sets the data
of the sub-struct specified by index
.
data
must be in the format and representation specified by codec
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | index | index of the sub-struct |
[in] | data | pointer to the data the sub-struct should be set to |
[in] | data_size | size of data in byte |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_set_substruct_byName | ( | const DDL_CAPI_Codec_Handle_T | codec, |
const char * | substruct, | ||
const void * | data, | ||
const size_t | data_size | ||
) |
Sets the data
of substruct
.
data
must be in the format and representation specified by codec
.
[in] | codec | a handle of type DDL_CAPI_Codec_Handle |
[in] | substruct | path to the sub-struct relative to the codec |
[in] | data | pointer to the data the sub-struct should be set to |
[in] | data_size | size of data in byte |
A_UTIL_DLL_EXPORT int32_t ddl_capi_codec_transform | ( | const DDL_CAPI_Codec_Handle_T | dest, |
const DDL_CAPI_Codec_Handle_T | source | ||
) |
Writes all elements from source
into destination
.
[in] | dest | a handle of type DDL_CAPI_Codec_Handle from which the data is read |
[in] | source | a handle of type DDL_CAPI_Codec_Handle to which the data is written |
A_UTIL_DLL_EXPORT int32_t ddl_capi_ddl_tofile | ( | const DDL_CAPI_Handle_T | ddl, |
const char * | path | ||
) |
Saves a ddl
at the given file path
.
[in] | ddl | handle of type DDL_CAPI_Handle |
[in] | path | path to a ddl file |
A_UTIL_DLL_EXPORT int32_t ddl_capi_ddl_tostring | ( | const DDL_CAPI_Handle_T | ddl, |
char **const | xml | ||
) |
Returns the xml
string for a ddl
handle.
The returned string xml
needs to be cleaned up using ddl_capi_string_free
after use.
[in] | ddl | handle of type DDL_CAPI_Handle |
[out] | xml | xml-string containig the ddl description |
A_UTIL_DLL_EXPORT int32_t ddl_capi_element_data | ( | const DDL_CAPI_Handle_T | ddl, |
const char * | struct_name, | ||
const char * | element_name, | ||
char **const | type_name, | ||
type_t *const | typeOfType, | ||
size_t *const | arraysize, | ||
size_t *const | bytepos, | ||
size_t *const | bitpos, | ||
size_t *const | alignment, | ||
size_t *const | byteorder | ||
) |
Retrieve data for a given element element_name
of struct struct_name
.
For the documentation of the data please have a look in the ddl documentation. If arraysize
is negative then the array is dynamic. The returned string type
needs to be cleaned up using ddl_capi_string_free
after use.
[in] | ddl | handle of type DDL_CAPI_Handle |
[in] | struct_name | name of the struct |
[in] | element_name | name of the struct element |
[out] | type_name | string containing the type name of the element |
[out] | typeOfType | the underlaying type of element type_name |
[out] | arraysize | array size of the element |
[out] | bytepos | the byte position of the element |
[out] | bitpos | the bit position of the element |
[out] | alignment | the alignment of the element |
[out] | byteorder | the byte order of the element |
A_UTIL_DLL_EXPORT int32_t ddl_capi_enum_data | ( | const DDL_CAPI_Handle_T | ddl, |
const char * | enum_name, | ||
char **const | type, | ||
bool *const | predefined, | ||
size_t *const | count, | ||
char ***const | entry_names, | ||
char ***const | entry_values | ||
) |
Retrieve data for a given enum enum_name
.
For the documentation of the data please have a look in the ddl documentation. The returned string type
needs to be cleaned up using ddl_capi_string_free
after use. The returned string arrays entry_names
and entry_values
of size count
need to be cleaned up using ddl_capi_stringarray_free
after use.
[in] | ddl | handle of type DDL_CAPI_Handle |
[in] | enum_name | enum name |
[out] | type | name of the underlying type |
[out] | predefined | whether the enum is predefined |
[out] | count | number of enum elements |
[out] | entry_names | a string array containing the names of all enum elements |
[out] | entry_values | a string array containing the values of all enum elements |
A_UTIL_DLL_EXPORT int32_t ddl_capi_free | ( | DDL_CAPI_Handle_T *const | ddl | ) |
Frees a ddl
handle.
Must be called after a successful call to function ddl_capi_load_from_XXX to clean up memory. Successful means that ddl_capi_load_from_XXX returns a valid pointer even if return is not 0.
[in] | ddl | handle of type DDL_CAPI_Handle |
A_UTIL_DLL_EXPORT const char* ddl_capi_last_codecerror | ( | const DDL_CAPI_Codec_Handle_T | ddl | ) |
Returns the last error for the given codec
.
The returned string is valid until the next function call.
[in] | ddl | handle of type DDL_CAPI_Codec_Handle |
A_UTIL_DLL_EXPORT const char* ddl_capi_last_error | ( | const DDL_CAPI_Handle_T | ddl | ) |
Returns the last error for the given ddl
.
The returned string is valid until the next function call.
[in] | ddl | handle of type DDL_CAPI_Handle |
A_UTIL_DLL_EXPORT int32_t ddl_capi_load_from_file | ( | const char * | path, |
DDL_CAPI_Handle_T *const | ddl | ||
) |
Loads a ddl
from a file with the given path
.
[in] | path | path to a ddl file |
[out] | ddl | handle of type DDL_CAPI_Handle |
A_UTIL_DLL_EXPORT int32_t ddl_capi_load_from_string | ( | const char * | xml, |
DDL_CAPI_Handle_T *const | ddl | ||
) |
Loads a ddl
from the xml
string.
[in] | xml | xml-string with ddl |
[out] | ddl | handle of type DDL_CAPI_Handle |
A_UTIL_DLL_EXPORT int32_t ddl_capi_resolve_type | ( | const DDL_CAPI_Handle_T | ddl, |
const char * | type, | ||
char **const | xml | ||
) |
Retrieve a minimalistic DDL that only resolves the specified type
.
The returned string xml
needs to be cleaned up using ddl_capi_string_free
after use.
[in] | ddl | handle of type DDL_CAPI_Handle |
[in] | type | the type that the new ddl resolves |
[out] | xml | an xml-string containing the new ddl |
A_UTIL_DLL_EXPORT int32_t ddl_capi_string_free | ( | char **const | memory | ) |
Frees a string at memory
.
Must be called after any call to a ddl c-api function that returns a string to clean up memory.
[in] | memory | pointer to string in memory to be freed |
A_UTIL_DLL_EXPORT int32_t ddl_capi_stringarray_free | ( | const DDL_CAPI_Handle_T | ddl, |
size_t | count, | ||
char ***const | memory | ||
) |
Frees a string array at memory
.
Must be called after any call to a ddl c-api function that returns a string array to clean up memory.
[in] | ddl | handle of type DDL_CAPI_Handle |
[in] | count | number of elements in string array |
[in] | memory | pointer to array location in memory to be freed |
A_UTIL_DLL_EXPORT int32_t ddl_capi_struct_buffer_size | ( | const DDL_CAPI_Handle_T | ddl, |
const char * | struct_name, | ||
const DDL_CAPI_DataRepresentation | representation, | ||
size_t *const | data_size | ||
) |
Returns the data_size
of struct_name
in the specified representation
.
[in] | ddl | handle of type DDL_CAPI_Handle |
[in] | struct_name | name of the struct to en-/decode |
[in] | representation | representation of the data |
[out] | data_size | the size of an instance of the struct in specified representation |
A_UTIL_DLL_EXPORT int32_t ddl_capi_struct_data | ( | const DDL_CAPI_Handle_T | ddl, |
const char * | name, | ||
size_t *const | alignment | ||
) |
Retrieve the alignment for a given struct name
.
For the documentation of the data please have a look in the ddl documentation.
[in] | ddl | handle of type DDL_CAPI_Handle |
[in] | name | name of the struct |
[out] | alignment | the alignment of the struct |
A_UTIL_DLL_EXPORT int32_t ddl_capi_struct_elements | ( | const DDL_CAPI_Handle_T | ddl, |
const char * | name, | ||
size_t *const | count, | ||
char ***const | struct_elements | ||
) |
Retrieve all struct_elements
names for a given struct name
.
The returned string array struct_elements
needs to be cleaned up using ddl_capi_stringarray_free
after use.
[in] | ddl | handle of type DDL_CAPI_Handle |
[in] | name | name of the struct |
[out] | count | number of elements in the structs |
[out] | struct_elements | string array containing all struct element names (fields) |
A_UTIL_DLL_EXPORT int32_t ddl_capi_structs | ( | const DDL_CAPI_Handle_T | ddl, |
size_t *const | count, | ||
char ***const | struct_names | ||
) |
Retrieve all structs_names
defined in the ddl
.
The returned string array struct_names
needs to be cleaned up using ddl_capi_stringarray_free
after use.
[in] | ddl | handle of type DDL_CAPI_Handle |
[out] | count | number of structs |
[out] | struct_names | a string array containing all struct names |
A_UTIL_DLL_EXPORT int32_t ddl_capi_type_data | ( | const DDL_CAPI_Handle_T | ddl, |
const char * | type_name, | ||
bool *const | predefined, | ||
size_t *const | numbits, | ||
size_t *const | arraysize | ||
) |
Retrieve data for a given type type_name
.
arraysize
is dynamic if negativ. For the documentation of the data please have a look in the ddl documentation.
[in] | ddl | handle of type DDL_CAPI_Handle |
[in] | type_name | type name |
[out] | predefined | whether the type is predefined |
[out] | numbits | the number of bits the type consists of |
[out] | arraysize | the array size of the type |