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
3002fd18
Commit
3002fd18
authored
Nov 05, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
path: no CamelCase
Rename variables and functions.
parent
259c6ed1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
30 deletions
+27
-30
database.c
src/database.c
+2
-2
main.c
src/main.c
+2
-2
path.c
src/path.c
+19
-22
path.h
src/path.h
+4
-4
No files found.
src/database.c
View file @
3002fd18
...
...
@@ -230,7 +230,7 @@ db_save(void)
/* block signals when writing the db so we don't get a corrupted db */
fprintf
(
fp
,
"%s
\n
"
,
DIRECTORY_INFO_BEGIN
);
fprintf
(
fp
,
"%s%s
\n
"
,
DIRECTORY_MPD_VERSION
,
VERSION
);
fprintf
(
fp
,
"%s%s
\n
"
,
DIRECTORY_FS_CHARSET
,
getFsC
harset
());
fprintf
(
fp
,
"%s%s
\n
"
,
DIRECTORY_FS_CHARSET
,
path_get_fs_c
harset
());
fprintf
(
fp
,
"%s
\n
"
,
DIRECTORY_INFO_END
);
if
(
directory_save
(
fp
,
music_root
)
<
0
)
{
...
...
@@ -302,7 +302,7 @@ db_load(void)
fsCharset
,
tempCharset
);
WARNING
(
"maybe you need to "
"recreate the db?
\n
"
);
setFsC
harset
(
fsCharset
);
path_set_fs_c
harset
(
fsCharset
);
}
}
else
FATAL
(
"directory: unknown line in db info: %s
\n
"
,
...
...
src/main.c
View file @
3002fd18
...
...
@@ -403,7 +403,7 @@ int main(int argc, char *argv[])
open_log_files
(
options
.
stdOutput
);
initPaths
();
path_global_init
();
mapper_init
();
initPermissions
();
initPlaylist
();
...
...
@@ -474,7 +474,7 @@ int main(int argc, char *argv[])
finishAudioConfig
();
finishVolume
();
mapper_finish
();
finishPaths
();
path_global_finish
();
finishPermissions
();
dc_deinit
();
pc_deinit
();
...
...
src/path.c
View file @
3002fd18
...
...
@@ -32,7 +32,7 @@
#include <glib.h>
static
char
*
fs
C
harset
;
static
char
*
fs
_c
harset
;
char
*
fs_charset_to_utf8
(
char
*
dst
,
const
char
*
str
)
{
...
...
@@ -40,7 +40,7 @@ char *fs_charset_to_utf8(char *dst, const char *str)
GError
*
error
=
NULL
;
p
=
g_convert
(
str
,
-
1
,
fs
C
harset
,
"utf-8"
,
fs
_c
harset
,
"utf-8"
,
NULL
,
NULL
,
&
error
);
if
(
p
==
NULL
)
{
/* no fallback */
...
...
@@ -59,7 +59,7 @@ char *utf8_to_fs_charset(char *dst, const char *str)
GError
*
error
=
NULL
;
p
=
g_convert
(
str
,
-
1
,
"utf-8"
,
fs
C
harset
,
"utf-8"
,
fs
_c
harset
,
NULL
,
NULL
,
&
error
);
if
(
p
==
NULL
)
{
/* fall back to UTF-8 */
...
...
@@ -72,38 +72,36 @@ char *utf8_to_fs_charset(char *dst, const char *str)
return
dst
;
}
void
setFsC
harset
(
const
char
*
charset
)
void
path_set_fs_c
harset
(
const
char
*
charset
)
{
int
error
=
0
;
if
(
fsCharset
)
free
(
fsC
harset
);
g_free
(
fs_charset
);
fs_charset
=
g_strdup
(
c
harset
);
fsCharset
=
xstrdup
(
charset
);
DEBUG
(
"setFsCharset: fs charset is: %s
\n
"
,
fsCharset
);
DEBUG
(
"path_set_fs_charset: fs charset is: %s
\n
"
,
fs_charset
);
if
(
error
)
{
free
(
fs
C
harset
);
free
(
fs
_c
harset
);
WARNING
(
"setting fs charset to ISO-8859-1!
\n
"
);
fs
C
harset
=
xstrdup
(
"ISO-8859-1"
);
fs
_c
harset
=
xstrdup
(
"ISO-8859-1"
);
}
}
const
char
*
getFsC
harset
(
void
)
const
char
*
path_get_fs_c
harset
(
void
)
{
return
fs
C
harset
;
return
fs
_c
harset
;
}
void
initPaths
(
void
)
void
path_global_init
(
void
)
{
ConfigParam
*
fs
CharsetP
aram
=
getConfigParam
(
CONF_FS_CHARSET
);
ConfigParam
*
fs
_charset_p
aram
=
getConfigParam
(
CONF_FS_CHARSET
);
char
*
charset
=
NULL
;
char
*
originalLocale
;
if
(
fs
CharsetP
aram
)
{
charset
=
xstrdup
(
fs
CharsetP
aram
->
value
);
if
(
fs
_charset_p
aram
)
{
charset
=
xstrdup
(
fs
_charset_p
aram
->
value
);
}
#ifdef HAVE_LOCALE
#ifdef HAVE_LANGINFO_CODESET
...
...
@@ -138,18 +136,17 @@ void initPaths(void)
#endif
if
(
charset
)
{
setFsC
harset
(
charset
);
path_set_fs_c
harset
(
charset
);
free
(
charset
);
}
else
{
WARNING
(
"setting filesystem charset to ISO-8859-1
\n
"
);
setFsC
harset
(
"ISO-8859-1"
);
path_set_fs_c
harset
(
"ISO-8859-1"
);
}
}
void
finishPaths
(
void
)
void
path_global_finish
(
void
)
{
free
(
fsCharset
);
fsCharset
=
NULL
;
g_free
(
fs_charset
);
}
char
*
pfx_dir
(
char
*
dst
,
...
...
src/path.h
View file @
3002fd18
...
...
@@ -31,17 +31,17 @@
# endif
#endif
void
initPaths
(
void
);
void
path_global_init
(
void
);
void
finishPaths
(
void
);
void
path_global_finish
(
void
);
char
*
fs_charset_to_utf8
(
char
*
dst
,
const
char
*
str
);
char
*
utf8_to_fs_charset
(
char
*
dst
,
const
char
*
str
);
void
setFsC
harset
(
const
char
*
charset
);
void
path_set_fs_c
harset
(
const
char
*
charset
);
const
char
*
getFsC
harset
(
void
);
const
char
*
path_get_fs_c
harset
(
void
);
/*
* pfx_dir - sets dst="$pfx/$path" and returns a pointer to path inside * dst
...
...
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