diff options
| -rw-r--r-- | head/defconf/data.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/head/defconf/data.h b/head/defconf/data.h new file mode 100644 index 0000000..5712857 --- /dev/null +++ b/head/defconf/data.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2026, Apollo Telephone Laboratories. + * Provided under the BSD-3 clause. + */ + +#ifndef DEFCONF_DATA_H +#define DEFCONF_DATA_H 1 + +#include <stdint.h> +#include <stddef.h> + +/* + * Represents valid data types + * + * @DATA_TYPE_INT: Data is integer + * @DATA_TYPE_STR: Data is string + */ +typedef enum { + DATA_TYPE_INT, + DATA_TYPE_STR +} data_type_t; + +/* + * Represents data that has been used within the config + * + * @type: Type of data + * @v: Used if data is an integer + * @s: Used if data is a string + */ +struct data_value { + data_type_t type; + union { + size_t v; + char *s; + }; +}; + +#endif /* !DEFCONF_DATA_H */ |
