diff --git a/CHANGELOG.md b/CHANGELOG.md index c653a47b..a140bbe2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +41,7 @@ Users may have to change how they access the system Developers may need to change their code * New `yn_iter()` yang iterator replaces `yn_each()` - * Use an integer iteratorinstead of yang object + * Use an integer iterator instead of yang object * Replace `y1 = NULL; y1 = yn_each(y0, y1)` with `int inext = 0; yn_iter(y0, &inext)` * Add `keyw` argument to `yang_stats()` diff --git a/Makefile.in b/Makefile.in index f1a379d6..a850070e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -166,6 +166,6 @@ loc: find . -name '*.[chyl]' -type f | xargs wc -l | tail -1 2> /dev/null TAGS: - find $(srcdir) -not \( -type d \( -path './.git' -o -path './docker' -o -path './doc' \) -prune \) -name '*.[chyl]' -type f | grep -v \.tab\.[ch] | grep -v lex.*.c | grep -v .yy.c | etags - + find $(srcdir) -not \( -type d \( -path './.git' -o -path './docker' -o -path './doc' \) -prune \) -name '*.[chyl]' -type f | grep -v \.tab\.[ch] | grep -v lex.*.c | grep -v .yy.c | xargs etags diff --git a/lib/clixon/clixon.h.in b/lib/clixon/clixon.h.in index ae522cd1..c0a5e312 100644 --- a/lib/clixon/clixon.h.in +++ b/lib/clixon/clixon.h.in @@ -80,6 +80,7 @@ extern "C" { #include #include #include +#include #include #include #include diff --git a/lib/clixon/clixon_hash.h b/lib/clixon/clixon_hash.h index c1a73d34..70d0452e 100644 --- a/lib/clixon/clixon_hash.h +++ b/lib/clixon/clixon_hash.h @@ -40,7 +40,7 @@ struct clicon_hash { qelem_t h_qelem; - char *h_key; + char *h_key; /* Key must be NULL-terinated string */ size_t h_vlen; void *h_val; }; diff --git a/lib/clixon/clixon_map.h b/lib/clixon/clixon_map.h new file mode 100644 index 00000000..66d9a666 --- /dev/null +++ b/lib/clixon/clixon_map.h @@ -0,0 +1,88 @@ +/* + * + ***** BEGIN LICENSE BLOCK ***** + + Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren + Copyright (C) 2017-2019 Olof Hagsand + Copyright (C) 2020-2022 Olof Hagsand and Rubicon Communications, LLC(Netgate) + + This file is part of CLIXON. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Alternatively, the contents of this file may be used under the terms of + the GNU General Public License Version 3 or later (the "GPL"), + in which case the provisions of the GPL are applicable instead + of those above. If you wish to allow use of your version of this file only + under the terms of the GPL, and not to allow others to + use your version of this file under the terms of Apache License version 2, + indicate your decision by deleting the provisions above and replace them with + the notice and other provisions required by the GPL. If you do not delete + the provisions above, a recipient may use your version of this file under + the terms of any one of the Apache License version 2 or the GPL. + + ***** END LICENSE BLOCK ***** + + Map between strings and ints + */ + +#ifndef _CLIXON_MAP_H_ +#define _CLIXON_MAP_H_ + +/*! Struct used to map between int and strings. Typically used to map between + * + * values and their names. Note NULL terminated + * Example: + * @code +static const map_str2int atmap[] = { + {"One", 1}, + {"Two", 2}, + {NULL, -1} +}; + * @endcode + * @see clicon_int2str + * @see clicon_str2int + */ +struct map_str2int{ + char *ms_str; + int ms_int; +}; +typedef struct map_str2int map_str2int; + +/*! Struct used to map between two strings. + */ +struct map_str2str{ + char *ms_s0; + char *ms_s1; +}; +typedef struct map_str2str map_str2str; + +/*! Map from ptr to ptr + */ +struct map_ptr2ptr{ + void *mp_p0; + void *mp_p1; +}; +typedef struct map_ptr2ptr map_ptr2ptr; + +/* + * Prototypes + */ +const char *clicon_int2str(const map_str2int *mstab, int i); +int clicon_str2int(const map_str2int *mstab, char *str); +int clicon_str2int_search(const map_str2int *mstab, char *str, int upper); +char *clicon_str2str(const map_str2str *mstab, char *str); +void *clixon_ptr2ptr(map_ptr2ptr *mptab, void *ptr); +int clixon_ptr2ptr_add(map_ptr2ptr **mptab, void *ptr0, void *ptr1); + +#endif /* _CLIXON_MAP_H_ */ diff --git a/lib/clixon/clixon_string.h b/lib/clixon/clixon_string.h index 5e04d013..7999e431 100644 --- a/lib/clixon/clixon_string.h +++ b/lib/clixon/clixon_string.h @@ -38,34 +38,6 @@ #ifndef _CLIXON_STRING_H_ #define _CLIXON_STRING_H_ -/*! Struct used to map between int and strings. Typically used to map between - * - * values and their names. Note NULL terminated - * Example: - * @code -static const map_str2int atmap[] = { - {"One", 1}, - {"Two", 2}, - {NULL, -1} -}; - * @endcode - * @see clicon_int2str - * @see clicon_str2int - */ -struct map_str2int{ - char *ms_str; - int ms_int; -}; -typedef struct map_str2int map_str2int; - -/*! Struct used to map between two strings. - */ -struct map_str2str{ - char *ms_s0; - char *ms_s1; -}; -typedef struct map_str2str map_str2str; - /*! A malloc version that aligns on 4 bytes. To avoid warning from valgrind */ #define align4(s) (((s)/4)*4 + 4) @@ -99,11 +71,6 @@ int xml_chardata_encode(char **escp, int quote, const char *fmt, ... ) __attr int xml_chardata_cbuf_append(cbuf *cb, int quote, char *str); int xml_chardata_decode(char **escp, const char *fmt,...); int uri_percent_decode(char *enc, char **str); - -const char *clicon_int2str(const map_str2int *mstab, int i); -int clicon_str2int(const map_str2int *mstab, char *str); -int clicon_str2int_search(const map_str2int *mstab, char *str, int upper); -char *clicon_str2str(const map_str2str *mstab, char *str); int nodeid_split(char *nodeid, char **prefix, char **id); char *clixon_trim(char *str); char *clixon_trim2(char *str, char *trims); diff --git a/lib/src/Makefile.in b/lib/src/Makefile.in index a68b1de9..1fb8fb35 100644 --- a/lib/src/Makefile.in +++ b/lib/src/Makefile.in @@ -79,7 +79,7 @@ CPPFLAGS = @CPPFLAGS@ INCLUDES = -I. @INCLUDES@ -I$(top_srcdir)/lib/clixon -I$(top_srcdir)/include -I$(top_srcdir) SRC = clixon_sig.c clixon_uid.c clixon_log.c clixon_debug.c clixon_err.c clixon_event.c \ - clixon_string.c clixon_regex.c clixon_handle.c clixon_file.c \ + clixon_string.c clixon_map.c clixon_regex.c clixon_handle.c clixon_file.c \ clixon_xml.c clixon_xml_io.c clixon_xml_sort.c clixon_xml_map.c clixon_xml_vec.c \ clixon_xml_default.c clixon_xml_bind.c clixon_json.c clixon_proc.c \ clixon_yang.c clixon_yang_type.c clixon_yang_module.c clixon_netconf_monitoring.c \ diff --git a/lib/src/clixon_client.c b/lib/src/clixon_client.c index 61941cec..89cdf73c 100644 --- a/lib/src/clixon_client.c +++ b/lib/src/clixon_client.c @@ -51,6 +51,7 @@ #include "clixon_queue.h" #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_hash.h" #include "clixon_handle.h" #include "clixon_yang.h" diff --git a/lib/src/clixon_data.c b/lib/src/clixon_data.c index ecdc6162..a3aad207 100644 --- a/lib/src/clixon_data.c +++ b/lib/src/clixon_data.c @@ -60,7 +60,7 @@ #include /* clixon */ -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_datastore_read.c b/lib/src/clixon_datastore_read.c index 5a8cea0f..5e421949 100644 --- a/lib/src/clixon_datastore_read.c +++ b/lib/src/clixon_datastore_read.c @@ -55,7 +55,7 @@ #include /* clixon */ -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_datastore_write.c b/lib/src/clixon_datastore_write.c index 0f3543bc..78781db0 100644 --- a/lib/src/clixon_datastore_write.c +++ b/lib/src/clixon_datastore_write.c @@ -57,6 +57,7 @@ /* clixon */ #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_digest.h" diff --git a/lib/src/clixon_debug.c b/lib/src/clixon_debug.c index f36abc74..fb1a69f4 100644 --- a/lib/src/clixon_debug.c +++ b/lib/src/clixon_debug.c @@ -60,7 +60,7 @@ /* clixon */ #include "clixon_queue.h" #include "clixon_hash.h" -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_handle.h" #include "clixon_yang.h" #include "clixon_xml.h" diff --git a/lib/src/clixon_hash.c b/lib/src/clixon_hash.c index fdf938bb..2eb88fbf 100644 --- a/lib/src/clixon_hash.c +++ b/lib/src/clixon_hash.c @@ -120,7 +120,7 @@ hash_bucket(const char *str) * * @retval hash Pointer to new hash table. * @retval NULL Error - * @see hash_free For freeing the hash-table + * @see clicon_hash_free For freeing the hash-table */ clicon_hash_t * clicon_hash_init(void) diff --git a/lib/src/clixon_log.c b/lib/src/clixon_log.c index 6b1c5f12..98956f11 100644 --- a/lib/src/clixon_log.c +++ b/lib/src/clixon_log.c @@ -60,7 +60,7 @@ /* clixon */ #include "clixon_queue.h" #include "clixon_hash.h" -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_handle.h" #include "clixon_yang.h" #include "clixon_xml.h" diff --git a/lib/src/clixon_map.c b/lib/src/clixon_map.c new file mode 100644 index 00000000..93824638 --- /dev/null +++ b/lib/src/clixon_map.c @@ -0,0 +1,235 @@ +/* + * + ***** BEGIN LICENSE BLOCK ***** + + Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren + Copyright (C) 2017-2019 Olof Hagsand + Copyright (C) 2020-2022 Olof Hagsand and Rubicon Communications, LLC(Netgate) + + This file is part of CLIXON. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Alternatively, the contents of this file may be used under the terms of + the GNU General Public License Version 3 or later (the "GPL"), + in which case the provisions of the GPL are applicable instead + of those above. If you wish to allow use of your version of this file only + under the terms of the GPL, and not to allow others to + use your version of this file under the terms of Apache License version 2, + indicate your decision by deleting the provisions above and replace them with + the notice and other provisions required by the GPL. If you do not delete + the provisions above, a recipient may use your version of this file under + the terms of any one of the Apache License version 2 or the GPL. + + ***** END LICENSE BLOCK ***** + */ + +#ifdef HAVE_CONFIG_H +#include "clixon_config.h" +#endif + +#include +#include +#include +#include +#include +#include + +#include + +/* clixon */ +#include "clixon_queue.h" +#include "clixon_hash.h" +#include "clixon_handle.h" +#include "clixon_map.h" +#include "clixon_yang.h" +#include "clixon_xml.h" +#include "clixon_err.h" + +/*! Map from int to string using str2int map + * + * @param[in] ms String, integer map + * @param[in] i Input integer + * @retval str String value + * @retval NULL Error, not found + * @note linear search + */ +const char * +clicon_int2str(const map_str2int *mstab, + int i) +{ + const struct map_str2int *ms; + + for (ms = &mstab[0]; ms->ms_str; ms++) + if (ms->ms_int == i) + return ms->ms_str; + return NULL; +} + +/*! Map from string to int using str2int map + * + * @param[in] ms String, integer map + * @param[in] str Input string + * @retval int Value + * @retval -1 Error, not found + * @see clicon_str2int_search for optimized lookup, but strings must be sorted + */ +int +clicon_str2int(const map_str2int *mstab, + char *str) +{ + const struct map_str2int *ms; + + for (ms = &mstab[0]; ms->ms_str; ms++) + if (strcmp(ms->ms_str, str) == 0) + return ms->ms_int; + return -1; +} + +/*! Map from string to int using binary (alphatical) search + * + * @param[in] ms String, integer map + * @param[in] str Input string + * @param[in] low Lower bound index + * @param[in] upper Upper bound index + * @param[in] len Length of array (max) + * @param[out] found Integer found (can also be negative) + * @retval 1 Found with "found" value set. + * @retval 0 Not found + * @note Assumes sorted strings, tree search + */ +static int +str2int_search1(const map_str2int *mstab, + char *str, + int low, + int upper, + int len, + int *found) +{ + const struct map_str2int *ms; + int mid; + int cmp; + + if (upper < low) + return 0; /* not found */ + mid = (low + upper) / 2; + if (mid >= len) /* beyond range */ + return 0; /* not found */ + ms = &mstab[mid]; + if ((cmp = strcmp(str, ms->ms_str)) == 0){ + *found = ms->ms_int; + return 1; /* found */ + } + else if (cmp < 0) + return str2int_search1(mstab, str, low, mid-1, len, found); + else + return str2int_search1(mstab, str, mid+1, upper, len, found); +} + +/*! Map from string to int using str2int map + * + * @param[in] ms String, integer map + * @param[in] str Input string + * @retval int Value + * @retval -1 Error, not found + * @note Assumes sorted strings, tree search + * @note -1 can not be value + */ +int +clicon_str2int_search(const map_str2int *mstab, + char *str, + int len) +{ + int found; + + if (str2int_search1(mstab, str, 0, len, len, &found)) + return found; + return -1; /* not found */ +} + +/*! Map from string to string using str2str map + * + * @param[in] mstab String, string map + * @param[in] str Input string + * @retval str Output string + * @retval NULL Error, not found + */ +char* +clicon_str2str(const map_str2str *mstab, + char *str) +{ + const struct map_str2str *ms; + + for (ms = &mstab[0]; ms->ms_s0; ms++) + if (strcmp(ms->ms_s0, str) == 0) + return ms->ms_s1; + return NULL; +} + +/*! Map from pointer to pointer using mptab map + * + * @param[in] mptab Ptr to ptr map + * @param[in] ptr Input pointer + * @retval ptr Output pointer + * @retval NULL Error, not found + */ +void* +clixon_ptr2ptr(map_ptr2ptr *mptab, + void *ptr) +{ + struct map_ptr2ptr *mp; + + for (mp = &mptab[0]; mp->mp_p0; mp++) + if (mp->mp_p0 == ptr) + return mp->mp_p1; + return 0; +} + +/*! Add pointer pairto mptab map + * + * @param[in] mptab Ptr to ptr map + * @param[in] ptr0 Input pointer + * @param[in] ptr1 Output pointer + * @retval 0 OK + * @retval -1 Error + */ +int +clixon_ptr2ptr_add(map_ptr2ptr **mptabp, + void *ptr0, + void *ptr1) +{ + int retval = -1; + struct map_ptr2ptr *mp; + struct map_ptr2ptr *mptab0; + struct map_ptr2ptr *mptab1; + int i; + + if (mptabp == NULL) { + clixon_err(OE_YANG, EINVAL, "mptabp is NULL"); + goto done; + } + mptab0 = *mptabp; + for (i=0, mp = &mptab0[0]; mp->mp_p0; mp++, i++); + if ((mptab1 = realloc(mptab0, (i+2)*sizeof(*mp))) == NULL){ + clixon_err(OE_UNIX, errno, "realloc"); + goto done; + } + mptab1[i].mp_p0 = ptr0; + mptab1[i++].mp_p1 = ptr1; + mptab1[i].mp_p0 = NULL; + mptab1[i].mp_p1 = NULL; + *mptabp = mptab1; + retval = 0; + done: + return retval; +} diff --git a/lib/src/clixon_nacm.c b/lib/src/clixon_nacm.c index 1dbddccf..ac2ce20d 100644 --- a/lib/src/clixon_nacm.c +++ b/lib/src/clixon_nacm.c @@ -57,6 +57,7 @@ #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_handle.h" #include "clixon_yang.h" #include "clixon_xml.h" diff --git a/lib/src/clixon_netconf_lib.c b/lib/src/clixon_netconf_lib.c index e089b4a1..9d25f9d8 100644 --- a/lib/src/clixon_netconf_lib.c +++ b/lib/src/clixon_netconf_lib.c @@ -59,6 +59,7 @@ #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_handle.h" #include "clixon_yang.h" #include "clixon_xml.h" diff --git a/lib/src/clixon_options.c b/lib/src/clixon_options.c index e48512bd..6791bb8f 100644 --- a/lib/src/clixon_options.c +++ b/lib/src/clixon_options.c @@ -71,7 +71,7 @@ #include "clixon_err.h" #include "clixon_log.h" #include "clixon_debug.h" -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_file.h" #include "clixon_json.h" #include "clixon_text_syntax.h" diff --git a/lib/src/clixon_path.c b/lib/src/clixon_path.c index 11799bb4..48404a0d 100644 --- a/lib/src/clixon_path.c +++ b/lib/src/clixon_path.c @@ -83,7 +83,7 @@ #include /* clixon */ -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_plugin.c b/lib/src/clixon_plugin.c index 1d633fe2..9dfb2047 100644 --- a/lib/src/clixon_plugin.c +++ b/lib/src/clixon_plugin.c @@ -56,7 +56,7 @@ /* clixon */ #include "clixon_queue.h" -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_hash.h" #include "clixon_handle.h" #include "clixon_yang.h" diff --git a/lib/src/clixon_proc.c b/lib/src/clixon_proc.c index 1665b250..4bb4b31b 100644 --- a/lib/src/clixon_proc.c +++ b/lib/src/clixon_proc.c @@ -124,6 +124,7 @@ #include "clixon_uid.h" #include "clixon_event.h" #include "clixon_sig.h" +#include "clixon_map.h" #include "clixon_string.h" #include "clixon_queue.h" #include "clixon_netconf_lib.h" diff --git a/lib/src/clixon_proto_client.c b/lib/src/clixon_proto_client.c index b5d69edd..91d53b01 100644 --- a/lib/src/clixon_proto_client.c +++ b/lib/src/clixon_proto_client.c @@ -71,6 +71,7 @@ #include "clixon_yang_module.h" #include "clixon_plugin.h" #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_xpath_ctx.h" #include "clixon_xpath.h" #include "clixon_proto.h" diff --git a/lib/src/clixon_stream.c b/lib/src/clixon_stream.c index 01b48d3d..79142d06 100644 --- a/lib/src/clixon_stream.c +++ b/lib/src/clixon_stream.c @@ -71,7 +71,7 @@ /* clixon */ #include "clixon_queue.h" -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_hash.h" #include "clixon_handle.h" #include "clixon_yang.h" diff --git a/lib/src/clixon_string.c b/lib/src/clixon_string.c index f7bed5b8..ec2c119a 100644 --- a/lib/src/clixon_string.c +++ b/lib/src/clixon_string.c @@ -960,126 +960,6 @@ uri_str2cvec(char *string, goto done; } -/*! Map from int to string using str2int map - * - * @param[in] ms String, integer map - * @param[in] i Input integer - * @retval str String value - * @retval NULL Error, not found - * @note linear search - */ -const char * -clicon_int2str(const map_str2int *mstab, - int i) -{ - const struct map_str2int *ms; - - for (ms = &mstab[0]; ms->ms_str; ms++) - if (ms->ms_int == i) - return ms->ms_str; - return NULL; -} - -/*! Map from string to int using str2int map - * - * @param[in] ms String, integer map - * @param[in] str Input string - * @retval int Value - * @retval -1 Error, not found - * @see clicon_str2int_search for optimized lookup, but strings must be sorted - */ -int -clicon_str2int(const map_str2int *mstab, - char *str) -{ - const struct map_str2int *ms; - - for (ms = &mstab[0]; ms->ms_str; ms++) - if (strcmp(ms->ms_str, str) == 0) - return ms->ms_int; - return -1; -} - -/*! Map from string to int using binary (alphatical) search - * - * @param[in] ms String, integer map - * @param[in] str Input string - * @param[in] low Lower bound index - * @param[in] upper Upper bound index - * @param[in] len Length of array (max) - * @param[out] found Integer found (can also be negative) - * @retval 1 Found with "found" value set. - * @retval 0 Not found - * @note Assumes sorted strings, tree search - */ -static int -str2int_search1(const map_str2int *mstab, - char *str, - int low, - int upper, - int len, - int *found) -{ - const struct map_str2int *ms; - int mid; - int cmp; - - if (upper < low) - return 0; /* not found */ - mid = (low + upper) / 2; - if (mid >= len) /* beyond range */ - return 0; /* not found */ - ms = &mstab[mid]; - if ((cmp = strcmp(str, ms->ms_str)) == 0){ - *found = ms->ms_int; - return 1; /* found */ - } - else if (cmp < 0) - return str2int_search1(mstab, str, low, mid-1, len, found); - else - return str2int_search1(mstab, str, mid+1, upper, len, found); -} - -/*! Map from string to int using str2int map - * - * @param[in] ms String, integer map - * @param[in] str Input string - * @retval int Value - * @retval -1 Error, not found - * @note Assumes sorted strings, tree search - * @note -1 can not be value - */ -int -clicon_str2int_search(const map_str2int *mstab, - char *str, - int len) -{ - int found; - - if (str2int_search1(mstab, str, 0, len, len, &found)) - return found; - return -1; /* not found */ -} - -/*! Map from string to string using str2str map - * - * @param[in] mstab String, string map - * @param[in] str Input string - * @retval str Output string - * @retval NULL Error, not found - */ -char* -clicon_str2str(const map_str2str *mstab, - char *str) -{ - const struct map_str2str *ms; - - for (ms = &mstab[0]; ms->ms_s0; ms++) - if (strcmp(ms->ms_s0, str) == 0) - return ms->ms_s1; - return NULL; -} - /*! Split colon-separated node identifier into prefix and name * * @param[in] node-id diff --git a/lib/src/clixon_validate.c b/lib/src/clixon_validate.c index cb7a95cd..f8b78f70 100644 --- a/lib/src/clixon_validate.c +++ b/lib/src/clixon_validate.c @@ -56,7 +56,7 @@ #include /* clixon */ -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_validate_minmax.c b/lib/src/clixon_validate_minmax.c index 5958761f..55d582bc 100644 --- a/lib/src/clixon_validate_minmax.c +++ b/lib/src/clixon_validate_minmax.c @@ -56,7 +56,7 @@ #include /* clixon */ -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_xml.c b/lib/src/clixon_xml.c index 8e07d904..872a5888 100644 --- a/lib/src/clixon_xml.c +++ b/lib/src/clixon_xml.c @@ -58,7 +58,7 @@ #include /* clixon */ -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_xml_bind.c b/lib/src/clixon_xml_bind.c index 23c5be9f..0f5e36bd 100644 --- a/lib/src/clixon_xml_bind.c +++ b/lib/src/clixon_xml_bind.c @@ -57,11 +57,11 @@ #include /* clixon */ -#include "clixon_string.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_yang.h" #include "clixon_xml.h" #include "clixon_log.h" diff --git a/lib/src/clixon_xml_changelog.c b/lib/src/clixon_xml_changelog.c index 662a4bf4..b13b8235 100644 --- a/lib/src/clixon_xml_changelog.c +++ b/lib/src/clixon_xml_changelog.c @@ -59,7 +59,7 @@ /* clixon */ #include "clixon_queue.h" #include "clixon_hash.h" -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_handle.h" #include "clixon_yang.h" #include "clixon_xml.h" diff --git a/lib/src/clixon_xml_default.c b/lib/src/clixon_xml_default.c index 7c7747f0..5a4cd9f1 100644 --- a/lib/src/clixon_xml_default.c +++ b/lib/src/clixon_xml_default.c @@ -58,7 +58,7 @@ /* clixon */ #include "clixon_queue.h" #include "clixon_hash.h" -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_handle.h" #include "clixon_yang.h" #include "clixon_xml.h" diff --git a/lib/src/clixon_xml_io.c b/lib/src/clixon_xml_io.c index 1246aa24..c834f16f 100644 --- a/lib/src/clixon_xml_io.c +++ b/lib/src/clixon_xml_io.c @@ -61,6 +61,7 @@ /* clixon */ #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_digest.h" diff --git a/lib/src/clixon_xml_map.c b/lib/src/clixon_xml_map.c index b7881972..28df5734 100644 --- a/lib/src/clixon_xml_map.c +++ b/lib/src/clixon_xml_map.c @@ -57,11 +57,11 @@ #include /* clixon */ -#include "clixon_string.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_yang.h" #include "clixon_xml.h" #include "clixon_log.h" diff --git a/lib/src/clixon_xml_nsctx.c b/lib/src/clixon_xml_nsctx.c index 275ef317..89f9c6be 100644 --- a/lib/src/clixon_xml_nsctx.c +++ b/lib/src/clixon_xml_nsctx.c @@ -308,7 +308,7 @@ xml_nsctx_node(cxobj *xn, * Primary use is Yang path statements, eg leafrefs and others * Fully explore all prefix:namespace pairs from context of one node * @param[in] yn Yang statement in module tree (or module itself) - * @param[out] ncp XML namespace context + * @param[out] ncp XML namespace context (caller frees with cvec_free) * @retval 0 OK * @retval -1 Error * @code diff --git a/lib/src/clixon_xml_sort.c b/lib/src/clixon_xml_sort.c index e84724e1..c4737a45 100644 --- a/lib/src/clixon_xml_sort.c +++ b/lib/src/clixon_xml_sort.c @@ -56,6 +56,7 @@ /* clixon */ #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_xpath.c b/lib/src/clixon_xpath.c index 4d235dcd..b47f8eb3 100644 --- a/lib/src/clixon_xpath.c +++ b/lib/src/clixon_xpath.c @@ -82,6 +82,7 @@ /* clixon */ #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_xpath_ctx.c b/lib/src/clixon_xpath_ctx.c index d82b856d..8447a5b9 100644 --- a/lib/src/clixon_xpath_ctx.c +++ b/lib/src/clixon_xpath_ctx.c @@ -51,7 +51,7 @@ #include /* clixon */ -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_xpath_eval.c b/lib/src/clixon_xpath_eval.c index 617e2a56..1b677183 100644 --- a/lib/src/clixon_xpath_eval.c +++ b/lib/src/clixon_xpath_eval.c @@ -73,7 +73,7 @@ #include /* clixon */ -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_xpath_function.c b/lib/src/clixon_xpath_function.c index bd1881d4..a322253f 100644 --- a/lib/src/clixon_xpath_function.c +++ b/lib/src/clixon_xpath_function.c @@ -56,6 +56,7 @@ /* clixon */ #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_xpath_optimize.c b/lib/src/clixon_xpath_optimize.c index 8d3e0ab6..90d863e1 100644 --- a/lib/src/clixon_xpath_optimize.c +++ b/lib/src/clixon_xpath_optimize.c @@ -55,7 +55,7 @@ #include /* clixon */ -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_xpath_parse.l b/lib/src/clixon_xpath_parse.l index 29c92edf..bb81cd46 100644 --- a/lib/src/clixon_xpath_parse.l +++ b/lib/src/clixon_xpath_parse.l @@ -72,7 +72,7 @@ There are some special lexical rules in https://www.w3.org/TR/xpath-10 #include "clixon_hash.h" #include "clixon_handle.h" #include "clixon_yang.h" -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_xml.h" #include "clixon_log.h" #include "clixon_debug.h" diff --git a/lib/src/clixon_xpath_parse.y b/lib/src/clixon_xpath_parse.y index 3da7b7fb..d0642682 100644 --- a/lib/src/clixon_xpath_parse.y +++ b/lib/src/clixon_xpath_parse.y @@ -126,7 +126,7 @@ #include "clixon_err.h" #include "clixon_log.h" #include "clixon_debug.h" -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_xpath_ctx.h" #include "clixon_xpath.h" #include "clixon_xpath_function.h" diff --git a/lib/src/clixon_xpath_yang.c b/lib/src/clixon_xpath_yang.c index 9a0674a0..2ac43dc9 100644 --- a/lib/src/clixon_xpath_yang.c +++ b/lib/src/clixon_xpath_yang.c @@ -54,7 +54,7 @@ #include /* clixon */ -#include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_yang.c b/lib/src/clixon_yang.c index 0c6810ec..9a7b50c1 100644 --- a/lib/src/clixon_yang.c +++ b/lib/src/clixon_yang.c @@ -65,6 +65,7 @@ /* clixon */ #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_yang_module.c b/lib/src/clixon_yang_module.c index 25dd2f74..6acb7aa0 100644 --- a/lib/src/clixon_yang_module.c +++ b/lib/src/clixon_yang_module.c @@ -62,6 +62,7 @@ /* clixon */ #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_yang_parse_lib.c b/lib/src/clixon_yang_parse_lib.c index 2f3178f6..2f0413df 100644 --- a/lib/src/clixon_yang_parse_lib.c +++ b/lib/src/clixon_yang_parse_lib.c @@ -76,6 +76,7 @@ /* clixon */ #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h" diff --git a/lib/src/clixon_yang_schema_mount.c b/lib/src/clixon_yang_schema_mount.c index 73b89598..185e2033 100644 --- a/lib/src/clixon_yang_schema_mount.c +++ b/lib/src/clixon_yang_schema_mount.c @@ -98,6 +98,7 @@ #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_handle.h" #include "clixon_yang.h" #include "clixon_xml.h" diff --git a/lib/src/clixon_yang_type.c b/lib/src/clixon_yang_type.c index bd53b4c3..005c820a 100644 --- a/lib/src/clixon_yang_type.c +++ b/lib/src/clixon_yang_type.c @@ -85,6 +85,7 @@ /* clixon */ #include "clixon_string.h" +#include "clixon_map.h" #include "clixon_queue.h" #include "clixon_hash.h" #include "clixon_handle.h"