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
4d472c26
Commit
4d472c26
authored
Jan 17, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: no CamelCase, part I
Renamed functions, types, variables.
parent
2bbf378d
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
204 additions
and
170 deletions
+204
-170
audio.c
src/audio.c
+6
-6
audio.h
src/audio.h
+2
-2
client.c
src/client.c
+5
-5
cmdline.c
src/cmdline.c
+4
-4
conf.c
src/conf.c
+61
-51
conf.h
src/conf.h
+27
-16
daemon.c
src/daemon.c
+2
-1
database.c
src/database.c
+1
-1
input_curl.c
src/input_curl.c
+8
-8
listen.c
src/listen.c
+6
-4
log.c
src/log.c
+3
-3
main.c
src/main.c
+7
-5
mapper.c
src/mapper.c
+4
-2
alsa_mixer.c
src/mixer/alsa_mixer.c
+3
-3
oss_mixer.c
src/mixer/oss_mixer.c
+3
-3
mixer_api.c
src/mixer_api.c
+1
-1
mixer_api.h
src/mixer_api.h
+2
-2
alsa_plugin.c
src/output/alsa_plugin.c
+6
-5
ao_plugin.c
src/output/ao_plugin.c
+5
-4
fifo_plugin.c
src/output/fifo_plugin.c
+2
-2
jack_plugin.c
src/output/jack_plugin.c
+2
-2
mvp_plugin.c
src/output/mvp_plugin.c
+1
-1
null_plugin.c
src/output/null_plugin.c
+1
-1
oss_plugin.c
src/output/oss_plugin.c
+6
-5
osx_plugin.c
src/output/osx_plugin.c
+1
-1
pulse_plugin.c
src/output/pulse_plugin.c
+3
-3
shout_plugin.c
src/output/shout_plugin.c
+2
-2
output_api.h
src/output_api.h
+1
-1
output_control.h
src/output_control.h
+2
-1
output_init.c
src/output_init.c
+3
-2
path.c
src/path.c
+2
-1
permission.c
src/permission.c
+4
-4
playerData.c
src/playerData.c
+3
-3
playlist.c
src/playlist.c
+2
-2
replay_gain.c
src/replay_gain.c
+2
-2
state_file.c
src/state_file.c
+1
-1
tag.c
src/tag.c
+2
-2
utils.c
src/utils.c
+1
-1
volume.c
src/volume.c
+5
-5
zeroconf.c
src/zeroconf.c
+2
-2
No files found.
src/audio.c
View file @
4d472c26
...
...
@@ -43,9 +43,9 @@ static unsigned int audioOutputArraySize;
unsigned
int
audio_output_count
(
void
)
{
unsigned
int
nr
=
0
;
ConfigP
aram
*
param
=
NULL
;
struct
config_p
aram
*
param
=
NULL
;
while
((
param
=
getNextConfigP
aram
(
CONF_AUDIO_OUTPUT
,
param
)))
while
((
param
=
config_get_next_p
aram
(
CONF_AUDIO_OUTPUT
,
param
)))
nr
++
;
if
(
!
nr
)
nr
=
1
;
/* we'll always have at least one device */
...
...
@@ -55,7 +55,7 @@ unsigned int audio_output_count(void)
/* make sure initPlayerData is called before this function!! */
void
initAudioDriver
(
void
)
{
ConfigP
aram
*
param
=
NULL
;
struct
config_p
aram
*
param
=
NULL
;
unsigned
int
i
;
notify_init
(
&
audio_output_client_notify
);
...
...
@@ -68,7 +68,7 @@ void initAudioDriver(void)
struct
audio_output
*
output
=
&
audioOutputArray
[
i
];
unsigned
int
j
;
param
=
getNextConfigP
aram
(
CONF_AUDIO_OUTPUT
,
param
);
param
=
config_get_next_p
aram
(
CONF_AUDIO_OUTPUT
,
param
);
/* only allow param to be NULL if there just one audioOutput */
assert
(
param
||
(
audioOutputArraySize
==
1
));
...
...
@@ -106,7 +106,7 @@ void getOutputAudioFormat(const struct audio_format *inAudioFormat,
void
initAudioConfig
(
void
)
{
ConfigParam
*
param
=
getConfigP
aram
(
CONF_AUDIO_OUTPUT_FORMAT
);
struct
config_param
*
param
=
config_get_p
aram
(
CONF_AUDIO_OUTPUT_FORMAT
);
if
(
NULL
==
param
||
NULL
==
param
->
value
)
return
;
...
...
@@ -467,7 +467,7 @@ bool mixer_control_getvol(unsigned int device, int *volume)
return
false
;
}
bool
mixer_configure_legacy
(
char
*
name
,
ConfigP
aram
*
param
)
bool
mixer_configure_legacy
(
char
*
name
,
struct
config_p
aram
*
param
)
{
unsigned
i
;
struct
audio_output
*
output
;
...
...
src/audio.h
View file @
4d472c26
...
...
@@ -21,13 +21,13 @@
#include <stdbool.h>
#include <stdio.h>
#include "conf.h"
#define AUDIO_AO_DRIVER_DEFAULT "default"
struct
audio_format
;
struct
tag
;
struct
client
;
struct
config_param
;
unsigned
int
audio_output_count
(
void
);
...
...
@@ -73,6 +73,6 @@ void saveAudioDevicesState(FILE *fp);
bool
mixer_control_setvol
(
unsigned
int
device
,
int
volume
,
int
rel
);
bool
mixer_control_getvol
(
unsigned
int
device
,
int
*
volume
);
bool
mixer_configure_legacy
(
char
*
name
,
ConfigP
aram
*
param
);
bool
mixer_configure_legacy
(
char
*
name
,
struct
config_p
aram
*
param
);
#endif
src/client.c
View file @
4d472c26
...
...
@@ -554,9 +554,9 @@ client_out_event(G_GNUC_UNUSED GIOChannel *source,
void
client_manager_init
(
void
)
{
char
*
test
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
param
=
getConfigP
aram
(
CONF_CONN_TIMEOUT
);
param
=
config_get_p
aram
(
CONF_CONN_TIMEOUT
);
if
(
param
)
{
client_timeout
=
strtol
(
param
->
value
,
&
test
,
10
);
...
...
@@ -567,7 +567,7 @@ void client_manager_init(void)
}
}
param
=
getConfigP
aram
(
CONF_MAX_CONN
);
param
=
config_get_p
aram
(
CONF_MAX_CONN
);
if
(
param
)
{
client_max_connections
=
strtol
(
param
->
value
,
&
test
,
10
);
...
...
@@ -579,7 +579,7 @@ void client_manager_init(void)
}
else
client_max_connections
=
CLIENT_MAX_CONNECTIONS_DEFAULT
;
param
=
getConfigP
aram
(
CONF_MAX_COMMAND_LIST_SIZE
);
param
=
config_get_p
aram
(
CONF_MAX_COMMAND_LIST_SIZE
);
if
(
param
)
{
long
tmp
=
strtol
(
param
->
value
,
&
test
,
10
);
...
...
@@ -591,7 +591,7 @@ void client_manager_init(void)
client_max_command_list_size
=
tmp
*
1024
;
}
param
=
getConfigP
aram
(
CONF_MAX_OUTPUT_BUFFER_SIZE
);
param
=
config_get_p
aram
(
CONF_MAX_OUTPUT_BUFFER_SIZE
);
if
(
param
)
{
long
tmp
=
strtol
(
param
->
value
,
&
test
,
10
);
...
...
src/cmdline.c
View file @
4d472c26
...
...
@@ -143,17 +143,17 @@ void parseOptions(int argc, char **argv, Options *options)
path2
=
g_build_filename
(
g_get_home_dir
(),
USER_CONFIG_FILE_LOCATION2
,
NULL
);
if
(
g_file_test
(
path1
,
G_FILE_TEST_IS_REGULAR
))
readConf
(
path1
);
config_read_file
(
path1
);
else
if
(
g_file_test
(
path2
,
G_FILE_TEST_IS_REGULAR
))
readConf
(
path2
);
config_read_file
(
path2
);
else
if
(
g_file_test
(
SYSTEM_CONFIG_FILE_LOCATION
,
G_FILE_TEST_IS_REGULAR
))
readConf
(
SYSTEM_CONFIG_FILE_LOCATION
);
config_read_file
(
SYSTEM_CONFIG_FILE_LOCATION
);
g_free
(
path1
);
g_free
(
path2
);
}
else
if
(
argc
==
2
)
{
/* specified configuration file */
readConf
(
argv
[
1
]);
config_read_file
(
argv
[
1
]);
}
else
g_error
(
"too many arguments"
);
}
src/conf.c
View file @
4d472c26
...
...
@@ -37,12 +37,12 @@
#define CONF_BLOCK_MASK 0x02
#define CONF_LINE_TOKEN_MAX 3
typedef
struct
_configE
ntry
{
struct
config_e
ntry
{
const
char
*
name
;
unsigned
char
mask
;
GSList
*
params
;
}
ConfigEntry
;
};
static
GSList
*
config_entries
;
...
...
@@ -63,9 +63,10 @@ static int get_bool(const char *value)
return
CONF_BOOL_INVALID
;
}
ConfigParam
*
newConfigParam
(
const
char
*
value
,
int
line
)
struct
config_param
*
newConfigParam
(
const
char
*
value
,
int
line
)
{
ConfigParam
*
ret
=
g_new
(
ConfigP
aram
,
1
);
struct
config_param
*
ret
=
g_new
(
struct
config_p
aram
,
1
);
if
(
!
value
)
ret
->
value
=
NULL
;
...
...
@@ -74,8 +75,8 @@ ConfigParam *newConfigParam(const char *value, int line)
ret
->
line
=
line
;
ret
->
num
berOfBlockP
arams
=
0
;
ret
->
block
P
arams
=
NULL
;
ret
->
num
_block_p
arams
=
0
;
ret
->
block
_p
arams
=
NULL
;
return
ret
;
}
...
...
@@ -83,26 +84,26 @@ ConfigParam *newConfigParam(const char *value, int line)
void
config_param_free
(
gpointer
data
,
G_GNUC_UNUSED
gpointer
user_data
)
{
ConfigP
aram
*
param
=
data
;
struct
config_p
aram
*
param
=
data
;
int
i
;
g_free
(
param
->
value
);
for
(
i
=
0
;
i
<
param
->
num
berOfBlockP
arams
;
i
++
)
{
g_free
(
param
->
block
P
arams
[
i
].
name
);
g_free
(
param
->
block
P
arams
[
i
].
value
);
for
(
i
=
0
;
i
<
param
->
num
_block_p
arams
;
i
++
)
{
g_free
(
param
->
block
_p
arams
[
i
].
name
);
g_free
(
param
->
block
_p
arams
[
i
].
value
);
}
if
(
param
->
num
berOfBlockP
arams
)
g_free
(
param
->
block
P
arams
);
if
(
param
->
num
_block_p
arams
)
g_free
(
param
->
block
_p
arams
);
g_free
(
param
);
}
static
ConfigE
ntry
*
static
struct
config_e
ntry
*
newConfigEntry
(
const
char
*
name
,
int
repeatable
,
int
block
)
{
ConfigEntry
*
ret
=
g_new
(
ConfigE
ntry
,
1
);
struct
config_entry
*
ret
=
g_new
(
struct
config_e
ntry
,
1
);
ret
->
name
=
name
;
ret
->
mask
=
0
;
...
...
@@ -119,7 +120,7 @@ newConfigEntry(const char *name, int repeatable, int block)
static
void
config_entry_free
(
gpointer
data
,
G_GNUC_UNUSED
gpointer
user_data
)
{
ConfigE
ntry
*
entry
=
data
;
struct
config_e
ntry
*
entry
=
data
;
g_slist_foreach
(
entry
->
params
,
config_param_free
,
NULL
);
g_slist_free
(
entry
->
params
);
...
...
@@ -127,14 +128,14 @@ config_entry_free(gpointer data, G_GNUC_UNUSED gpointer user_data)
g_free
(
entry
);
}
static
ConfigE
ntry
*
static
struct
config_e
ntry
*
config_entry_get
(
const
char
*
name
)
{
GSList
*
list
;
for
(
list
=
config_entries
;
list
!=
NULL
;
list
=
g_slist_next
(
list
))
{
ConfigE
ntry
*
entry
=
list
->
data
;
struct
config_e
ntry
*
entry
=
list
->
data
;
if
(
strcmp
(
entry
->
name
,
name
)
==
0
)
return
entry
;
}
...
...
@@ -144,7 +145,7 @@ config_entry_get(const char *name)
static
void
registerConfigParam
(
const
char
*
name
,
int
repeatable
,
int
block
)
{
ConfigE
ntry
*
entry
;
struct
config_e
ntry
*
entry
;
entry
=
config_entry_get
(
name
);
if
(
entry
!=
NULL
)
...
...
@@ -154,13 +155,13 @@ static void registerConfigParam(const char *name, int repeatable, int block)
config_entries
=
g_slist_prepend
(
config_entries
,
entry
);
}
void
finishConf
(
void
)
void
config_global_finish
(
void
)
{
g_slist_foreach
(
config_entries
,
config_entry_free
,
NULL
);
g_slist_free
(
config_entries
);
}
void
initConf
(
void
)
void
config_global_init
(
void
)
{
config_entries
=
NULL
;
...
...
@@ -209,24 +210,29 @@ void initConf(void)
registerConfigParam
(
CONF_GAPLESS_MP3_PLAYBACK
,
0
,
0
);
}
void
addBlockParam
(
ConfigParam
*
param
,
const
char
*
name
,
const
char
*
value
,
int
line
)
void
addBlockParam
(
struct
config_param
*
param
,
const
char
*
name
,
const
char
*
value
,
int
line
)
{
param
->
numberOfBlockParams
++
;
struct
block_param
*
bp
;
param
->
num_block_params
++
;
param
->
block_params
=
g_realloc
(
param
->
block_params
,
param
->
num_block_params
*
sizeof
(
param
->
block_params
[
0
]));
param
->
blockParams
=
g_realloc
(
param
->
blockParams
,
param
->
numberOfBlockParams
*
sizeof
(
BlockParam
));
bp
=
&
param
->
block_params
[
param
->
num_block_params
-
1
];
param
->
blockParams
[
param
->
numberOfBlockParams
-
1
].
name
=
g_strdup
(
name
);
param
->
blockParams
[
param
->
numberOfBlockParams
-
1
].
value
=
g_strdup
(
value
);
param
->
blockParams
[
param
->
numberOfBlockParams
-
1
].
line
=
line
;
bp
->
name
=
g_strdup
(
name
);
bp
->
value
=
g_strdup
(
value
);
bp
->
line
=
line
;
}
static
ConfigParam
*
readConfigBlock
(
FILE
*
fp
,
int
*
count
,
char
*
string
)
static
struct
config_param
*
config_read_fileigBlock
(
FILE
*
fp
,
int
*
count
,
char
*
string
)
{
ConfigP
aram
*
ret
=
newConfigParam
(
NULL
,
*
count
);
struct
config_p
aram
*
ret
=
newConfigParam
(
NULL
,
*
count
);
int
i
;
int
numberOfArgs
;
...
...
@@ -275,7 +281,7 @@ static ConfigParam *readConfigBlock(FILE * fp, int *count, char *string)
return
ret
;
}
void
readConf
(
const
char
*
file
)
void
config_read_file
(
const
char
*
file
)
{
FILE
*
fp
;
char
string
[
MAX_STRING_SIZE
+
1
];
...
...
@@ -283,8 +289,8 @@ void readConf(const char *file)
int
numberOfArgs
;
int
argsMinusComment
;
int
count
=
0
;
ConfigE
ntry
*
entry
;
ConfigP
aram
*
param
;
struct
config_e
ntry
*
entry
;
struct
config_p
aram
*
param
;
if
(
!
(
fp
=
fopen
(
file
,
"r"
)))
{
g_error
(
"problems opening file %s for reading: %s
\n
"
,
...
...
@@ -332,7 +338,7 @@ void readConf(const char *file)
g_error
(
"improperly formatted config file at "
"line %i: %s
\n
"
,
count
,
string
);
}
param
=
readConf
igBlock
(
fp
,
&
count
,
string
);
param
=
config_read_file
igBlock
(
fp
,
&
count
,
string
);
}
else
param
=
newConfigParam
(
array
[
1
],
count
);
...
...
@@ -341,11 +347,12 @@ void readConf(const char *file)
fclose
(
fp
);
}
ConfigParam
*
getNextConfigParam
(
const
char
*
name
,
ConfigParam
*
last
)
struct
config_param
*
config_get_next_param
(
const
char
*
name
,
struct
config_param
*
last
)
{
ConfigE
ntry
*
entry
;
struct
config_e
ntry
*
entry
;
GSList
*
node
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
entry
=
config_entry_get
(
name
);
if
(
entry
==
NULL
)
...
...
@@ -371,7 +378,7 @@ ConfigParam *getNextConfigParam(const char *name, ConfigParam * last)
char
*
getConfigParamValue
(
const
char
*
name
)
{
ConfigParam
*
param
=
getConfigP
aram
(
name
);
struct
config_param
*
param
=
config_get_p
aram
(
name
);
if
(
!
param
)
return
NULL
;
...
...
@@ -379,28 +386,30 @@ char *getConfigParamValue(const char *name)
return
param
->
value
;
}
BlockParam
*
getBlockParam
(
ConfigParam
*
param
,
const
char
*
name
)
struct
block_param
*
getBlockParam
(
struct
config_param
*
param
,
const
char
*
name
)
{
BlockP
aram
*
ret
=
NULL
;
struct
block_p
aram
*
ret
=
NULL
;
int
i
;
for
(
i
=
0
;
i
<
param
->
num
berOfBlockP
arams
;
i
++
)
{
if
(
0
==
strcmp
(
name
,
param
->
block
P
arams
[
i
].
name
))
{
for
(
i
=
0
;
i
<
param
->
num
_block_p
arams
;
i
++
)
{
if
(
0
==
strcmp
(
name
,
param
->
block
_p
arams
[
i
].
name
))
{
if
(
ret
)
{
g_warning
(
"
\"
%s
\"
first defined on line %i, and "
"redefined on line %i
\n
"
,
name
,
ret
->
line
,
param
->
block
P
arams
[
i
].
line
);
ret
->
line
,
param
->
block
_p
arams
[
i
].
line
);
}
ret
=
param
->
block
P
arams
+
i
;
ret
=
param
->
block
_p
arams
+
i
;
}
}
return
ret
;
}
ConfigParam
*
parseConfigFilePath
(
const
char
*
name
,
int
force
)
struct
config_param
*
parseConfigFilePath
(
const
char
*
name
,
int
force
)
{
ConfigParam
*
param
=
getConfigP
aram
(
name
);
struct
config_param
*
param
=
config_get_p
aram
(
name
);
char
*
path
;
if
(
!
param
&&
force
)
...
...
@@ -423,7 +432,7 @@ ConfigParam *parseConfigFilePath(const char *name, int force)
int
getBoolConfigParam
(
const
char
*
name
,
int
force
)
{
int
ret
;
ConfigParam
*
param
=
getConfigP
aram
(
name
);
struct
config_param
*
param
=
config_get_p
aram
(
name
);
if
(
!
param
)
return
CONF_BOOL_UNSET
;
...
...
@@ -446,10 +455,11 @@ bool config_get_bool(const char *name, bool default_value)
return
value
;
}
int
getBoolBlockParam
(
ConfigParam
*
param
,
const
char
*
name
,
int
force
)
int
getBoolBlockParam
(
struct
config_param
*
param
,
const
char
*
name
,
int
force
)
{
int
ret
;
BlockP
aram
*
bp
=
getBlockParam
(
param
,
name
);
struct
block_p
aram
*
bp
=
getBlockParam
(
param
,
name
);
if
(
!
bp
)
return
CONF_BOOL_UNSET
;
...
...
src/conf.h
View file @
4d472c26
...
...
@@ -68,46 +68,57 @@
#define CONF_BOOL_UNSET -1
#define CONF_BOOL_INVALID -2
typedef
struct
_BlockP
aram
{
struct
block_p
aram
{
char
*
name
;
char
*
value
;
int
line
;
}
BlockParam
;
};
typedef
struct
_ConfigP
aram
{
struct
config_p
aram
{
char
*
value
;
unsigned
int
line
;
BlockParam
*
blockParams
;
int
numberOfBlockParams
;
}
ConfigParam
;
void
initConf
(
void
);
void
finishConf
(
void
);
struct
block_param
*
block_params
;
int
num_block_params
;
};
void
readConf
(
const
char
*
file
);
void
config_global_init
(
void
);
void
config_global_finish
(
void
);
void
config_read_file
(
const
char
*
file
);
/* don't free the returned value
set _last_ to NULL to get first entry */
ConfigParam
*
getNextConfigParam
(
const
char
*
name
,
ConfigParam
*
last
);
struct
config_param
*
config_get_next_param
(
const
char
*
name
,
struct
config_param
*
last
);
#define getConfigParam(name) getNextConfigParam(name, NULL)
static
inline
struct
config_param
*
config_get_param
(
const
char
*
name
)
{
return
config_get_next_param
(
name
,
NULL
);
}
char
*
getConfigParamValue
(
const
char
*
name
);
BlockParam
*
getBlockParam
(
ConfigParam
*
param
,
const
char
*
name
);
struct
block_param
*
getBlockParam
(
struct
config_param
*
param
,
const
char
*
name
);
ConfigParam
*
parseConfigFilePath
(
const
char
*
name
,
int
force
);
struct
config_param
*
parseConfigFilePath
(
const
char
*
name
,
int
force
);
int
getBoolConfigParam
(
const
char
*
name
,
int
force
);
bool
config_get_bool
(
const
char
*
name
,
bool
default_value
);
int
getBoolBlockParam
(
ConfigParam
*
param
,
const
char
*
name
,
int
force
);
int
getBoolBlockParam
(
struct
config_param
*
param
,
const
char
*
name
,
int
force
);
ConfigParam
*
newConfigParam
(
const
char
*
value
,
int
line
);
struct
config_param
*
newConfigParam
(
const
char
*
value
,
int
line
);
void
config_param_free
(
gpointer
data
,
gpointer
user_data
);
void
addBlockParam
(
ConfigParam
*
param
,
const
char
*
name
,
const
char
*
value
,
int
line
);
void
addBlockParam
(
struct
config_param
*
param
,
const
char
*
name
,
const
char
*
value
,
int
line
);
#endif
src/daemon.c
View file @
4d472c26
...
...
@@ -46,7 +46,8 @@ daemonize(Options *options)
{
#ifndef WIN32
FILE
*
fp
=
NULL
;
ConfigParam
*
pidFileParam
=
parseConfigFilePath
(
CONF_PID_FILE
,
0
);
struct
config_param
*
pidFileParam
=
parseConfigFilePath
(
CONF_PID_FILE
,
0
);
if
(
pidFileParam
)
{
/* do this before daemon'izing so we can fail gracefully if we can't
...
...
src/database.c
View file @
4d472c26
...
...
@@ -123,7 +123,7 @@ db_walk(const char *name,
static
char
*
db_get_file
(
void
)
{
ConfigP
aram
*
param
=
parseConfigFilePath
(
CONF_DB_FILE
,
1
);
struct
config_p
aram
*
param
=
parseConfigFilePath
(
CONF_DB_FILE
,
1
);
assert
(
param
);
assert
(
param
->
value
);
...
...
src/input_curl.c
View file @
4d472c26
...
...
@@ -630,10 +630,10 @@ input_curl_easy_init(struct input_stream *is)
struct
input_curl
*
c
=
is
->
data
;
CURLcode
code
;
CURLMcode
mcode
;
ConfigP
aram
*
proxy_host
;
ConfigP
aram
*
proxy_port
;
ConfigP
aram
*
proxy_user
;
ConfigP
aram
*
proxy_pass
;
struct
config_p
aram
*
proxy_host
;
struct
config_p
aram
*
proxy_port
;
struct
config_p
aram
*
proxy_user
;
struct
config_p
aram
*
proxy_pass
;
c
->
eof
=
false
;
...
...
@@ -661,10 +661,10 @@ input_curl_easy_init(struct input_stream *is)
curl_easy_setopt
(
c
->
easy
,
CURLOPT_FAILONERROR
,
true
);
curl_easy_setopt
(
c
->
easy
,
CURLOPT_ERRORBUFFER
,
c
->
error
);
proxy_host
=
getConfigP
aram
(
CONF_HTTP_PROXY_HOST
);
proxy_port
=
getConfigP
aram
(
CONF_HTTP_PROXY_PORT
);
proxy_user
=
getConfigP
aram
(
CONF_HTTP_PROXY_USER
);
proxy_pass
=
getConfigP
aram
(
CONF_HTTP_PROXY_PASSWORD
);
proxy_host
=
config_get_p
aram
(
CONF_HTTP_PROXY_HOST
);
proxy_port
=
config_get_p
aram
(
CONF_HTTP_PROXY_PORT
);
proxy_user
=
config_get_p
aram
(
CONF_HTTP_PROXY_USER
);
proxy_pass
=
config_get_p
aram
(
CONF_HTTP_PROXY_PASSWORD
);
if
(
proxy_host
!=
NULL
)
{
char
*
proxy_host_str
;
...
...
src/listen.c
View file @
4d472c26
...
...
@@ -127,7 +127,8 @@ static bool ipv6Supported(void)
#endif
static
void
parseListenConfigParam
(
G_GNUC_UNUSED
unsigned
int
port
,
ConfigParam
*
param
)
parseListenConfigParam
(
G_GNUC_UNUSED
unsigned
int
port
,
struct
config_param
*
param
)
{
const
struct
sockaddr
*
addrp
;
socklen_t
addrlen
;
...
...
@@ -253,8 +254,9 @@ parseListenConfigParam(G_GNUC_UNUSED unsigned int port, ConfigParam * param)
void
listenOnPort
(
void
)
{
int
port
=
DEFAULT_PORT
;
ConfigParam
*
param
=
getNextConfigParam
(
CONF_BIND_TO_ADDRESS
,
NULL
);
ConfigParam
*
portParam
=
getConfigParam
(
CONF_PORT
);
struct
config_param
*
param
=
config_get_next_param
(
CONF_BIND_TO_ADDRESS
,
NULL
);
struct
config_param
*
portParam
=
config_get_param
(
CONF_PORT
);
if
(
portParam
)
{
char
*
test
;
...
...
@@ -271,7 +273,7 @@ void listenOnPort(void)
do
{
parseListenConfigParam
(
port
,
param
);
}
while
((
param
=
getNextConfigP
aram
(
CONF_BIND_TO_ADDRESS
,
param
)));
}
while
((
param
=
config_get_next_p
aram
(
CONF_BIND_TO_ADDRESS
,
param
)));
}
void
closeAllListenSockets
(
void
)
...
...
src/log.c
View file @
4d472c26
...
...
@@ -219,19 +219,19 @@ parse_log_level(const char *value, unsigned line)
void
log_init
(
bool
verbose
,
bool
use_stdout
)
{
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
g_get_charset
(
&
log_charset
);
if
(
verbose
)
log_threshold
=
G_LOG_LEVEL_DEBUG
;
else
if
((
param
=
getConfigP
aram
(
CONF_LOG_LEVEL
))
!=
NULL
)
else
if
((
param
=
config_get_p
aram
(
CONF_LOG_LEVEL
))
!=
NULL
)
log_threshold
=
parse_log_level
(
param
->
value
,
param
->
line
);
if
(
use_stdout
)
{
log_init_stdout
();
}
else
{
param
=
getConfigP
aram
(
CONF_LOG_FILE
);
param
=
config_get_p
aram
(
CONF_LOG_FILE
);
if
(
param
==
NULL
)
{
#ifdef HAVE_SYSLOG
/* no configuration: default to syslog (if
...
...
src/main.c
View file @
4d472c26
...
...
@@ -84,7 +84,7 @@ struct notify main_notify;
static
void
changeToUser
(
void
)
{
#ifndef WIN32
ConfigParam
*
param
=
getConfigP
aram
(
CONF_USER
);
struct
config_param
*
param
=
config_get_p
aram
(
CONF_USER
);
if
(
param
&&
strlen
(
param
->
value
))
{
/* get uid */
...
...
@@ -150,7 +150,8 @@ static void openDB(Options * options, char *argv0)
static
void
cleanUpPidFile
(
void
)
{
ConfigParam
*
pidFileParam
=
parseConfigFilePath
(
CONF_PID_FILE
,
0
);
struct
config_param
*
pidFileParam
=
parseConfigFilePath
(
CONF_PID_FILE
,
0
);
if
(
!
pidFileParam
)
return
;
...
...
@@ -164,7 +165,8 @@ static void killFromPidFile(void)
{
#ifndef WIN32
FILE
*
fp
;
ConfigParam
*
pidFileParam
=
parseConfigFilePath
(
CONF_PID_FILE
,
0
);
struct
config_param
*
pidFileParam
=
parseConfigFilePath
(
CONF_PID_FILE
,
0
);
int
pid
;
if
(
!
pidFileParam
)
{
...
...
@@ -234,7 +236,7 @@ int main(int argc, char *argv[])
dirvec_init
();
songvec_init
();
tag_pool_init
();
initConf
();
config_global_init
();
parseOptions
(
argc
,
argv
,
&
options
);
...
...
@@ -343,7 +345,7 @@ int main(int argc, char *argv[])
#endif
music_pipe_free
();
cleanUpPidFile
();
finishConf
();
config_global_finish
();
tag_pool_deinit
();
songvec_deinit
();
dirvec_deinit
();
...
...
src/mapper.c
View file @
4d472c26
...
...
@@ -43,8 +43,10 @@ static size_t playlist_dir_length;
void
mapper_init
(
void
)
{
ConfigParam
*
music_dir_param
=
parseConfigFilePath
(
CONF_MUSIC_DIR
,
false
);
ConfigParam
*
playlist_dir_param
=
parseConfigFilePath
(
CONF_PLAYLIST_DIR
,
1
);
struct
config_param
*
music_dir_param
=
parseConfigFilePath
(
CONF_MUSIC_DIR
,
false
);
struct
config_param
*
playlist_dir_param
=
parseConfigFilePath
(
CONF_PLAYLIST_DIR
,
1
);
int
ret
;
struct
stat
st
;
...
...
src/mixer/alsa_mixer.c
View file @
4d472c26
...
...
@@ -44,10 +44,10 @@ alsa_mixer_finish(struct mixer_data *data)
}
static
void
alsa_mixer_configure
(
struct
mixer_data
*
data
,
ConfigP
aram
*
param
)
alsa_mixer_configure
(
struct
mixer_data
*
data
,
struct
config_p
aram
*
param
)
{
struct
alsa_mixer
*
am
=
(
struct
alsa_mixer
*
)
data
;
BlockP
aram
*
bp
;
struct
block_p
aram
*
bp
;
if
(
param
==
NULL
)
return
;
...
...
@@ -149,7 +149,7 @@ alsa_mixer_control(struct mixer_data *data, int cmd, void *arg)
struct
alsa_mixer
*
am
=
(
struct
alsa_mixer
*
)
data
;
switch
(
cmd
)
{
case
AC_MIXER_CONFIGURE
:
alsa_mixer_configure
(
data
,
(
ConfigP
aram
*
)
arg
);
alsa_mixer_configure
(
data
,
(
struct
config_p
aram
*
)
arg
);
if
(
am
->
handle
)
alsa_mixer_close
(
data
);
return
true
;
...
...
src/mixer/oss_mixer.c
View file @
4d472c26
...
...
@@ -48,10 +48,10 @@ oss_mixer_finish(struct mixer_data *data)
}
static
void
oss_mixer_configure
(
struct
mixer_data
*
data
,
ConfigP
aram
*
param
)
oss_mixer_configure
(
struct
mixer_data
*
data
,
struct
config_p
aram
*
param
)
{
struct
oss_mixer
*
om
=
(
struct
oss_mixer
*
)
data
;
BlockP
aram
*
bp
;
struct
block_p
aram
*
bp
;
if
(
param
==
NULL
)
return
;
...
...
@@ -142,7 +142,7 @@ oss_mixer_control(struct mixer_data *data, int cmd, void *arg)
struct
oss_mixer
*
om
=
(
struct
oss_mixer
*
)
data
;
switch
(
cmd
)
{
case
AC_MIXER_CONFIGURE
:
oss_mixer_configure
(
data
,
(
ConfigP
aram
*
)
arg
);
oss_mixer_configure
(
data
,
(
struct
config_p
aram
*
)
arg
);
if
(
om
->
device_fd
>=
0
)
oss_mixer_close
(
data
);
return
true
;
...
...
src/mixer_api.c
View file @
4d472c26
...
...
@@ -20,7 +20,7 @@ void mixer_finish(struct mixer *mixer)
mixer
->
plugin
=
NULL
;
}
void
mixer_configure
(
struct
mixer
*
mixer
,
ConfigP
aram
*
param
)
void
mixer_configure
(
struct
mixer
*
mixer
,
struct
config_p
aram
*
param
)
{
assert
(
mixer
!=
NULL
&&
mixer
->
plugin
!=
NULL
);
mixer
->
plugin
->
configure
(
mixer
->
data
,
param
);
...
...
src/mixer_api.h
View file @
4d472c26
...
...
@@ -28,7 +28,7 @@ struct mixer_plugin {
/**
* Setup and configure mixer
*/
void
(
*
configure
)(
struct
mixer_data
*
data
,
ConfigP
aram
*
param
);
void
(
*
configure
)(
struct
mixer_data
*
data
,
struct
config_p
aram
*
param
);
/**
* Open mixer device
...
...
@@ -53,7 +53,7 @@ struct mixer {
void
mixer_init
(
struct
mixer
*
mixer
,
struct
mixer_plugin
*
plugin
);
void
mixer_finish
(
struct
mixer
*
mixer
);
void
mixer_configure
(
struct
mixer
*
mixer
,
ConfigP
aram
*
param
);
void
mixer_configure
(
struct
mixer
*
mixer
,
struct
config_p
aram
*
param
);
bool
mixer_open
(
struct
mixer
*
mixer
);
bool
mixer_control
(
struct
mixer
*
mixer
,
int
cmd
,
void
*
arg
);
void
mixer_close
(
struct
mixer
*
mixer
);
...
...
src/output/alsa_plugin.c
View file @
4d472c26
...
...
@@ -88,9 +88,9 @@ static void freeAlsaData(AlsaData * ad)
}
static
void
alsa_configure
(
AlsaData
*
ad
,
ConfigP
aram
*
param
)
alsa_configure
(
AlsaData
*
ad
,
struct
config_p
aram
*
param
)
{
BlockP
aram
*
bp
;
struct
block_p
aram
*
bp
;
if
((
bp
=
getBlockParam
(
param
,
"device"
)))
ad
->
device
=
g_strdup
(
bp
->
value
);
...
...
@@ -119,9 +119,10 @@ alsa_configure(AlsaData *ad, ConfigParam *param)
#endif
}
static
void
*
alsa_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
ConfigParam
*
param
)
static
void
*
alsa_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
struct
config_param
*
param
)
{
/* no need for pthread_once thread-safety when reading config */
static
int
free_global_registered
;
...
...
src/output/ao_plugin.c
View file @
4d472c26
...
...
@@ -74,14 +74,15 @@ static void audioOutputAo_error(const char *msg)
g_warning
(
"%s: %s
\n
"
,
msg
,
error
);
}
static
void
*
audioOutputAo_initDriver
(
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
ConfigParam
*
param
)
static
void
*
audioOutputAo_initDriver
(
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
struct
config_param
*
param
)
{
ao_info
*
ai
;
char
*
test
;
AoData
*
ad
=
newAoData
();
BlockP
aram
*
blockParam
;
struct
block_p
aram
*
blockParam
;
if
((
blockParam
=
getBlockParam
(
param
,
"write_size"
)))
{
ad
->
writeSize
=
strtol
(
blockParam
->
value
,
&
test
,
10
);
...
...
src/output/fifo_plugin.c
View file @
4d472c26
...
...
@@ -161,10 +161,10 @@ static bool openFifo(FifoData *fd)
static
void
*
fifo_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
ConfigP
aram
*
param
)
struct
config_p
aram
*
param
)
{
FifoData
*
fd
;
BlockP
aram
*
blockParam
;
struct
block_p
aram
*
blockParam
;
char
*
path
;
blockParam
=
getBlockParam
(
param
,
"path"
);
...
...
src/output/jack_plugin.c
View file @
4d472c26
...
...
@@ -186,10 +186,10 @@ mpd_jack_error(const char *msg)
static
void
*
mpd_jack_init
(
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
ConfigP
aram
*
param
)
struct
config_p
aram
*
param
)
{
struct
jack_data
*
jd
;
BlockP
aram
*
bp
;
struct
block_p
aram
*
bp
;
char
*
endptr
;
int
val
;
char
*
cp
=
NULL
;
...
...
src/output/mvp_plugin.c
View file @
4d472c26
...
...
@@ -112,7 +112,7 @@ static bool mvp_testDefault(void)
static
void
*
mvp_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audio_output
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
ConfigP
aram
*
param
)
G_GNUC_UNUSED
struct
config_p
aram
*
param
)
{
MvpData
*
md
=
g_new
(
MvpData
,
1
);
md
->
audio_output
=
audio_output
;
...
...
src/output/null_plugin.c
View file @
4d472c26
...
...
@@ -28,7 +28,7 @@ struct null_data {
static
void
*
null_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audioOutput
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
ConfigP
aram
*
param
)
G_GNUC_UNUSED
struct
config_p
aram
*
param
)
{
struct
null_data
*
nd
=
g_new
(
struct
null_data
,
1
);
nd
->
timer
=
NULL
;
...
...
src/output/oss_plugin.c
View file @
4d472c26
...
...
@@ -344,7 +344,7 @@ static bool oss_testDefault(void)
return
false
;
}
static
void
*
oss_open_default
(
ConfigP
aram
*
param
)
static
void
*
oss_open_default
(
struct
config_p
aram
*
param
)
{
int
i
;
int
err
[
G_N_ELEMENTS
(
default_devices
)];
...
...
@@ -387,12 +387,13 @@ static void *oss_open_default(ConfigParam *param)
return
NULL
;
/* some compilers can be dumb... */
}
static
void
*
oss_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audioOutput
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
ConfigParam
*
param
)
static
void
*
oss_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audioOutput
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
struct
config_param
*
param
)
{
if
(
param
)
{
BlockP
aram
*
bp
=
getBlockParam
(
param
,
"device"
);
struct
block_p
aram
*
bp
=
getBlockParam
(
param
,
"device"
);
if
(
bp
)
{
OssData
*
od
=
newOssData
();
od
->
device
=
bp
->
value
;
...
...
src/output/osx_plugin.c
View file @
4d472c26
...
...
@@ -83,7 +83,7 @@ static bool osx_testDefault(void)
static
void
*
osx_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audioOutput
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
ConfigParam
*
param
)
G_GNUC_UNUSED
struct
config_param
*
param
)
{
return
newOsxData
();
}
...
...
src/output/pulse_plugin.c
View file @
4d472c26
...
...
@@ -55,10 +55,10 @@ static void pulse_free_data(struct pulse_data *pd)
static
void
*
pulse_init
(
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
ConfigP
aram
*
param
)
struct
config_p
aram
*
param
)
{
BlockP
aram
*
server
=
NULL
;
BlockP
aram
*
sink
=
NULL
;
struct
block_p
aram
*
server
=
NULL
;
struct
block_p
aram
*
sink
=
NULL
;
struct
pulse_data
*
pd
;
if
(
param
)
{
...
...
src/output/shout_plugin.c
View file @
4d472c26
...
...
@@ -94,7 +94,7 @@ static void free_shout_data(struct shout_data *sd)
static
void
*
my_shout_init_driver
(
struct
audio_output
*
audio_output
,
const
struct
audio_format
*
audio_format
,
ConfigP
aram
*
param
)
struct
config_p
aram
*
param
)
{
struct
shout_data
*
sd
;
char
*
test
;
...
...
@@ -106,7 +106,7 @@ static void *my_shout_init_driver(struct audio_output *audio_output,
unsigned
protocol
;
const
char
*
user
;
char
*
name
;
BlockP
aram
*
block_param
;
struct
block_p
aram
*
block_param
;
int
public
;
sd
=
new_shout_data
();
...
...
src/output_api.h
View file @
4d472c26
...
...
@@ -60,7 +60,7 @@ struct audio_output_plugin {
*/
void
*
(
*
init
)(
struct
audio_output
*
ao
,
const
struct
audio_format
*
audio_format
,
ConfigP
aram
*
param
);
struct
config_p
aram
*
param
);
/**
* Free resources allocated by this device.
...
...
src/output_control.h
View file @
4d472c26
...
...
@@ -29,7 +29,8 @@ struct audio_output_plugin;
struct
audio_format
;
struct
tag
;
int
audio_output_init
(
struct
audio_output
*
,
ConfigParam
*
param
);
int
audio_output_init
(
struct
audio_output
*
,
struct
config_param
*
param
);
bool
audio_output_open
(
struct
audio_output
*
audioOutput
,
...
...
src/output_init.c
View file @
4d472c26
...
...
@@ -38,11 +38,12 @@
if(bp) str = bp->value; \
}
int
audio_output_init
(
struct
audio_output
*
ao
,
ConfigParam
*
param
)
int
audio_output_init
(
struct
audio_output
*
ao
,
struct
config_param
*
param
)
{
const
char
*
name
=
NULL
;
char
*
format
=
NULL
;
BlockP
aram
*
bp
=
NULL
;
struct
block_p
aram
*
bp
=
NULL
;
const
struct
audio_output_plugin
*
plugin
=
NULL
;
if
(
param
)
{
...
...
src/path.c
View file @
4d472c26
...
...
@@ -66,7 +66,8 @@ const char *path_get_fs_charset(void)
void
path_global_init
(
void
)
{
ConfigParam
*
fs_charset_param
=
getConfigParam
(
CONF_FS_CHARSET
);
struct
config_param
*
fs_charset_param
=
config_get_param
(
CONF_FS_CHARSET
);
const
char
*
charset
=
NULL
;
if
(
fs_charset_param
)
{
...
...
src/permission.c
View file @
4d472c26
...
...
@@ -71,7 +71,7 @@ void initPermissions(void)
{
char
*
password
;
unsigned
permission
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
permission_passwords
=
g_hash_table_new_full
(
g_str_hash
,
g_str_equal
,
g_free
,
NULL
);
...
...
@@ -79,7 +79,7 @@ void initPermissions(void)
permission_default
=
PERMISSION_READ
|
PERMISSION_ADD
|
PERMISSION_CONTROL
|
PERMISSION_ADMIN
;
param
=
getNextConfigP
aram
(
CONF_PASSWORD
,
NULL
);
param
=
config_get_next_p
aram
(
CONF_PASSWORD
,
NULL
);
if
(
param
)
{
permission_default
=
0
;
...
...
@@ -102,10 +102,10 @@ void initPermissions(void)
g_hash_table_replace
(
permission_passwords
,
password
,
GINT_TO_POINTER
(
permission
));
}
while
((
param
=
getNextConfigP
aram
(
CONF_PASSWORD
,
param
)));
}
while
((
param
=
config_get_next_p
aram
(
CONF_PASSWORD
,
param
)));
}
param
=
getConfigP
aram
(
CONF_DEFAULT_PERMS
);
param
=
config_get_p
aram
(
CONF_DEFAULT_PERMS
);
if
(
param
)
permission_default
=
parsePermissions
(
param
->
value
);
...
...
src/playerData.c
View file @
4d472c26
...
...
@@ -34,9 +34,9 @@ void initPlayerData(void)
float
perc
=
DEFAULT_BUFFER_BEFORE_PLAY
;
char
*
test
;
size_t
bufferSize
=
DEFAULT_BUFFER_SIZE
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
param
=
getConfigP
aram
(
CONF_AUDIO_BUFFER_SIZE
);
param
=
config_get_p
aram
(
CONF_AUDIO_BUFFER_SIZE
);
if
(
param
)
{
bufferSize
=
strtol
(
param
->
value
,
&
test
,
10
);
...
...
@@ -54,7 +54,7 @@ void initPlayerData(void)
FATAL
(
"buffer size
\"
%li
\"
is too big
\n
"
,
(
long
)
bufferSize
);
}
param
=
getConfigP
aram
(
CONF_BUFFER_BEFORE_PLAY
);
param
=
config_get_p
aram
(
CONF_BUFFER_BEFORE_PLAY
);
if
(
param
)
{
perc
=
strtod
(
param
->
value
,
&
test
);
...
...
src/playlist.c
View file @
4d472c26
...
...
@@ -120,7 +120,7 @@ static void incrPlaylistCurrent(void)
void
initPlaylist
(
void
)
{
char
*
test
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
int
value
;
g_rand
=
g_rand_new
();
...
...
@@ -132,7 +132,7 @@ void initPlaylist(void)
playlist
.
queued
=
-
1
;
playlist
.
current
=
-
1
;
param
=
getConfigP
aram
(
CONF_MAX_PLAYLIST_LENGTH
);
param
=
config_get_p
aram
(
CONF_MAX_PLAYLIST_LENGTH
);
if
(
param
)
{
playlist_max_length
=
strtol
(
param
->
value
,
&
test
,
10
);
...
...
src/replay_gain.c
View file @
4d472c26
...
...
@@ -38,7 +38,7 @@ static float replay_gain_preamp = 1.0;
void
replay_gain_global_init
(
void
)
{
ConfigParam
*
param
=
getConfigP
aram
(
CONF_REPLAYGAIN
);
struct
config_param
*
param
=
config_get_p
aram
(
CONF_REPLAYGAIN
);
if
(
!
param
)
return
;
...
...
@@ -52,7 +52,7 @@ void replay_gain_global_init(void)
param
->
value
,
param
->
line
);
}
param
=
getConfigP
aram
(
CONF_REPLAYGAIN_PREAMP
);
param
=
config_get_p
aram
(
CONF_REPLAYGAIN_PREAMP
);
if
(
param
)
{
char
*
test
;
...
...
src/state_file.c
View file @
4d472c26
...
...
@@ -43,7 +43,7 @@ static const char *sfpath;
static
void
get_state_file_path
(
void
)
{
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
if
(
sfpath
)
return
;
param
=
parseConfigFilePath
(
CONF_STATE_FILE
,
0
);
...
...
src/tag.c
View file @
4d472c26
...
...
@@ -69,7 +69,7 @@ void tag_lib_init(void)
char
*
temp
;
char
*
s
;
char
*
c
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
int
i
;
/* parse the "metadata_to_use" config parameter below */
...
...
@@ -77,7 +77,7 @@ void tag_lib_init(void)
memset
(
ignoreTagItems
,
0
,
TAG_NUM_OF_ITEM_TYPES
);
ignoreTagItems
[
TAG_ITEM_COMMENT
]
=
1
;
/* ignore comments by default */
param
=
getConfigP
aram
(
CONF_METADATA_TO_USE
);
param
=
config_get_p
aram
(
CONF_METADATA_TO_USE
);
if
(
!
param
)
return
;
...
...
src/utils.c
View file @
4d472c26
...
...
@@ -65,7 +65,7 @@ char *parsePath(char *path)
const
char
*
home
;
if
(
path
[
1
]
==
'/'
||
path
[
1
]
==
'\0'
)
{
ConfigParam
*
param
=
getConfigP
aram
(
CONF_USER
);
struct
config_param
*
param
=
config_get_p
aram
(
CONF_USER
);
if
(
param
&&
param
->
value
)
{
struct
passwd
*
passwd
=
getpwnam
(
param
->
value
);
if
(
!
passwd
)
{
...
...
src/volume.c
View file @
4d472c26
...
...
@@ -50,22 +50,22 @@ void volume_finish(void)
static
void
mixer_reconfigure
(
char
*
driver
)
{
ConfigP
aram
*
newparam
,
*
param
;
struct
config_p
aram
*
newparam
,
*
param
;
//create parameter list
newparam
=
newConfigParam
(
NULL
,
-
1
);
param
=
getConfigP
aram
(
CONF_MIXER_DEVICE
);
param
=
config_get_p
aram
(
CONF_MIXER_DEVICE
);
if
(
param
)
{
g_warning
(
"deprecated option mixer_device found, translating to %s config section
\n
"
,
driver
);
addBlockParam
(
newparam
,
"mixer_device"
,
param
->
value
,
-
1
);
}
param
=
getConfigP
aram
(
CONF_MIXER_CONTROL
);
param
=
config_get_p
aram
(
CONF_MIXER_CONTROL
);
if
(
param
)
{
g_warning
(
"deprecated option mixer_control found, translating to %s config section
\n
"
,
driver
);
addBlockParam
(
newparam
,
"mixer_control"
,
param
->
value
,
-
1
);
}
if
(
newparam
->
num
berOfBlockP
arams
>
0
)
{
if
(
newparam
->
num
_block_p
arams
>
0
)
{
//call configure method of corrensponding mixer
if
(
!
mixer_configure_legacy
(
driver
,
newparam
))
{
g_error
(
"Using mixer_type '%s' with not enabled %s output"
,
driver
,
driver
);
...
...
@@ -77,7 +77,7 @@ mixer_reconfigure(char *driver)
void
volume_init
(
void
)
{
ConfigParam
*
param
=
getConfigP
aram
(
CONF_MIXER_TYPE
);
struct
config_param
*
param
=
config_get_p
aram
(
CONF_MIXER_TYPE
);
//hw mixing is by default
if
(
param
)
{
if
(
strcmp
(
param
->
value
,
VOLUME_MIXER_SOFTWARE
)
==
0
)
{
...
...
src/zeroconf.c
View file @
4d472c26
...
...
@@ -35,7 +35,7 @@ static int zeroconfEnabled;
void
initZeroconf
(
void
)
{
const
char
*
serviceName
=
SERVICE_NAME
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
zeroconfEnabled
=
getBoolConfigParam
(
CONF_ZEROCONF_ENABLED
,
1
);
if
(
zeroconfEnabled
==
CONF_BOOL_UNSET
)
...
...
@@ -44,7 +44,7 @@ void initZeroconf(void)
if
(
!
zeroconfEnabled
)
return
;
param
=
getConfigP
aram
(
CONF_ZEROCONF_NAME
);
param
=
config_get_p
aram
(
CONF_ZEROCONF_NAME
);
if
(
param
&&
*
param
->
value
!=
0
)
serviceName
=
param
->
value
;
...
...
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