Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZhouShuya
OpenXG-RAN
Commits
6c0680db
Commit
6c0680db
authored
Jul 02, 2018
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add config_getlist in config module
parent
a4bc48a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
common/config/config_userapi.c
common/config/config_userapi.c
+31
-0
common/config/config_userapi.h
common/config/config_userapi.h
+1
-1
No files found.
common/config/config_userapi.c
View file @
6c0680db
...
...
@@ -29,6 +29,9 @@
* \note
* \warning
*/
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
...
...
@@ -210,6 +213,34 @@ configmodule_interface_t *cfgif = config_get_if();
return
ret
;
}
int
config_getlist
(
paramlist_def_t
*
ParamList
,
paramdef_t
*
params
,
int
numparams
,
char
*
prefix
)
{
if
(
CONFIG_ISFLAGSET
(
CONFIG_ABORT
))
{
fprintf
(
stderr
,
"[CONFIG] config_get skipped, config module not properly initialized
\n
"
);
return
-
1
;
}
if
(
!
config_get_if
())
return
-
1
;
const
int
ret
=
config_get_if
()
->
getlist
(
ParamList
,
params
,
numparams
,
prefix
);
if
(
ret
>=
0
&&
params
)
{
char
*
newprefix
;
if
(
prefix
)
asprintf
(
&
newprefix
,
"%s.%s"
,
prefix
,
ParamList
->
listname
);
else
newprefix
=
ParamList
->
listname
;
char
cfgpath
[
MAX_OPTNAME_SIZE
*
2
+
6
];
/* prefix.listname.[listindex] */
for
(
int
i
=
0
;
i
<
ParamList
->
numelt
;
++
i
)
{
// TODO config_process_cmdline?
sprintf
(
cfgpath
,
"%s.[%i]"
,
newprefix
,
i
);
config_execcheck
(
ParamList
->
paramarray
[
i
],
numparams
,
cfgpath
);
}
if
(
prefix
)
free
(
newprefix
);
}
return
ret
;
}
int
config_isparamset
(
paramdef_t
*
params
,
int
paramidx
)
{
if
((
params
[
paramidx
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
{
...
...
common/config/config_userapi.h
View file @
6c0680db
...
...
@@ -57,7 +57,7 @@ extern int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr);
/* apis to get parameters, to be used by oai modules, at configuration time */
extern
int
config_get
(
paramdef_t
*
params
,
int
numparams
,
char
*
prefix
);
#define config_getlist config_get_if()->getlist
extern
int
config_getlist
(
paramlist_def_t
*
ParamList
,
paramdef_t
*
params
,
int
numparams
,
char
*
prefix
);
/* apis to retrieve parameters info after calling get or getlist functions */
extern
int
config_isparamset
(
paramdef_t
*
params
,
int
paramidx
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment