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
62f9df98
Commit
62f9df98
authored
Jul 15, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmdline: no CamelCase
Renamed type, variables and functions.
parent
c76f71e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
cmdline.c
src/cmdline.c
+6
-6
cmdline.h
src/cmdline.h
+5
-5
main.c
src/main.c
+7
-7
No files found.
src/cmdline.c
View file @
62f9df98
...
...
@@ -77,7 +77,7 @@ static const char *summary =
"Music Player Daemon - a daemon for playing music."
;
#endif
void
parse
Options
(
int
argc
,
char
**
argv
,
O
ptions
*
options
)
void
parse
_cmdline
(
int
argc
,
char
**
argv
,
struct
o
ptions
*
options
)
{
GError
*
error
=
NULL
;
GOptionContext
*
context
;
...
...
@@ -96,7 +96,7 @@ void parseOptions(int argc, char **argv, Options *options)
"don't create database, even if it doesn't exist"
,
NULL
},
{
"no-daemon"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
option_no_daemon
,
"don't detach from console"
,
NULL
},
{
"stdout"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
options
->
std
Output
,
{
"stdout"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
options
->
std
err
,
"print messages to stderr"
,
NULL
},
{
"verbose"
,
'v'
,
0
,
G_OPTION_ARG_NONE
,
&
options
->
verbose
,
"verbose logging"
,
NULL
},
...
...
@@ -107,9 +107,9 @@ void parseOptions(int argc, char **argv, Options *options)
options
->
kill
=
false
;
options
->
daemon
=
true
;
options
->
std
Output
=
false
;
options
->
std
err
=
false
;
options
->
verbose
=
false
;
options
->
create
DB
=
0
;
options
->
create
_db
=
0
;
context
=
g_option_context_new
(
"[path/to/mpd.conf]"
);
g_option_context_add_main_entries
(
context
,
entries
,
NULL
);
...
...
@@ -137,9 +137,9 @@ void parseOptions(int argc, char **argv, Options *options)
g_error
(
"Cannot use both --create-db and --no-create-db
\n
"
);
if
(
option_no_create_db
)
options
->
create
DB
=
-
1
;
options
->
create
_db
=
-
1
;
else
if
(
option_create_db
)
options
->
create
DB
=
1
;
options
->
create
_db
=
1
;
options
->
daemon
=
!
option_no_daemon
;
...
...
src/cmdline.h
View file @
62f9df98
...
...
@@ -22,14 +22,14 @@
#include <glib.h>
typedef
struct
_O
ptions
{
struct
o
ptions
{
gboolean
kill
;
gboolean
daemon
;
gboolean
std
Output
;
gboolean
std
err
;
gboolean
verbose
;
int
create
DB
;
}
Options
;
int
create
_db
;
};
void
parse
Options
(
int
argc
,
char
**
argv
,
O
ptions
*
options
);
void
parse
_cmdline
(
int
argc
,
char
**
argv
,
struct
o
ptions
*
options
);
#endif
src/main.c
View file @
62f9df98
...
...
@@ -96,7 +96,7 @@ struct notify main_notify;
* process has been daemonized.
*/
static
bool
openDB
(
const
O
ptions
*
options
)
openDB
(
const
struct
o
ptions
*
options
)
{
const
char
*
path
=
config_get_path
(
CONF_DB_FILE
);
bool
ret
;
...
...
@@ -115,7 +115,7 @@ openDB(const Options *options)
db_init
(
path
);
if
(
options
->
create
DB
>
0
)
if
(
options
->
create
_db
>
0
)
/* don't attempt to load the old database */
return
false
;
...
...
@@ -124,7 +124,7 @@ openDB(const Options *options)
g_warning
(
"Failed to load database: %s"
,
error
->
message
);
g_error_free
(
error
);
if
(
options
->
create
DB
<
0
)
if
(
options
->
create
_db
<
0
)
g_error
(
"can't open db file and using "
"
\"
--no-create-db
\"
command line option"
);
...
...
@@ -228,7 +228,7 @@ idle_event_emitted(void)
int
main
(
int
argc
,
char
*
argv
[])
{
O
ptions
options
;
struct
o
ptions
options
;
clock_t
start
;
bool
create_db
;
#ifdef ENABLE_SQLITE
...
...
@@ -255,7 +255,7 @@ int main(int argc, char *argv[])
tag_pool_init
();
config_global_init
();
parse
Options
(
argc
,
argv
,
&
options
);
parse
_cmdline
(
argc
,
argv
,
&
options
);
daemonize_init
(
config_get_string
(
CONF_USER
,
NULL
),
config_get_path
(
CONF_PID_FILE
));
...
...
@@ -265,7 +265,7 @@ int main(int argc, char *argv[])
stats_global_init
();
tag_lib_init
();
log_init
(
options
.
verbose
,
options
.
std
Output
);
log_init
(
options
.
verbose
,
options
.
std
err
);
listen_global_init
();
...
...
@@ -310,7 +310,7 @@ int main(int argc, char *argv[])
daemonize
(
options
.
daemon
);
setup_log_output
(
options
.
std
Output
);
setup_log_output
(
options
.
std
err
);
initSigHandlers
();
...
...
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