@@ -298,26 +298,26 @@ ctl_exec_query_subtree(void *ctx, const umf_ctl_node_t *n,
298
298
* ctl_find_and_execulte_node -- (internal) searches for a matching entry point in the
299
299
* provided nodes
300
300
*
301
- * Name offset is used to return the offset of the name in the query string.
301
+ * Path offset is used to return the offset of the path in the query string.
302
302
* The caller is responsible for freeing all of the allocated indexes,
303
303
* regardless of the return value.
304
304
*/
305
305
306
306
static optional_umf_result_t
307
307
ctl_find_and_execute_node (const umf_ctl_node_t * nodes , void * ctx ,
308
- umf_ctl_query_source_t source , const char * name ,
308
+ umf_ctl_query_source_t source , const char * path ,
309
309
umf_ctl_query_type_t type , void * arg , size_t size ,
310
310
va_list args ) {
311
311
assert (nodes != NULL );
312
- assert (name != NULL );
312
+ assert (path != NULL );
313
313
314
314
const umf_ctl_node_t * n = NULL ;
315
315
optional_umf_result_t ret ;
316
- size_t name_offset = 0 ;
316
+ size_t path_offset = 0 ;
317
317
ret .is_valid = true;
318
318
ret .value = UMF_RESULT_SUCCESS ;
319
319
char * sptr = NULL ;
320
- char * parse_str = Strdup (name );
320
+ char * parse_str = Strdup (path );
321
321
if (parse_str == NULL ) {
322
322
ret .is_valid = false;
323
323
return ret ;
@@ -336,7 +336,7 @@ ctl_find_and_execute_node(const umf_ctl_node_t *nodes, void *ctx,
336
336
*/
337
337
while (node_name != NULL ) {
338
338
char * next_node = strtok_r (NULL , CTL_QUERY_NODE_SEPARATOR , & sptr );
339
- name_offset = node_name - parse_str ;
339
+ path_offset = node_name - parse_str ;
340
340
if (n != NULL && n -> type == CTL_NODE_SUBTREE ) {
341
341
// if a subtree occurs, the subtree handler should be called
342
342
break ;
@@ -500,7 +500,7 @@ ctl_find_and_execute_node(const umf_ctl_node_t *nodes, void *ctx,
500
500
// if the node is a subtree, then we need to call the subtree handler
501
501
ret .value =
502
502
ctl_exec_query_subtree (ctx , n , source , arg , size , indexes -> next ,
503
- name + name_offset , type , args );
503
+ path + path_offset , type , args );
504
504
} else {
505
505
switch (type ) {
506
506
case CTL_QUERY_READ :
@@ -530,25 +530,25 @@ ctl_find_and_execute_node(const umf_ctl_node_t *nodes, void *ctx,
530
530
}
531
531
532
532
/*
533
- * ctl_query -- (internal) parses the name and calls the appropriate methods
533
+ * ctl_query -- (internal) parses the path and calls the appropriate methods
534
534
* from the ctl tree
535
535
*/
536
536
umf_result_t ctl_query (struct ctl * ctl , void * ctx ,
537
- umf_ctl_query_source_t source , const char * name ,
537
+ umf_ctl_query_source_t source , const char * path ,
538
538
umf_ctl_query_type_t type , void * arg , size_t size ,
539
539
va_list args ) {
540
- if (name == NULL ) {
540
+ if (path == NULL ) {
541
541
return UMF_RESULT_ERROR_INVALID_ARGUMENT ;
542
542
}
543
543
544
544
va_list args_copy ;
545
545
va_copy (args_copy , args );
546
546
547
547
optional_umf_result_t ret = ctl_find_and_execute_node (
548
- CTL_NODE (global ), ctx , source , name , type , arg , size , args_copy );
548
+ CTL_NODE (global ), ctx , source , path , type , arg , size , args_copy );
549
549
550
550
if (ret .is_valid == false && ctl ) {
551
- ret = ctl_find_and_execute_node (ctl -> root , ctx , source , name , type , arg ,
551
+ ret = ctl_find_and_execute_node (ctl -> root , ctx , source , path , type , arg ,
552
552
size , args );
553
553
}
554
554
@@ -573,16 +573,16 @@ void ctl_register_module_node(struct ctl *c, const char *name,
573
573
574
574
/*
575
575
* ctl_parse_query -- (internal) splits an entire query string
576
- * into name and value
576
+ * into path and value
577
577
*/
578
- static int ctl_parse_query (char * qbuf , char * * name , char * * value ) {
578
+ static int ctl_parse_query (char * qbuf , char * * path , char * * value ) {
579
579
if (qbuf == NULL ) {
580
580
return -1 ;
581
581
}
582
582
583
583
char * sptr = NULL ;
584
- * name = strtok_r (qbuf , CTL_NAME_VALUE_SEPARATOR , & sptr );
585
- if (* name == NULL ) {
584
+ * path = strtok_r (qbuf , CTL_NAME_VALUE_SEPARATOR , & sptr );
585
+ if (* path == NULL ) {
586
586
return -1 ;
587
587
}
588
588
@@ -608,20 +608,20 @@ static umf_result_t ctl_load_config_helper(struct ctl *ctl, void *ctx,
608
608
char * buf , ...) {
609
609
umf_result_t ret = UMF_RESULT_SUCCESS ;
610
610
char * sptr = NULL ; /* for internal use of strtok */
611
- char * name ;
611
+ char * path ;
612
612
char * value ;
613
613
char * qbuf = strtok_r (buf , CTL_STRING_QUERY_SEPARATOR , & sptr );
614
614
va_list empty_args ;
615
615
va_start (empty_args , buf );
616
616
while (qbuf != NULL ) {
617
- int parse_res = ctl_parse_query (qbuf , & name , & value );
617
+ int parse_res = ctl_parse_query (qbuf , & path , & value );
618
618
if (parse_res != 0 ) {
619
619
ret = UMF_RESULT_ERROR_INVALID_ARGUMENT ;
620
620
goto end ;
621
621
}
622
622
// we do not need to copy va_list before call as we know that for query_config_input
623
623
// ctl_query will not call va_arg on it. Ref 7.15/3 of C99 standard
624
- ret = ctl_query (ctl , ctx , CTL_QUERY_CONFIG_INPUT , name , CTL_QUERY_WRITE ,
624
+ ret = ctl_query (ctl , ctx , CTL_QUERY_CONFIG_INPUT , path , CTL_QUERY_WRITE ,
625
625
value , strlen (value ) + 1 , empty_args );
626
626
627
627
if (ret != UMF_RESULT_SUCCESS && ctx != NULL ) {
0 commit comments