Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
cb1f2e0c
Commit
cb1f2e0c
authored
Jan 25, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: added config_add_param()
The function config_add_param() allows adding new configuration parameters.
parent
b6c3adca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
conf.c
src/conf.c
+10
-0
conf.h
src/conf.h
+7
-0
No files found.
src/conf.c
View file @
cb1f2e0c
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <glib.h>
#include <glib.h>
#include <assert.h>
#include <string.h>
#include <string.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
...
@@ -349,6 +350,15 @@ void config_read_file(const char *file)
...
@@ -349,6 +350,15 @@ void config_read_file(const char *file)
fclose
(
fp
);
fclose
(
fp
);
}
}
void
config_add_param
(
const
char
*
name
,
struct
config_param
*
param
)
{
struct
config_entry
*
entry
=
config_entry_get
(
name
);
assert
(
entry
!=
NULL
);
entry
->
params
=
g_slist_append
(
entry
->
params
,
param
);
}
struct
config_param
*
struct
config_param
*
config_get_next_param
(
const
char
*
name
,
const
struct
config_param
*
last
)
config_get_next_param
(
const
char
*
name
,
const
struct
config_param
*
last
)
{
{
...
...
src/conf.h
View file @
cb1f2e0c
...
@@ -91,6 +91,13 @@ void config_global_finish(void);
...
@@ -91,6 +91,13 @@ void config_global_finish(void);
void
config_read_file
(
const
char
*
file
);
void
config_read_file
(
const
char
*
file
);
/**
* Adds a new configuration parameter. The name must be registered
* with registerConfigParam().
*/
void
config_add_param
(
const
char
*
name
,
struct
config_param
*
param
);
/* don't free the returned value
/* don't free the returned value
set _last_ to NULL to get first entry */
set _last_ to NULL to get first entry */
struct
config_param
*
struct
config_param
*
...
...
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