Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions lib/clixon/clixon_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,22 @@ static inline char * strdup4(char *str)
/*
* Prototypes
*/
char **clicon_strsep(char *string, char *delim, int *nvec0);
int clixon_strsep2(char *str, char *delim1, char *delim2, char ***vcp, int *nvec);
char *clicon_strjoin (int argc, char **argv, char *delim);
char *clixon_string_del_join(char *str1, char *del, char *str2);
int clixon_strsplit(char *nodeid, const int delim, char **prefix, char **id);
int uri_str2cvec(char *string, char delim1, char delim2, int decode, cvec **cvp);
char *clicon_strjoin (int argc, char **argv, const char *delim);
char **clicon_strsep(const char *string, const char *delim, int *nvec0);
int clixon_strsep2(char *str, const char *delim1, const char *delim2, char ***vcp, int *nvec);
char *clixon_string_del_join(char *str1, const char *del, const char *str2);
int clixon_strsplit(const char *nodeid, const int delim, char **prefix, char **id);
int uri_str2cvec(const char *string, char delim1, char delim2, int decode, cvec **cvp);
int uri_percent_encode(char **encp, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
int xml_chardata_encode(char **escp, int quote, const char *fmt, ... ) __attribute__ ((format (printf, 3, 4)));
int xml_chardata_cbuf_append(cbuf *cb, int quote, char *str);
int xml_chardata_cbuf_append(cbuf *cb, int quote, const char *str);
int xml_chardata_decode(char **escp, const char *fmt,...);
int uri_percent_decode(char *enc, char **str);
int uri_percent_decode(const char *enc, char **str);
int nodeid_split(char *nodeid, char **prefix, char **id);
char *clixon_trim(char *str);
char *clixon_trim2(char *str, char *trims);
int clicon_strcmp(char *s1, char *s2);
int clixon_unicode2utf8(char *ucstr, char *utfstr, size_t utflen);
int clicon_strcmp(const char *s1, const char *s2);
int clixon_unicode2utf8(const char *ucstr, char *utfstr, size_t utflen);
int clixon_str_subst(char *str, cvec *cvv, cbuf *cb);

#ifndef HAVE_STRNDUP
Expand Down
36 changes: 18 additions & 18 deletions lib/clixon/clixon_xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,17 @@ enum format_enum{
/*
* Prototypes
*/
char *xml_type2str(enum cxobj_type type);
const char *xml_type2str(enum cxobj_type type);
int xml_stats_global(uint64_t *nr);
int xml_stats(cxobj *xt, uint64_t *nrp, size_t *szp);
char *xml_name(cxobj *xn);
int xml_name_set(cxobj *xn, char *name);
int xml_name_set(cxobj *xn, const char *name);
char *xml_prefix(cxobj *xn);
int xml_prefix_set(cxobj *xn, char *name);
char *nscache_get(cxobj *x, char *prefix);
int nscache_get_prefix(cxobj *x, char *ns, char **prefix);
int xml_prefix_set(cxobj *xn, const char *name);
char *nscache_get(cxobj *x, const char *prefix);
int nscache_get_prefix(cxobj *x, const char *ns, char **prefix);
cvec *nscache_get_all(cxobj *x);
int nscache_set(cxobj *x, char *prefix, char *ns);
int nscache_set(cxobj *x, const char *prefix, const char *ns);
int nscache_clear(cxobj *x);
int nscache_replace(cxobj *x, cvec *ns);
cxobj *xml_parent(cxobj *xn);
Expand All @@ -239,8 +239,8 @@ int xml_flag_set(cxobj *xn, uint16_t flag);
int xml_flag_reset(cxobj *xn, uint16_t flag);

char *xml_value(cxobj *xn);
int xml_value_set(cxobj *xn, char *val);
int xml_value_append(cxobj *xn, char *val);
int xml_value_set(cxobj *xn, const char *val);
int xml_value_append(cxobj *xn, const char *val);
enum cxobj_type xml_type(cxobj *xn);
enum cxobj_type xml_type_set(cxobj *xn, enum cxobj_type type);
int xml_child_nr(cxobj *xn);
Expand All @@ -257,16 +257,16 @@ int xml_child_insert_pos(cxobj *x, cxobj *xc, int pos);
int xml_childvec_set(cxobj *x, int len);
cxobj **xml_childvec_get(cxobj *x);
int clixon_child_xvec_append(cxobj *x, clixon_xvec *xv);
cxobj *xml_new(char *name, cxobj *xn_parent, enum cxobj_type type);
cxobj *xml_new_body(char *name, cxobj *parent, char *val);
cxobj *xml_new(const char *name, cxobj *xn_parent, enum cxobj_type type);
cxobj *xml_new_body(const char *name, cxobj *parent, const char *val);
yang_stmt *xml_spec(cxobj *x);
int xml_spec_set(cxobj *x, yang_stmt *spec);
cg_var *xml_cv(cxobj *x);
int xml_cv_set(cxobj *x, cg_var *cv);
cxobj *xml_find(cxobj *xn_parent, char *name);
cxobj *xml_find(cxobj *xn_parent, const char *name);
int xml_addsub(cxobj *xp, cxobj *xc);
cxobj *xml_wrap_all(cxobj *xp, char *tag);
cxobj *xml_wrap(cxobj *xc, char *tag);
cxobj *xml_wrap_all(cxobj *xp, const char *tag);
cxobj *xml_wrap(cxobj *xc, const char *tag);
int xml_purge(cxobj *xc);
int xml_child_rm(cxobj *xp, int i);
int xml_rm(cxobj *xc);
Expand Down Expand Up @@ -298,16 +298,16 @@ int xml_apply0(cxobj *xn, enum cxobj_type type, xml_applyfn_t fn, void *ar
int xml_apply_ancestor(cxobj *xn, xml_applyfn_t fn, void *arg);
int xml_isancestor(cxobj *x, cxobj *xp);
cxobj *xml_root(cxobj *xn);
int xml_operation(char *opstr, enum operation_type *op);
int xml_operation(const char *opstr, enum operation_type *op);
char *xml_operation2str(enum operation_type op);
int xml_attr_insert2val(char *instr, enum insert_type *ins);
cxobj *xml_add_attr(cxobj *xn, char *name, char *value, char *prefix, char *ns);
int xml_attr_insert2val(const char *instr, enum insert_type *ins);
cxobj *xml_add_attr(cxobj *xn, const char *name, const char *value, const char *prefix, const char *ns);
#ifdef XML_EXPLICIT_INDEX
int xml_search_index_p(cxobj *x);
int xml_search_vector_get(cxobj *x, char *name, clixon_xvec **xvec);
int xml_search_vector_get(cxobj *x, const char *name, clixon_xvec **xvec);
int xml_search_child_insert(cxobj *xp, cxobj *x);
int xml_search_child_rm(cxobj *xp, cxobj *x);
cxobj *xml_child_index_each(cxobj *xparent, char *name, cxobj *xprev, enum cxobj_type type);
cxobj *xml_child_index_each(cxobj *xparent, const char *name, cxobj *xprev, enum cxobj_type type);

#endif

Expand Down
14 changes: 7 additions & 7 deletions lib/clixon/clixon_xml_nsctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@
* Prototypes
*/
int xml_nsctx_namespace_netconf_default(clixon_handle h);
cvec *xml_nsctx_init(char *prefix, char *ns);
cvec *xml_nsctx_init(const char *prefix, const char *ns);
int xml_nsctx_free(cvec *nsc);
char *xml_nsctx_get(cvec *nsc, char *prefix);
int xml_nsctx_get_prefix(cvec *cvv, char *ns, char **prefix);
int xml_nsctx_add(cvec *nsc, char *prefix, char *ns);
char *xml_nsctx_get(cvec *nsc, const char *prefix);
int xml_nsctx_get_prefix(cvec *cvv, const char *ns, char **prefix);
int xml_nsctx_add(cvec *nsc, const char *prefix, const char *ns);
int xml_nsctx_node(cxobj *x, cvec **ncp);
int xml_nsctx_yang(yang_stmt *yn, cvec **ncp);
int xml_nsctx_yangspec(yang_stmt *yspec, cvec **ncp);
int xml_nsctx_cbuf(cbuf *cb, cvec *nsc);
int xml2ns(cxobj *x, char *prefix, char **ns);
int xml2ns(cxobj *x, const char *prefix, char **ns);
int xml2ns_recurse(cxobj *x);
int xmlns_set(cxobj *x, char *prefix, char *ns);
int xmlns_set(cxobj *x, const char *prefix, const char *ns);
int xmlns_set_all(cxobj *x, cvec *nsc);
int xml2prefix(cxobj *xn, char *ns, char **prefixp);
int xml_add_namespace(cxobj *x, cxobj *xp, char *prefix, char *ns);
int xml_add_namespace(cxobj *x, cxobj *xp, const char *prefix, const char *ns);

#endif /* _CLIXON_XML_NSCTX_H */
30 changes: 15 additions & 15 deletions lib/src/clixon_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
* @see clixon_strsplit
*/
char **
clicon_strsep(char *string,
char *delim,
clicon_strsep(const char *string,
const char *delim,
int *nvec0)
{
char **vec = NULL;
Expand All @@ -94,7 +94,7 @@ clicon_strsep(char *string,
int nvec = 1;
int i;
size_t siz;
char *s;
const char *s;
char *d;

if ((s = string)==NULL)
Expand Down Expand Up @@ -136,8 +136,8 @@ clicon_strsep(char *string,
*/
int
clixon_strsep2(char *str,
char *delim1,
char *delim2,
const char *delim1,
const char *delim2,
char ***vcp,
int *nvec)
{
Expand Down Expand Up @@ -197,7 +197,7 @@ clixon_strsep2(char *str,
char *
clicon_strjoin(int argc,
char **argv,
char *delim)
const char *delim)
{
int i;
int len;
Expand Down Expand Up @@ -230,8 +230,8 @@ clicon_strjoin(int argc,
*/
char*
clixon_string_del_join(char *str1,
char *del,
char *str2)
const char *del,
const char *str2)
{
char *str;
int len;
Expand Down Expand Up @@ -275,7 +275,7 @@ clixon_string_del_join(char *str1,
* @see clicon_strsep not just single split
*/
int
clixon_strsplit(char *string,
clixon_strsplit(const char *string,
const int delim,
char **prefix,
char **suffix)
Expand Down Expand Up @@ -413,7 +413,7 @@ uri_percent_encode(char **encp,
* @see uri_percent_encode
*/
int
uri_percent_decode(char *enc,
uri_percent_decode(const char *enc,
char **strp)
{
int retval = -1;
Expand Down Expand Up @@ -650,7 +650,7 @@ xml_chardata_encode(char **escp,
int
xml_chardata_cbuf_append(cbuf *cb,
int quote,
char *str)
const char *str)
{
int retval = -1;
int i;
Expand Down Expand Up @@ -874,7 +874,7 @@ xml_chardata_decode(char **decp,
* XXX differentiate between error and null cvec.
*/
int
uri_str2cvec(char *string,
uri_str2cvec(const char *string,
char delim1,
char delim2,
int decode,
Expand Down Expand Up @@ -1040,8 +1040,8 @@ clixon_trim2(char *str,
* @retval >0 s1 is greater than s2
*/
int
clicon_strcmp(char *s1,
char *s2)
clicon_strcmp(const char *s1,
const char *s2)
{
if (s1 == NULL && s2 == NULL)
return 0;
Expand Down Expand Up @@ -1099,7 +1099,7 @@ clixon_unicode2utf8_one(uint16_t uc16,
* @retval -1 Error
*/
int
clixon_unicode2utf8(char *ucstr,
clixon_unicode2utf8(const char *ucstr,
char *utfstr,
size_t utflen)
{
Expand Down
Loading