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
69ff9d75
Commit
69ff9d75
authored
Jul 05, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
song_save: no CamelCase
Renamed functions.
parent
0c2ab17e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
directory_save.c
src/directory_save.c
+1
-1
song_save.c
src/song_save.c
+11
-11
song_save.h
src/song_save.h
+2
-2
No files found.
src/directory_save.c
View file @
69ff9d75
...
...
@@ -138,7 +138,7 @@ directory_load(FILE *fp, struct directory *directory, GError **error)
if
(
!
success
)
return
false
;
}
else
if
(
g_str_has_prefix
(
buffer
,
SONG_BEGIN
))
{
readSongInfoIntoList
(
fp
,
&
directory
->
songs
,
directory
);
songvec_load
(
fp
,
&
directory
->
songs
,
directory
);
}
else
{
g_set_error
(
error
,
directory_quark
(),
0
,
"Malformed line: %s"
,
buffer
);
...
...
src/song_save.c
View file @
69ff9d75
...
...
@@ -70,7 +70,7 @@ void songvec_save(FILE *fp, struct songvec *sv)
}
static
void
insertSongIntoList
(
struct
songvec
*
sv
,
struct
song
*
newsong
)
commit_song
(
struct
songvec
*
sv
,
struct
song
*
newsong
)
{
struct
song
*
existing
=
songvec_find
(
sv
,
newsong
->
url
);
...
...
@@ -93,7 +93,7 @@ insertSongIntoList(struct songvec *sv, struct song *newsong)
}
static
char
*
matchesAnMpdTagItemKey
(
char
*
buffer
,
enum
tag_type
*
itemType
)
parse_tag_value
(
char
*
buffer
,
enum
tag_type
*
type_r
)
{
int
i
;
...
...
@@ -102,7 +102,7 @@ matchesAnMpdTagItemKey(char *buffer, enum tag_type *itemType)
if
(
0
==
strncmp
(
tag_item_names
[
i
],
buffer
,
len
)
&&
buffer
[
len
]
==
':'
)
{
*
itemType
=
i
;
*
type_r
=
i
;
return
g_strchug
(
buffer
+
len
+
1
);
}
}
...
...
@@ -110,12 +110,12 @@ matchesAnMpdTagItemKey(char *buffer, enum tag_type *itemType)
return
NULL
;
}
void
readSongInfoIntoList
(
FILE
*
fp
,
struct
songvec
*
sv
,
struct
directory
*
parent
)
void
songvec_load
(
FILE
*
fp
,
struct
songvec
*
sv
,
struct
directory
*
parent
)
{
char
buffer
[
MPD_PATH_MAX
+
1024
];
struct
song
*
song
=
NULL
;
enum
tag_type
itemT
ype
;
enum
tag_type
t
ype
;
const
char
*
value
;
while
(
fgets
(
buffer
,
sizeof
(
buffer
),
fp
)
&&
...
...
@@ -124,7 +124,7 @@ void readSongInfoIntoList(FILE *fp, struct songvec *sv,
if
(
0
==
strncmp
(
SONG_KEY
,
buffer
,
strlen
(
SONG_KEY
)))
{
if
(
song
)
insertSongIntoList
(
sv
,
song
);
commit_song
(
sv
,
song
);
song
=
song_file_new
(
buffer
+
strlen
(
SONG_KEY
),
parent
);
...
...
@@ -134,14 +134,14 @@ void readSongInfoIntoList(FILE *fp, struct songvec *sv,
g_error
(
"Problems reading song info"
);
}
else
if
(
0
==
strncmp
(
SONG_FILE
,
buffer
,
strlen
(
SONG_FILE
)))
{
/* we don't need this info anymore */
}
else
if
((
value
=
matchesAnMpdTagItemKey
(
buffer
,
&
itemT
ype
))
!=
NULL
)
{
}
else
if
((
value
=
parse_tag_value
(
buffer
,
&
t
ype
))
!=
NULL
)
{
if
(
!
song
->
tag
)
{
song
->
tag
=
tag_new
();
tag_begin_add
(
song
->
tag
);
}
tag_add_item
(
song
->
tag
,
itemT
ype
,
value
);
tag_add_item
(
song
->
tag
,
t
ype
,
value
);
}
else
if
(
0
==
strncmp
(
SONG_TIME
,
buffer
,
strlen
(
SONG_TIME
)))
{
if
(
!
song
->
tag
)
{
song
->
tag
=
tag_new
();
...
...
@@ -157,5 +157,5 @@ void readSongInfoIntoList(FILE *fp, struct songvec *sv,
}
if
(
song
)
insertSongIntoList
(
sv
,
song
);
commit_song
(
sv
,
song
);
}
src/song_save.h
View file @
69ff9d75
...
...
@@ -27,7 +27,7 @@ struct directory;
void
songvec_save
(
FILE
*
fp
,
struct
songvec
*
sv
);
void
readSongInfoIntoList
(
FILE
*
fp
,
struct
songvec
*
sv
,
struct
directory
*
parent
);
void
songvec_load
(
FILE
*
fp
,
struct
songvec
*
sv
,
struct
directory
*
parent
);
#endif
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