Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Worker.N
openairinterface5G
Commits
6c0680db
Commit
6c0680db
authored
6 years ago
by
Robert Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Add config_getlist in config module
parent
a4bc48a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/config/config_userapi.c
+31
-0
31 additions, 0 deletions
common/config/config_userapi.c
common/config/config_userapi.h
+1
-1
1 addition, 1 deletion
common/config/config_userapi.h
with
32 additions
and
1 deletion
common/config/config_userapi.c
+
31
−
0
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
)
{
...
...
This diff is collapsed.
Click to expand it.
common/config/config_userapi.h
+
1
−
1
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
);
#def
in
e
config_getlist
config_get_if()->getlist
extern
in
t
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment