remove internal usage of redundant uci_ptr.last
[project/uci.git] / uci_internal.h
index 3a94dbbcc424fcd20813dc4cfa2279617b6b29e8..ff4ee8cbb18c9a3e1813230dab99187fc3698124 100644 (file)
@@ -33,6 +33,7 @@ struct uci_parse_context
        const char *name;
        char *buf;
        size_t bufsz;
+       size_t buf_filled;
        size_t pos;
 };
 #define pctx_pos(pctx)         ((pctx)->pos)
@@ -41,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;