Added const char * in multiple places

This commit is contained in:
Olof hagsand 2020-07-02 19:25:48 +02:00
parent 0a985e6618
commit 593ed2ef3b
30 changed files with 138 additions and 136 deletions

View file

@ -88,7 +88,7 @@
*/
int
clicon_data_get(clicon_handle h,
char *name,
const char *name,
char **val)
{
clicon_hash_t *cdat = clicon_data(h);
@ -110,7 +110,7 @@ clicon_data_get(clicon_handle h,
*/
int
clicon_data_set(clicon_handle h,
char *name,
const char *name,
char *val)
{
clicon_hash_t *cdat = clicon_data(h);
@ -127,7 +127,7 @@ clicon_data_set(clicon_handle h,
*/
int
clicon_data_del(clicon_handle h,
char *name)
const char *name)
{
clicon_hash_t *cdat = clicon_data(h);

View file

@ -427,7 +427,7 @@ static int
xmldb_get_nocache(clicon_handle h,
const char *db,
cvec *nsc,
char *xpath,
const char *xpath,
cxobj **xtop,
modstate_diff_t *msdiff)
{
@ -511,7 +511,7 @@ static int
xmldb_get_cache(clicon_handle h,
const char *db,
cvec *nsc,
char *xpath,
const char *xpath,
cxobj **xtop,
modstate_diff_t *msdiff)
{
@ -612,7 +612,7 @@ static int
xmldb_get_zerocopy(clicon_handle h,
const char *db,
cvec *nsc,
char *xpath,
const char *xpath,
cxobj **xtop,
modstate_diff_t *msdiff)
{
@ -726,7 +726,7 @@ int
xmldb_get0(clicon_handle h,
const char *db,
cvec *nsc,
char *xpath,
const char *xpath,
int copy,
cxobj **xret,
modstate_diff_t *msdiff)

View file

@ -149,7 +149,7 @@ int clicon_err_fn(const char *fn,
const int line,
int category,
int suberr,
char *format, ...)
const char *format, ...)
{
va_list args;
int len;

View file

@ -257,8 +257,8 @@ clicon_log_str(int level,
* @see clicon_log_init and clicon_log_str
*/
int
clicon_log(int level,
char *format, ...)
clicon_log(int level,
const char *format, ...)
{
va_list args;
int len;
@ -338,8 +338,8 @@ clicon_debug_get(void)
* @param[in] format Message to print as argv.
*/
int
clicon_debug(int dbglevel,
char *format, ...)
clicon_debug(int dbglevel,
const char *format, ...)
{
va_list args;
int len;

View file

@ -327,7 +327,7 @@ parse_configfile(clicon_handle h,
*/
int
clicon_option_add(clicon_handle h,
char *name,
const char *name,
char *value)
{
int retval = -1;

View file

@ -1529,7 +1529,7 @@ clixon_xml_find_api_path(cxobj *xt,
yang_stmt *yt,
cxobj ***xvec,
int *xlen,
char *format,
const char *format,
...)
{
int retval = -1;
@ -1623,7 +1623,7 @@ clixon_xml_find_instance_id(cxobj *xt,
yang_stmt *yt,
cxobj ***xvec,
int *xlen,
char *format,
const char *format,
...)
{
int retval = -1;

View file

@ -159,7 +159,7 @@ clixon_plugin_each_revert(clicon_handle h,
*/
clixon_plugin *
clixon_plugin_find(clicon_handle h,
char *name)
const char *name)
{
int i;
clixon_plugin *cp = NULL;
@ -185,8 +185,8 @@ clixon_plugin_find(clicon_handle h,
*/
static int
plugin_load_one(clicon_handle h,
char *file,
char *function,
char *file, /* note modified */
const char *function,
int dlflags,
clixon_plugin **cpp)
{
@ -267,9 +267,9 @@ plugin_load_one(clicon_handle h,
*/
int
clixon_plugins_load(clicon_handle h,
char *function,
char *dir,
char *regexp)
const char *function,
const char *dir,
const char *regexp)
{
int retval = -1;
int ndp;
@ -316,7 +316,7 @@ done:
*/
int
clixon_pseudo_plugin(clicon_handle h,
char *name,
const char *name,
clixon_plugin **cpp)
{
int retval = -1;
@ -595,7 +595,7 @@ clixon_plugin_extension_all(clicon_handle h,
int
clixon_plugin_datastore_upgrade_one(clixon_plugin *cp,
clicon_handle h,
char *db,
const char *db,
cxobj *xt,
modstate_diff_t *msd)
@ -628,7 +628,7 @@ clixon_plugin_datastore_upgrade_one(clixon_plugin *cp,
*/
int
clixon_plugin_datastore_upgrade_all(clicon_handle h,
char *db,
const char *db,
cxobj *xt,
modstate_diff_t *msd)
{
@ -682,8 +682,8 @@ int
rpc_callback_register(clicon_handle h,
clicon_rpc_cb cb,
void *arg,
char *ns,
char *name)
const char *ns,
const char *name)
{
rpc_callback_t *rc = NULL;
@ -813,7 +813,7 @@ int
upgrade_callback_reg_fn(clicon_handle h,
clicon_upgrade_cb cb,
const char *fnstr,
char *ns,
const char *ns,
void *arg)
{
upgrade_callback_t *uc;

View file

@ -136,7 +136,7 @@ format_str2int(char *str)
*/
struct clicon_msg *
clicon_msg_encode(uint32_t id,
char *format, ...)
const char *format, ...)
{
va_list args;
uint32_t xmllen;

View file

@ -244,7 +244,7 @@ uri_unreserved(unsigned char in)
*/
int
uri_percent_encode(char **encp,
char *fmt, ...)
const char *fmt, ...)
{
int retval = -1;
char *str = NULL; /* Expanded format string w stdarg */
@ -370,8 +370,8 @@ uri_percent_decode(char *enc,
* @see xml_chardata_cbuf_append for a specialized version
*/
int
xml_chardata_encode(char **escp,
char *fmt,...)
xml_chardata_encode(char **escp,
const char *fmt,...)
{
int retval = -1;
char *str = NULL; /* Expanded format string w stdarg */

View file

@ -1661,8 +1661,8 @@ xml_body_get(cxobj *xt)
*/
char *
xml_find_type_value(cxobj *xt,
char *prefix,
char *name,
const char *prefix,
const char *name,
enum cxobj_type type)
{
cxobj *x;
@ -1691,8 +1691,8 @@ xml_find_type_value(cxobj *xt,
*/
cxobj *
xml_find_type(cxobj *xt,
char *prefix,
char *name,
const char *prefix,
const char *name,
enum cxobj_type type)
{
cxobj *x = NULL;
@ -1730,8 +1730,8 @@ xml_find_type(cxobj *xt,
* return x_value
*/
char *
xml_find_value(cxobj *xt,
char *name)
xml_find_value(cxobj *xt,
const char *name)
{
cxobj *x = NULL;
@ -1755,8 +1755,8 @@ xml_find_value(cxobj *xt,
* x_name=name return x_value
*/
char *
xml_find_body(cxobj *xt,
char *name)
xml_find_body(cxobj *xt,
const char *name)
{
cxobj *x=NULL;
@ -1783,9 +1783,9 @@ xml_find_body(cxobj *xt,
* return x
*/
cxobj *
xml_find_body_obj(cxobj *xt,
char *name,
char *val)
xml_find_body_obj(cxobj *xt,
const char *name,
char *val)
{
cxobj *x = NULL;
char *bstr;
@ -2315,9 +2315,9 @@ xml_attr_insert2val(char *instr,
* @param[in] format Message to print as argv.
*/
int
clicon_log_xml(int level,
cxobj *x,
char *format, ...)
clicon_log_xml(int level,
cxobj *x,
const char *format, ...)
{
va_list args;
int len;

View file

@ -483,7 +483,7 @@ xpath_tree_free(xpath_tree *xs)
* @see xpath_tree_free
*/
int
xpath_parse(char *xpath,
xpath_parse(const char *xpath,
xpath_tree **xptree)
{
int retval = -1;
@ -541,11 +541,11 @@ xpath_parse(char *xpath,
* @endcode
*/
int
xpath_vec_ctx(cxobj *xcur,
cvec *nsc,
char *xpath,
int localonly,
xp_ctx **xrp)
xpath_vec_ctx(cxobj *xcur,
cvec *nsc,
const char *xpath,
int localonly,
xp_ctx **xrp)
{
int retval = -1;
xpath_tree *xptree = NULL;
@ -591,9 +591,9 @@ xpath_vec_ctx(cxobj *xcur,
* @see also xpath_vec.
*/
cxobj *
xpath_first(cxobj *xcur,
cvec *nsc,
char *xpformat,
xpath_first(cxobj *xcur,
cvec *nsc,
const char *xpformat,
...)
{
cxobj *cx = NULL;
@ -651,8 +651,8 @@ xpath_first(cxobj *xcur,
* @see also xpath_first.
*/
cxobj *
xpath_first_localonly(cxobj *xcur,
char *xpformat,
xpath_first_localonly(cxobj *xcur,
const char *xpformat,
...)
{
cxobj *cx = NULL;
@ -712,11 +712,11 @@ xpath_first_localonly(cxobj *xcur,
* @endcode
*/
int
xpath_vec(cxobj *xcur,
cvec *nsc,
char *xpformat,
cxobj ***vec,
size_t *veclen,
xpath_vec(cxobj *xcur,
cvec *nsc,
const char *xpformat,
cxobj ***vec,
size_t *veclen,
...)
{
int retval = -1;
@ -784,12 +784,12 @@ xpath_vec(cxobj *xcur,
* @see also xpath_vec This is a specialized version.
*/
int
xpath_vec_flag(cxobj *xcur,
cvec *nsc,
char *xpformat,
uint16_t flags,
cxobj ***vec,
int *veclen,
xpath_vec_flag(cxobj *xcur,
cvec *nsc,
const char *xpformat,
uint16_t flags,
cxobj ***vec,
int *veclen,
...)
{
int retval = -1;
@ -847,9 +847,9 @@ xpath_vec_flag(cxobj *xcur,
* @retval -1 Error
*/
int
xpath_vec_bool(cxobj *xcur,
cvec *nsc,
char *xpformat,
xpath_vec_bool(cxobj *xcur,
cvec *nsc,
const char *xpformat,
...)
{
int retval = -1;
@ -970,7 +970,7 @@ traverse_canonical(xpath_tree *xs,
* @endcode
*/
int
xpath2canonical(char *xpath0,
xpath2canonical(const char *xpath0,
cvec *nsc0,
yang_stmt *yspec,
char **xpath1,

View file

@ -43,7 +43,7 @@
struct clixon_xpath_yacc{
const char *xpy_name; /* Name of syntax (for error string) */
int xpy_linenum; /* Number of \n in parsed buffer */
char *xpy_parse_string; /* original (copy of) parse string */
const char *xpy_parse_string; /* original (copy of) parse string */
void *xpy_lexbuf; /* internal parse buffer from lex */
xpath_tree *xpy_top;
};