From 66a8221b3396bd6a200df3613d72d97af003ecce Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Sat, 4 Aug 2018 22:49:38 +0100 Subject: [PATCH] doxy: config functions --- config/address.c | 46 ++++++------------------------------------ config/bool.c | 41 +++++--------------------------------- config/long.c | 41 +++++--------------------------------- config/magic.c | 41 +++++--------------------------------- config/mbtable.c | 46 ++++++------------------------------------ config/number.c | 41 +++++--------------------------------- config/path.c | 46 ++++++------------------------------------ config/quad.c | 41 +++++--------------------------------- config/regex.c | 46 ++++++------------------------------------ config/set.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ config/sort.c | 41 +++++--------------------------------- config/string.c | 46 ++++++------------------------------------ 12 files changed, 112 insertions(+), 416 deletions(-) diff --git a/config/address.c b/config/address.c index 1bd0ce4bb..019218b0c 100644 --- a/config/address.c +++ b/config/address.c @@ -39,10 +39,7 @@ #include "types.h" /** - * address_destroy - Destroy an Address object - * @param cs Config items - * @param var Variable to destroy - * @param cdef Variable definition + * address_destroy - Destroy an Address object - Implements ::cst_destroy */ static void address_destroy(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef) { @@ -57,15 +54,7 @@ static void address_destroy(const struct ConfigSet *cs, void *var, const struct } /** - * address_string_set - Set an Address by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be set. + * address_string_set - Set an Address by string - Implements ::cst_string_set */ static int address_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) @@ -118,14 +107,7 @@ static int address_string_set(const struct ConfigSet *cs, void *var, struct Conf } /** - * address_string_get - Get an Address as a string - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param result Buffer for results or error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be returned. + * address_string_get - Get an Address as a string - Implements ::cst_string_get */ static int address_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result) @@ -174,13 +156,7 @@ static struct Address *address_dup(struct Address *addr) } /** - * address_native_set - Set an Address config item by Address object - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Address pointer - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * address_native_set - Set an Address config item by Address object - Implements ::cst_native_set */ static int address_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, @@ -212,12 +188,7 @@ static int address_native_set(const struct ConfigSet *cs, void *var, } /** - * address_native_get - Get an Address object from an Address config item - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval intptr_t Address pointer + * address_native_get - Get an Address object from an Address config item - Implements ::cst_native_get */ static intptr_t address_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) @@ -231,12 +202,7 @@ static intptr_t address_native_get(const struct ConfigSet *cs, void *var, } /** - * address_reset - Reset an Address to its initial value - * @param cs Config items - * @param var Variable to reset - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * address_reset - Reset an Address to its initial value - Implements ::cst_regex */ static int address_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) diff --git a/config/bool.c b/config/bool.c index 30fca1c24..fe0975da5 100644 --- a/config/bool.c +++ b/config/bool.c @@ -49,15 +49,7 @@ const char *bool_values[] = { }; /** - * bool_string_set - Set a Bool by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be set. + * bool_string_set - Set a Bool by string - Implements ::cst_string_set */ static int bool_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) @@ -105,14 +97,7 @@ static int bool_string_set(const struct ConfigSet *cs, void *var, struct ConfigD } /** - * bool_string_get - Get a Bool as a string - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param result Buffer for results or error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be returned. + * bool_string_get - Get a Bool as a string - Implements ::cst_string_get */ static int bool_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result) @@ -138,13 +123,7 @@ static int bool_string_get(const struct ConfigSet *cs, void *var, } /** - * bool_native_set - Set a Bool config item by bool - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Bool value - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * bool_native_set - Set a Bool config item by bool - Implements ::cst_native_set */ static int bool_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err) @@ -174,12 +153,7 @@ static int bool_native_set(const struct ConfigSet *cs, void *var, } /** - * bool_native_get - Get a bool from a Bool config item - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval intptr_t Bool + * bool_native_get - Get a bool from a Bool config item - Implements ::cst_native_get */ static intptr_t bool_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) @@ -191,12 +165,7 @@ static intptr_t bool_native_get(const struct ConfigSet *cs, void *var, } /** - * bool_reset - Reset a Bool to its initial value - * @param cs Config items - * @param var Variable to reset - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * bool_reset - Reset a Bool to its initial value - Implements ::cst_regex */ static int bool_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) diff --git a/config/long.c b/config/long.c index 9bbd84f22..27f713afb 100644 --- a/config/long.c +++ b/config/long.c @@ -36,15 +36,7 @@ #include "types.h" /** - * long_string_set - Set a Long by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be set. + * long_string_set - Set a Long by string - Implements ::cst_string_set */ static int long_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) @@ -89,14 +81,7 @@ static int long_string_set(const struct ConfigSet *cs, void *var, struct ConfigD } /** - * long_string_get - Get a Long as a string - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param result Buffer for results or error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be returned. + * long_string_get - Get a Long as a string - Implements ::cst_string_get */ static int long_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result) @@ -116,13 +101,7 @@ static int long_string_get(const struct ConfigSet *cs, void *var, } /** - * long_native_set - Set a Long config item by int - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Long - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * long_native_set - Set a Long config item by int - Implements ::cst_native_set */ static int long_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err) @@ -152,12 +131,7 @@ static int long_native_set(const struct ConfigSet *cs, void *var, } /** - * long_native_get - Get an int from a Long config item - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval intptr_t Long + * long_native_get - Get an int from a Long config item - Implements ::cst_native_get */ static intptr_t long_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) @@ -169,12 +143,7 @@ static intptr_t long_native_get(const struct ConfigSet *cs, void *var, } /** - * long_reset - Reset a Long to its initial value - * @param cs Config items - * @param var Variable to reset - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * long_reset - Reset a Long to its initial value - Implements ::cst_regex */ static int long_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) diff --git a/config/magic.c b/config/magic.c index dae2b83cf..2e1651bfc 100644 --- a/config/magic.c +++ b/config/magic.c @@ -45,15 +45,7 @@ const char *magic_values[] = { }; /** - * magic_string_set - Set a Mailbox Magic by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be set. + * magic_string_set - Set a Mailbox Magic by string - Implements ::cst_string_set */ static int magic_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) @@ -107,14 +99,7 @@ static int magic_string_set(const struct ConfigSet *cs, void *var, struct Config } /** - * magic_string_get - Get a Mailbox Magic as a string - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param result Buffer for results or error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be returned. + * magic_string_get - Get a Mailbox Magic as a string - Implements ::cst_string_get */ static int magic_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result) @@ -140,13 +125,7 @@ static int magic_string_get(const struct ConfigSet *cs, void *var, } /** - * magic_native_set - Set a Mailbox Magic config item by int - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Mailbox magic - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * magic_native_set - Set a Mailbox Magic config item by int - Implements ::cst_native_set */ static int magic_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err) @@ -176,12 +155,7 @@ static int magic_native_set(const struct ConfigSet *cs, void *var, } /** - * magic_native_get - Get an int from a Mailbox Magic config item - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval intptr_t Mailbox magic + * magic_native_get - Get an int from a Mailbox Magic config item - Implements ::cst_native_get */ static intptr_t magic_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) @@ -193,12 +167,7 @@ static intptr_t magic_native_get(const struct ConfigSet *cs, void *var, } /** - * magic_reset - Reset a Mailbox Magic to its initial value - * @param cs Config items - * @param var Variable to reset - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * magic_reset - Reset a Mailbox Magic to its initial value - Implements ::cst_regex */ static int magic_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) diff --git a/config/mbtable.c b/config/mbtable.c index 2f7073829..b48dba9b4 100644 --- a/config/mbtable.c +++ b/config/mbtable.c @@ -87,10 +87,7 @@ struct MbTable *mbtable_parse(const char *s) } /** - * mbtable_destroy - Destroy an MbTable object - * @param cs Config items - * @param var Variable to destroy - * @param cdef Variable definition + * mbtable_destroy - Destroy an MbTable object - Implements ::cst_destroy */ static void mbtable_destroy(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef) { @@ -105,15 +102,7 @@ static void mbtable_destroy(const struct ConfigSet *cs, void *var, const struct } /** - * mbtable_string_set - Set a MbTable by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be set. + * mbtable_string_set - Set a MbTable by string - Implements ::cst_string_set */ static int mbtable_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) @@ -167,14 +156,7 @@ static int mbtable_string_set(const struct ConfigSet *cs, void *var, struct Conf } /** - * mbtable_string_get - Get a MbTable as a string - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param result Buffer for results or error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be returned. + * mbtable_string_get - Get a MbTable as a string - Implements ::cst_string_get */ static int mbtable_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result) @@ -216,13 +198,7 @@ static struct MbTable *mbtable_dup(struct MbTable *table) } /** - * mbtable_native_set - Set a MbTable config item by MbTable object - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value MbTable pointer - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * mbtable_native_set - Set a MbTable config item by MbTable object - Implements ::cst_native_set */ static int mbtable_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, @@ -254,12 +230,7 @@ static int mbtable_native_set(const struct ConfigSet *cs, void *var, } /** - * mbtable_native_get - Get an MbTable object from a MbTable config item - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval intptr_t MbTable pointer + * mbtable_native_get - Get an MbTable object from a MbTable config item - Implements ::cst_native_get */ static intptr_t mbtable_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) @@ -273,12 +244,7 @@ static intptr_t mbtable_native_get(const struct ConfigSet *cs, void *var, } /** - * mbtable_reset - Reset an MbTable to its initial value - * @param cs Config items - * @param var Variable to reset - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * mbtable_reset - Reset an MbTable to its initial value - Implements ::cst_regex */ static int mbtable_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) diff --git a/config/number.c b/config/number.c index a6ef7a0fe..81a598cce 100644 --- a/config/number.c +++ b/config/number.c @@ -36,15 +36,7 @@ #include "types.h" /** - * number_string_set - Set a Number by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be set. + * number_string_set - Set a Number by string - Implements ::cst_string_set */ static int number_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) @@ -101,14 +93,7 @@ static int number_string_set(const struct ConfigSet *cs, void *var, struct Confi } /** - * number_string_get - Get a Number as a string - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param result Buffer for results or error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be returned. + * number_string_get - Get a Number as a string - Implements ::cst_string_get */ static int number_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result) @@ -128,13 +113,7 @@ static int number_string_get(const struct ConfigSet *cs, void *var, } /** - * number_native_set - Set a Number config item by int - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Number - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * number_native_set - Set a Number config item by int - Implements ::cst_native_set */ static int number_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, @@ -171,12 +150,7 @@ static int number_native_set(const struct ConfigSet *cs, void *var, } /** - * number_native_get - Get an int from a Number config item - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval intptr_t Number + * number_native_get - Get an int from a Number config item - Implements ::cst_native_get */ static intptr_t number_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) @@ -188,12 +162,7 @@ static intptr_t number_native_get(const struct ConfigSet *cs, void *var, } /** - * number_reset - Reset a Number to its initial value - * @param cs Config items - * @param var Variable to reset - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * number_reset - Reset a Number to its initial value - Implements ::cst_regex */ static int number_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) diff --git a/config/path.c b/config/path.c index 158e89737..10976b178 100644 --- a/config/path.c +++ b/config/path.c @@ -37,10 +37,7 @@ #include "types.h" /** - * path_destroy - Destroy a Path - * @param cs Config items - * @param var Variable to destroy - * @param cdef Variable definition + * path_destroy - Destroy a Path - Implements ::cst_destroy */ static void path_destroy(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef) { @@ -62,15 +59,7 @@ static void path_destroy(const struct ConfigSet *cs, void *var, const struct Con } /** - * path_string_set - Set a Path by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be set. + * path_string_set - Set a Path by string - Implements ::cst_string_set */ static int path_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) @@ -128,14 +117,7 @@ static int path_string_set(const struct ConfigSet *cs, void *var, struct ConfigD } /** - * path_string_get - Get a Path as a string - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param result Buffer for results or error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be returned. + * path_string_get - Get a Path as a string - Implements ::cst_string_get */ static int path_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result) @@ -158,13 +140,7 @@ static int path_string_get(const struct ConfigSet *cs, void *var, } /** - * path_native_set - Set a Path config item by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Native pointer/value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * path_native_set - Set a Path config item by string - Implements ::cst_native_set */ static int path_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err) @@ -209,12 +185,7 @@ static int path_native_set(const struct ConfigSet *cs, void *var, } /** - * path_native_get - Get a string from a Path config item - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval intptr_t Path string + * path_native_get - Get a string from a Path config item - Implements ::cst_native_get */ static intptr_t path_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) @@ -228,12 +199,7 @@ static intptr_t path_native_get(const struct ConfigSet *cs, void *var, } /** - * path_reset - Reset a Path to its initial value - * @param cs Config items - * @param var Variable to reset - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * path_reset - Reset a Path to its initial value - Implements ::cst_regex */ static int path_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) diff --git a/config/quad.c b/config/quad.c index fbdc307a5..5bbf8c515 100644 --- a/config/quad.c +++ b/config/quad.c @@ -48,15 +48,7 @@ const char *quad_values[] = { }; /** - * quad_string_set - Set a Quad-option by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be set. + * quad_string_set - Set a Quad-option by string - Implements ::cst_string_set */ static int quad_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) @@ -104,14 +96,7 @@ static int quad_string_set(const struct ConfigSet *cs, void *var, struct ConfigD } /** - * quad_string_get - Get a Quad-option as a string - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param result Buffer for results or error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be returned. + * quad_string_get - Get a Quad-option as a string - Implements ::cst_string_get */ static int quad_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result) @@ -137,13 +122,7 @@ static int quad_string_get(const struct ConfigSet *cs, void *var, } /** - * quad_native_set - Set a Quad-option config item by int - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Quad-option value - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * quad_native_set - Set a Quad-option config item by int - Implements ::cst_native_set */ static int quad_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err) @@ -173,12 +152,7 @@ static int quad_native_set(const struct ConfigSet *cs, void *var, } /** - * quad_native_get - Get an int object from a Quad-option config item - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval intptr_t Quad-option value + * quad_native_get - Get an int object from a Quad-option config item - Implements ::cst_native_get */ static intptr_t quad_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) @@ -190,12 +164,7 @@ static intptr_t quad_native_get(const struct ConfigSet *cs, void *var, } /** - * quad_reset - Reset a Quad-option to its initial value - * @param cs Config items - * @param var Variable to reset - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * quad_reset - Reset a Quad-option to its initial value - Implements ::cst_regex */ static int quad_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) diff --git a/config/regex.c b/config/regex.c index 36c2094eb..3f761b321 100644 --- a/config/regex.c +++ b/config/regex.c @@ -42,10 +42,7 @@ #include "types.h" /** - * regex_destroy - Destroy a Regex object - * @param cs Config items - * @param var Variable to destroy - * @param cdef Variable definition + * regex_destroy - Destroy a Regex object - Implements ::cst_destroy */ static void regex_destroy(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef) { @@ -60,15 +57,7 @@ static void regex_destroy(const struct ConfigSet *cs, void *var, const struct Co } /** - * regex_string_set - Set a Regex by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be set. + * regex_string_set - Set a Regex by string - Implements ::cst_string_set */ static int regex_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) @@ -128,14 +117,7 @@ static int regex_string_set(const struct ConfigSet *cs, void *var, struct Config } /** - * regex_string_get - Get a Regex as a string - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param result Buffer for results or error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be returned. + * regex_string_get - Get a Regex as a string - Implements ::cst_string_get */ static int regex_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result) @@ -164,13 +146,7 @@ static int regex_string_get(const struct ConfigSet *cs, void *var, } /** - * regex_native_set - Set a Regex config item by Regex object - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Regex pointer - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * regex_native_set - Set a Regex config item by Regex object - Implements ::cst_native_set */ static int regex_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err) @@ -214,12 +190,7 @@ static int regex_native_set(const struct ConfigSet *cs, void *var, } /** - * regex_native_get - Get a Regex object from a Regex config item - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval intptr_t Regex pointer + * regex_native_get - Get a Regex object from a Regex config item - Implements ::cst_native_get */ static intptr_t regex_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) @@ -233,12 +204,7 @@ static intptr_t regex_native_get(const struct ConfigSet *cs, void *var, } /** - * regex_reset - Reset a Regex to its initial value - * @param cs Config items - * @param var Variable to reset - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * regex_reset - Reset a Regex to its initial value - Implements ::cst_regex */ static int regex_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) diff --git a/config/set.h b/config/set.h index 5b48195ba..039d7f8c0 100644 --- a/config/set.h +++ b/config/set.h @@ -89,12 +89,64 @@ typedef bool (*cs_listener) (const struct ConfigSet *cs, struct HashElem *h */ typedef int (*cs_validator) (const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err); +/** + * cst_string_set - Set a config item by string + * @param cs Config items + * @param var Variable to set + * @param cdef Variable definition + * @param value Value to set + * @param err Buffer for error messages + * @retval int Result, e.g. #CSR_SUCCESS + * + * If var is NULL, then the config item's initial value will be set. + */ typedef int (*cst_string_set)(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err); +/** + * cst_string_get - Get a config item as a string + * @param cs Config items + * @param var Variable to get + * @param cdef Variable definition + * @param result Buffer for results or error messages + * @retval int Result, e.g. #CSR_SUCCESS + * + * If var is NULL, then the config item's initial value will be returned. + */ typedef int (*cst_string_get)(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result); +/** + * cst_native_set - Set a config item by string + * @param cs Config items + * @param var Variable to set + * @param cdef Variable definition + * @param value Native pointer/value to set + * @param err Buffer for error messages + * @retval int Result, e.g. #CSR_SUCCESS + */ typedef int (*cst_native_set)(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err); +/** + * cst_native_get - Get a string from a config item + * @param cs Config items + * @param var Variable to get + * @param cdef Variable definition + * @param err Buffer for error messages + * @retval intptr_t Config item string + */ typedef intptr_t(*cst_native_get)(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err); +/** + * cst_reset - Reset a config item to its initial value + * @param cs Config items + * @param var Variable to reset + * @param cdef Variable definition + * @param err Buffer for error messages + * @retval int Result, e.g. #CSR_SUCCESS + */ typedef int (*cst_reset) (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err); +/** + * cst_destroy - Destroy a config item + * @param cs Config items + * @param var Variable to destroy + * @param cdef Variable definition + */ typedef void (*cst_destroy) (const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef); #define IP (intptr_t) diff --git a/config/sort.c b/config/sort.c index fb36d2c16..ced454d10 100644 --- a/config/sort.c +++ b/config/sort.c @@ -132,15 +132,7 @@ const struct Mapping SortSidebarMethods[] = { // clang-format on /** - * sort_string_set - Set a Sort by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be set. + * sort_string_set - Set a Sort by string - Implements ::cst_string_set */ static int sort_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) @@ -227,14 +219,7 @@ static int sort_string_set(const struct ConfigSet *cs, void *var, struct ConfigD } /** - * sort_string_get - Get a Sort as a string - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param result Buffer for results or error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be returned. + * sort_string_get - Get a Sort as a string - Implements ::cst_string_get */ static int sort_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result) @@ -296,13 +281,7 @@ static int sort_string_get(const struct ConfigSet *cs, void *var, } /** - * sort_native_set - Set a Sort config item by int - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Sort value - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * sort_native_set - Set a Sort config item by int - Implements ::cst_native_set */ static int sort_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err) @@ -360,12 +339,7 @@ static int sort_native_set(const struct ConfigSet *cs, void *var, } /** - * sort_native_get - Get an int from a Sort config item - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval intptr_t Sort ID + * sort_native_get - Get an int from a Sort config item - Implements ::cst_native_get */ static intptr_t sort_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) @@ -377,12 +351,7 @@ static intptr_t sort_native_get(const struct ConfigSet *cs, void *var, } /** - * sort_reset - Reset a Sort to its initial value - * @param cs Config items - * @param var Variable to reset - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * sort_reset - Reset a Sort to its initial value - Implements ::cst_regex */ static int sort_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) diff --git a/config/string.c b/config/string.c index 5ffe910d4..4a44d7ced 100644 --- a/config/string.c +++ b/config/string.c @@ -37,10 +37,7 @@ #include "types.h" /** - * string_destroy - Destroy a String - * @param cs Config items - * @param var Variable to destroy - * @param cdef Variable definition + * string_destroy - Destroy a String - Implements ::cst_destroy */ static void string_destroy(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef) { @@ -62,15 +59,7 @@ static void string_destroy(const struct ConfigSet *cs, void *var, const struct C } /** - * string_string_set - Set a String by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be set. + * string_string_set - Set a String by string - Implements ::cst_string_set */ static int string_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err) @@ -128,14 +117,7 @@ static int string_string_set(const struct ConfigSet *cs, void *var, struct Confi } /** - * string_string_get - Get a String as a string - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param result Buffer for results or error messages - * @retval int Result, e.g. #CSR_SUCCESS - * - * If var is NULL, then the config item's initial value will be returned. + * string_string_get - Get a String as a string - Implements ::cst_string_get */ static int string_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result) @@ -158,13 +140,7 @@ static int string_string_get(const struct ConfigSet *cs, void *var, } /** - * string_native_set - Set a String config item by string - * @param cs Config items - * @param var Variable to set - * @param cdef Variable definition - * @param value Native pointer/value to set - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * string_native_set - Set a String config item by string - Implements ::cst_native_set */ static int string_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, @@ -210,12 +186,7 @@ static int string_native_set(const struct ConfigSet *cs, void *var, } /** - * string_native_get - Get a string from a String config item - * @param cs Config items - * @param var Variable to get - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval intptr_t String pointer + * string_native_get - Get a string from a String config item - Implements ::cst_native_get */ static intptr_t string_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) @@ -229,12 +200,7 @@ static intptr_t string_native_get(const struct ConfigSet *cs, void *var, } /** - * string_reset - Reset a String to its initial value - * @param cs Config items - * @param var Variable to reset - * @param cdef Variable definition - * @param err Buffer for error messages - * @retval int Result, e.g. #CSR_SUCCESS + * string_reset - Reset a String to its initial value - Implements ::cst_regex */ static int string_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err) -- 2.40.0