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
d3293b88
Commit
d3293b88
authored
Jan 03, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
database.h: move prototypes to DatabaseGlue.hxx
parent
b4b0b34e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
21 deletions
+23
-21
Makefile.am
Makefile.am
+1
-1
DatabaseGlue.cxx
src/DatabaseGlue.cxx
+3
-3
DatabaseGlue.hxx
src/DatabaseGlue.hxx
+15
-0
Main.cxx
src/Main.cxx
+4
-3
database.h
src/database.h
+0
-14
No files found.
Makefile.am
View file @
d3293b88
...
@@ -224,7 +224,7 @@ src_mpd_SOURCES = \
...
@@ -224,7 +224,7 @@ src_mpd_SOURCES = \
src/decoder_print.c
\
src/decoder_print.c
\
src/Directory.cxx src/Directory.hxx
\
src/Directory.cxx src/Directory.hxx
\
src/DirectorySave.cxx src/DirectorySave.hxx
\
src/DirectorySave.cxx src/DirectorySave.hxx
\
src/DatabaseGlue.cxx
\
src/DatabaseGlue.cxx
src/DatabaseGlue.hxx
\
src/DatabasePrint.cxx src/DatabasePrint.hxx
\
src/DatabasePrint.cxx src/DatabasePrint.hxx
\
src/DatabaseQueue.cxx src/DatabaseQueue.hxx
\
src/DatabaseQueue.cxx src/DatabaseQueue.hxx
\
src/DatabasePlaylist.cxx src/DatabasePlaylist.hxx
\
src/DatabasePlaylist.cxx src/DatabasePlaylist.hxx
\
...
...
src/DatabaseGlue.cxx
View file @
d3293b88
...
@@ -51,7 +51,7 @@ static bool db_is_open;
...
@@ -51,7 +51,7 @@ static bool db_is_open;
static
bool
is_simple
;
static
bool
is_simple
;
bool
bool
db_init
(
const
struc
t
config_param
*
param
,
GError
**
error_r
)
DatabaseGlobalInit
(
cons
t
config_param
*
param
,
GError
**
error_r
)
{
{
assert
(
db
==
NULL
);
assert
(
db
==
NULL
);
assert
(
!
db_is_open
);
assert
(
!
db_is_open
);
...
@@ -72,7 +72,7 @@ db_init(const struct config_param *param, GError **error_r)
...
@@ -72,7 +72,7 @@ db_init(const struct config_param *param, GError **error_r)
}
}
void
void
db_finish
(
void
)
DatabaseGlobalDeinit
(
void
)
{
{
if
(
db_is_open
)
if
(
db_is_open
)
db
->
Close
();
db
->
Close
();
...
@@ -142,7 +142,7 @@ db_save(GError **error_r)
...
@@ -142,7 +142,7 @@ db_save(GError **error_r)
}
}
bool
bool
db_load
(
GError
**
error
)
DatabaseGlobalOpen
(
GError
**
error
)
{
{
assert
(
db
!=
NULL
);
assert
(
db
!=
NULL
);
assert
(
!
db_is_open
);
assert
(
!
db_is_open
);
...
...
src/DatabaseGlue.hxx
View file @
d3293b88
...
@@ -23,9 +23,24 @@
...
@@ -23,9 +23,24 @@
#include "gcc.h"
#include "gcc.h"
#include "gerror.h"
#include "gerror.h"
struct
config_param
;
class
Database
;
class
Database
;
/**
/**
* Initialize the database library.
*
* @param param the database configuration block
*/
bool
DatabaseGlobalInit
(
const
config_param
*
param
,
GError
**
error_r
);
void
DatabaseGlobalDeinit
(
void
);
bool
DatabaseGlobalOpen
(
GError
**
error
);
/**
* Returns the global #Database instance. May return NULL if this MPD
* Returns the global #Database instance. May return NULL if this MPD
* configuration has no database (no music_directory was configured).
* configuration has no database (no music_directory was configured).
*/
*/
...
...
src/Main.cxx
View file @
d3293b88
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include "StateFile.hxx"
#include "StateFile.hxx"
#include "PlayerThread.hxx"
#include "PlayerThread.hxx"
#include "Mapper.hxx"
#include "Mapper.hxx"
#include "DatabaseGlue.hxx"
extern
"C"
{
extern
"C"
{
#include "daemon.h"
#include "daemon.h"
...
@@ -186,13 +187,13 @@ glue_db_init_and_load(void)
...
@@ -186,13 +187,13 @@ glue_db_init_and_load(void)
param
=
allocated
;
param
=
allocated
;
}
}
if
(
!
db_i
nit
(
param
,
&
error
))
if
(
!
DatabaseGlobalI
nit
(
param
,
&
error
))
MPD_ERROR
(
"%s"
,
error
->
message
);
MPD_ERROR
(
"%s"
,
error
->
message
);
if
(
allocated
!=
NULL
)
if
(
allocated
!=
NULL
)
config_param_free
(
allocated
);
config_param_free
(
allocated
);
ret
=
db_load
(
&
error
);
ret
=
DatabaseGlobalOpen
(
&
error
);
if
(
!
ret
)
if
(
!
ret
)
MPD_ERROR
(
"%s"
,
error
->
message
);
MPD_ERROR
(
"%s"
,
error
->
message
);
...
@@ -520,7 +521,7 @@ int mpd_main(int argc, char *argv[])
...
@@ -520,7 +521,7 @@ int mpd_main(int argc, char *argv[])
playlist_global_finish
();
playlist_global_finish
();
start
=
clock
();
start
=
clock
();
db_finish
();
DatabaseGlobalDeinit
();
g_debug
(
"db_finish took %f seconds"
,
g_debug
(
"db_finish took %f seconds"
,
((
float
)(
clock
()
-
start
))
/
CLOCKS_PER_SEC
);
((
float
)(
clock
()
-
start
))
/
CLOCKS_PER_SEC
);
...
...
src/database.h
View file @
d3293b88
...
@@ -33,17 +33,6 @@ struct db_selection;
...
@@ -33,17 +33,6 @@ struct db_selection;
struct
db_visitor
;
struct
db_visitor
;
/**
/**
* Initialize the database library.
*
* @param param the database configuration block
*/
bool
db_init
(
const
struct
config_param
*
param
,
GError
**
error_r
);
void
db_finish
(
void
);
/**
* Check whether the default #SimpleDatabasePlugin is used. This
* Check whether the default #SimpleDatabasePlugin is used. This
* allows using db_get_root(), db_save(), db_get_mtime() and
* allows using db_get_root(), db_save(), db_get_mtime() and
* db_exists().
* db_exists().
...
@@ -75,9 +64,6 @@ db_get_directory(const char *name);
...
@@ -75,9 +64,6 @@ db_get_directory(const char *name);
bool
bool
db_save
(
GError
**
error_r
);
db_save
(
GError
**
error_r
);
bool
db_load
(
GError
**
error
);
/**
/**
* May only be used if db_is_simple() returns true.
* May only be used if db_is_simple() returns true.
*/
*/
...
...
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