diff options
| author | Chloe M. <chloe@aptel.org> | 2026-08-23 06:36:22 +0000 |
|---|---|---|
| committer | Chloe M. <chloe@aptel.org> | 2026-08-23 06:36:22 +0000 |
| commit | baff5613531a0e0f8c7397f9b87a8ce1b6e2f5f4 (patch) | |
| tree | 2de24b8251b00e4a2725f075948cdd0a82e1f2a0 /head | |
| parent | c668a179b3b3099ef51bb98059ead6f6db8df878 (diff) | |
defconf: Add data types and value defines
Signed-off-by: Chloe M. <chloe@aptel.org>
Diffstat (limited to 'head')
| -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 */ |
