Skip to content

Commit

Permalink
Replace XField integer 'flags' with string 'subtype'
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Dec 10, 2024
1 parent ae6903c commit 5e1cc22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/xchange.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,17 @@ 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;

/**
* 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.
Expand Down
1 change: 1 addition & 0 deletions src/xstruct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 5e1cc22

Please sign in to comment.