diff options
author | Jan Venekamp <jan@venekamp.net> | 2022-11-20 02:08:28 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2023-03-04 19:39:32 +0100 |
commit | 04d0c46cfe30f557da0c603516636830cab4a08a (patch) | |
tree | 9237cb13ff7d4aee6bdd46de0b39c27175cf2d5a | |
parent | ae61e1cad4a14e1cf4d0e5f4638354dafa77e5d3 (diff) | |
download | uci-04d0c46cfe30f557da0c603516636830cab4a08a.tar.gz |
The macro uci_alloc_element is in the public header file uci.h. However,
the macros output refers to uci_alloc_generic wich is in uci_internal.h
and not public. Thus, uci_alloc_element should be private as well and
moved to uci_internal.h.
Signed-off-by: Jan Venekamp <jan@venekamp.net>
-rw-r--r-- | uci.h | 10 | ||||
-rw-r--r-- | uci_internal.h | 3 |
2 files changed, 3 insertions, 10 deletions
@@ -613,16 +613,6 @@ BUILD_CAST(option) #define uci_to_option(ptr) container_of(ptr, struct uci_option, e) #endif -/** - * uci_alloc_element: allocate a generic uci_element, reserve a buffer and typecast - * @ctx: uci context - * @type: {package,section,option} - * @name: string containing the name of the element - * @datasize: additional buffer size to reserve at the end of the struct - */ -#define uci_alloc_element(ctx, type, name, datasize) \ - uci_to_ ## type (uci_alloc_generic(ctx, uci_type_ ## type, name, sizeof(struct uci_ ## type) + datasize)) - #define uci_dataptr(ptr) \ (((char *) ptr) + sizeof(*ptr)) diff --git a/uci_internal.h b/uci_internal.h index 34528f0..ff4ee8c 100644 --- a/uci_internal.h +++ b/uci_internal.h @@ -42,6 +42,9 @@ struct uci_parse_context #define pctx_char(pctx, i) ((pctx)->buf[(i)]) #define pctx_cur_char(pctx) pctx_char(pctx, pctx_pos(pctx)) +#define uci_alloc_element(ctx, type, name, datasize) \ + uci_to_ ## type (uci_alloc_generic(ctx, uci_type_ ## type, name, sizeof(struct uci_ ## type) + datasize)) + extern const char *uci_confdir; extern const char *uci_savedir; |