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
637c6a18
Commit
637c6a18
authored
Jun 19, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: log unused/unknown block parameters
parent
0cbc4012
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
0 deletions
+38
-0
NEWS
NEWS
+1
-0
conf.c
src/conf.c
+29
-0
conf.h
src/conf.h
+6
-0
main.c
src/main.c
+2
-0
No files found.
NEWS
View file @
637c6a18
...
...
@@ -3,6 +3,7 @@ ver 0.16 (20??/??/??)
- removed support for legacy mixer configuration
* commands:
- added new "status" line with more precise "elapsed time"
* log unused/unknown block parameters
ver 0.15 (2009/06/23)
...
...
src/conf.c
View file @
637c6a18
...
...
@@ -188,6 +188,35 @@ void config_global_init(void)
{
}
static
void
config_param_check
(
gpointer
data
,
G_GNUC_UNUSED
gpointer
user_data
)
{
struct
config_param
*
param
=
data
;
if
(
!
param
->
used
)
/* this whole config_param was not queried at all -
the feature might be disabled at compile time?
Silently ignore it here. */
return
;
for
(
unsigned
i
=
0
;
i
<
param
->
num_block_params
;
i
++
)
{
struct
block_param
*
bp
=
&
param
->
block_params
[
i
];
if
(
!
bp
->
used
)
g_warning
(
"option '%s' on line %i was not recognized"
,
bp
->
name
,
bp
->
line
);
}
}
void
config_global_check
(
void
)
{
for
(
unsigned
i
=
0
;
i
<
G_N_ELEMENTS
(
config_entries
);
++
i
)
{
struct
config_entry
*
entry
=
&
config_entries
[
i
];
g_slist_foreach
(
entry
->
params
,
config_param_check
,
NULL
);
}
}
void
config_add_block_param
(
struct
config_param
*
param
,
const
char
*
name
,
const
char
*
value
,
int
line
)
...
...
src/conf.h
View file @
637c6a18
...
...
@@ -100,6 +100,12 @@ struct config_param {
void
config_global_init
(
void
);
void
config_global_finish
(
void
);
/**
* Call this function after all configuration has been evaluated. It
* checks for unused parameters, and logs warnings.
*/
void
config_global_check
(
void
);
void
config_read_file
(
const
char
*
file
);
/* don't free the returned value
...
...
src/main.c
View file @
637c6a18
...
...
@@ -322,6 +322,8 @@ int main(int argc, char *argv[])
state_file_init
(
config_get_path
(
CONF_STATE_FILE
));
config_global_check
();
/* run the main loop */
g_main_loop_run
(
main_loop
);
...
...
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