From 5e1cc22868256e3bd7246a7bc462f7cbc82df56a Mon Sep 17 00:00:00 2001 From: Attila Kovacs Date: Tue, 10 Dec 2024 13:42:41 +0100 Subject: [PATCH] Replace XField integer 'flags' with string 'subtype' --- include/xchange.h | 4 ++-- src/xstruct.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/xchange.h b/include/xchange.h index 086d6f1..8a00bbc 100644 --- a/include/xchange.h +++ b/include/xchange.h @@ -140,9 +140,9 @@ typedef struct XField { char *name; ///< Pointer to a designated local name buffer. It may not contain a separator (see X_SEP). char *value; ///< Pointer to designated local string content (or structure)... XType type; ///< The underlyng data type + char *subtype; ///< Descriptive subtype, such a a mime type (if any) int ndim; ///< The dimensionality of the data int sizes[X_MAX_DIMS]; ///< The sizes along each dimension - uint32_t flags; ///< (optional) flags that specific data exchange mechanism may use, e.g. for BSON subtype. boolean isSerialized; ///< Whether the fields is stored in serialized (string) format. struct XField *next; ///< Pointer to the next linked element (if inside an XStructure). } XField; @@ -150,7 +150,7 @@ typedef struct XField { /** * Static initializer for the XField data structure. */ -#define X_FIELD_INIT {NULL} +#define X_FIELD_INIT {NULL, NULL, X_UNKNOWN, NULL, 0, {0}, FALSE, NULL} /** * \brief SMA-X structure object, containing a linked-list of XField elements. diff --git a/src/xstruct.c b/src/xstruct.c index 0bdbab5..01a3e26 100644 --- a/src/xstruct.c +++ b/src/xstruct.c @@ -813,6 +813,7 @@ void xClearField(XField *f) { } if(f->name != NULL) free(f->name); + if(f->subtype) free(f->subtype); memset(f, 0, sizeof(XField)); }