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
eb5b3ce5
Commit
eb5b3ce5
authored
Mar 02, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
database: no CamelCase
Renamed a bunch of variables.
parent
b7bfa24f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
database.c
src/database.c
+15
-16
No files found.
src/database.c
View file @
eb5b3ce5
...
...
@@ -47,7 +47,7 @@ static char *database_path;
static
struct
directory
*
music_root
;
static
time_t
d
irectory_dbModT
ime
;
static
time_t
d
atabase_mt
ime
;
void
db_init
(
const
char
*
path
)
...
...
@@ -261,7 +261,7 @@ db_save(void)
while
(
fclose
(
fp
)
&&
errno
==
EINTR
);
if
(
stat
(
database_path
,
&
st
)
==
0
)
d
irectory_dbModT
ime
=
st
.
st_mtime
;
d
atabase_mt
ime
=
st
.
st_mtime
;
return
true
;
}
...
...
@@ -272,7 +272,7 @@ db_load(void)
FILE
*
fp
=
NULL
;
struct
stat
st
;
char
buffer
[
100
];
bool
found
FsCharset
=
false
,
foundV
ersion
=
false
;
bool
found
_charset
=
false
,
found_v
ersion
=
false
;
assert
(
database_path
!=
NULL
);
assert
(
music_root
!=
NULL
);
...
...
@@ -304,26 +304,25 @@ db_load(void)
g_strchomp
(
buffer
);
if
(
g_str_has_prefix
(
buffer
,
DIRECTORY_MPD_VERSION
))
{
if
(
found
V
ersion
)
if
(
found
_v
ersion
)
g_error
(
"already found version in db"
);
found
V
ersion
=
true
;
found
_v
ersion
=
true
;
}
else
if
(
g_str_has_prefix
(
buffer
,
DIRECTORY_FS_CHARSET
))
{
char
*
fsCharset
;
const
char
*
tempCharset
;
const
char
*
new_charset
,
*
old_charset
;
if
(
found
FsC
harset
)
if
(
found
_c
harset
)
g_error
(
"already found fs charset in db"
);
found
FsC
harset
=
true
;
found
_c
harset
=
true
;
fsC
harset
=
&
(
buffer
[
strlen
(
DIRECTORY_FS_CHARSET
)]);
tempC
harset
=
path_get_fs_charset
();
if
(
tempC
harset
!=
NULL
&&
strcmp
(
fsCharset
,
tempC
harset
))
{
new_c
harset
=
&
(
buffer
[
strlen
(
DIRECTORY_FS_CHARSET
)]);
old_c
harset
=
path_get_fs_charset
();
if
(
old_c
harset
!=
NULL
&&
strcmp
(
new_charset
,
old_c
harset
))
{
g_message
(
"Existing database has charset
\"
%s
\"
"
"instead of
\"
%s
\"
; "
"discarding database file"
,
fsCharset
,
tempC
harset
);
new_charset
,
old_c
harset
);
return
false
;
}
}
else
...
...
@@ -339,7 +338,7 @@ db_load(void)
stats_update
();
if
(
stat
(
database_path
,
&
st
)
==
0
)
d
irectory_dbModT
ime
=
st
.
st_mtime
;
d
atabase_mt
ime
=
st
.
st_mtime
;
return
true
;
}
...
...
@@ -347,5 +346,5 @@ db_load(void)
time_t
db_get_mtime
(
void
)
{
return
d
irectory_dbModT
ime
;
return
d
atabase_mt
ime
;
}
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