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
b46bb611
Commit
b46bb611
authored
Aug 08, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DatabaseGlue: pass block to db_init()
Let the caller take care for legacy conversion.
parent
aa55d759
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
13 deletions
+9
-13
DatabaseGlue.cxx
src/DatabaseGlue.cxx
+1
-10
database.h
src/database.h
+2
-2
main.c
src/main.c
+6
-1
No files found.
src/DatabaseGlue.cxx
View file @
b46bb611
...
...
@@ -51,21 +51,12 @@ static Database *db;
static
bool
db_is_open
;
bool
db_init
(
const
struct
config_param
*
pa
th
,
GError
**
error_r
)
db_init
(
const
struct
config_param
*
pa
ram
,
GError
**
error_r
)
{
assert
(
db
==
NULL
);
assert
(
!
db_is_open
);
if
(
path
==
NULL
)
return
true
;
struct
config_param
*
param
=
config_new_param
(
"database"
,
path
->
line
);
config_add_block_param
(
param
,
"path"
,
path
->
value
,
path
->
line
);
db
=
simple_db_plugin
.
create
(
param
,
error_r
);
config_param_free
(
param
);
return
db
!=
NULL
;
}
...
...
src/database.h
View file @
b46bb611
...
...
@@ -35,10 +35,10 @@ struct db_visitor;
/**
* Initialize the database library.
*
* @param pa
th the absolute path of the database file
* @param pa
ram the database configuration block
*/
bool
db_init
(
const
struct
config_param
*
pa
th
,
GError
**
error_r
);
db_init
(
const
struct
config_param
*
pa
ram
,
GError
**
error_r
);
void
db_finish
(
void
);
...
...
src/main.c
View file @
b46bb611
...
...
@@ -169,9 +169,14 @@ glue_db_init_and_load(void)
if
(
path
==
NULL
)
MPD_ERROR
(
CONF_DB_FILE
" setting missing"
);
if
(
!
db_init
(
path
,
&
error
))
struct
config_param
*
param
=
config_new_param
(
"database"
,
path
->
line
);
config_add_block_param
(
param
,
"path"
,
path
->
value
,
path
->
line
);
if
(
!
db_init
(
param
,
&
error
))
MPD_ERROR
(
"%s"
,
error
->
message
);
config_param_free
(
param
);
ret
=
db_load
(
&
error
);
if
(
!
ret
)
MPD_ERROR
(
"%s"
,
error
->
message
);
...
...
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