add pointers for string types
This commit is contained in:
parent
5aeff5d0ce
commit
387bad5a80
1 changed files with 14 additions and 1 deletions
|
|
@ -69,6 +69,19 @@ struct cfglr_element {
|
|||
}\
|
||||
}
|
||||
|
||||
#define CFGLR_ELEMENT_PTR(KEY, POINTER, TYPE, SIZE, DEFAULT, DEF_SIZE, SIGNALERS...) (cfglr_element_t){\
|
||||
.key = KEY,\
|
||||
.data = POINTER,\
|
||||
.datatype = TYPE,\
|
||||
.datatype_size = SIZE,\
|
||||
.default_data = (void*)DEFAULT,\
|
||||
.default_size = DEF_SIZE,\
|
||||
.signalers = {\
|
||||
SIGNALERS,\
|
||||
{ NULL }\
|
||||
}\
|
||||
}
|
||||
|
||||
#define CFGLR_ELEMENT_U8(KEY, DEFAULT, SIGNALERS...) CFGLR_ELEMENT(KEY, CFGLR_DATATYPE_U8, sizeof(uint8_t), DEFAULT, 1, SIGNALERS)
|
||||
#define CFGLR_ELEMENT_I8(KEY, DEFAULT, SIGNALERS...) CFGLR_ELEMENT(KEY, CFGLR_DATATYPE_I8, sizeof(int8_t), DEFAULT, 1, SIGNALERS)
|
||||
#define CFGLR_ELEMENT_U16(KEY, DEFAULT, SIGNALERS...) CFGLR_ELEMENT(KEY, CFGLR_DATATYPE_U16, sizeof(uint16_t), DEFAULT, 2, SIGNALERS)
|
||||
|
|
@ -78,7 +91,7 @@ struct cfglr_element {
|
|||
#define CFGLR_ELEMENT_U64(KEY, DEFAULT, SIGNALERS...) CFGLR_ELEMENT(KEY, CFGLR_DATATYPE_U64, sizeof(uint64_t), DEFAULT, 8, SIGNALERS)
|
||||
#define CFGLR_ELEMENT_I64(KEY, DEFAULT, SIGNALERS...) CFGLR_ELEMENT(KEY, CFGLR_DATATYPE_I64, sizeof(int64_t), DEFAULT, 8, SIGNALERS)
|
||||
#define CFGLR_ELEMENT_BIN(KEY, SIZE, DEFAULT, DEF_SIZE, SIGNALERS...) CFGLR_ELEMENT(KEY, CFGLR_DATATYPE_BIN, SIZE, DEFAULT, DEF_SIZE, SIGNALERS)
|
||||
#define CFGLR_ELEMENT_STR(KEY, SIZE, DEFAULT, SIGNALERS...) CFGLR_ELEMENT(KEY, CFGLR_DATATYPE_STR, SIZE, DEFAULT, strlen(DEFAULT), SIGNALERS)
|
||||
#define CFGLR_ELEMENT_STR(KEY, POINTER, SIZE, DEFAULT, SIGNALERS...) CFGLR_ELEMENT_PTR(KEY, POINTER, CFGLR_DATATYPE_STR, SIZE, DEFAULT, strlen(DEFAULT), SIGNALERS)
|
||||
|
||||
typedef struct cfglr_backend cfglr_backend_t;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue