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
e6cb939a
Commit
e6cb939a
authored
Jan 24, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
locate: added locate_item_list_casefold()
Merged casefolding code from two locations into this one library function.
parent
6a2118d0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
11 deletions
+22
-11
dbUtils.c
src/dbUtils.c
+2
-6
locate.c
src/locate.c
+12
-0
locate.h
src/locate.h
+7
-0
queue_print.c
src/queue_print.c
+1
-5
No files found.
src/dbUtils.c
View file @
e6cb939a
...
...
@@ -84,14 +84,10 @@ searchForSongsIn(struct client *client, const char *name,
const
struct
locate_item_list
*
criteria
)
{
int
ret
;
struct
locate_item_list
*
new_list
;
struct
locate_item_list
*
new_list
=
locate_item_list_casefold
(
criteria
);
struct
search_data
data
;
new_list
=
locate_item_list_new
(
criteria
->
length
);
for
(
unsigned
i
=
0
;
i
<
criteria
->
length
;
i
++
)
new_list
->
items
[
i
].
needle
=
g_utf8_casefold
(
criteria
->
items
[
i
].
needle
,
-
1
);
data
.
client
=
client
;
data
.
criteria
=
new_list
;
...
...
src/locate.c
View file @
e6cb939a
...
...
@@ -117,6 +117,18 @@ locate_item_list_parse(char *argv[], int argc)
return
list
;
}
struct
locate_item_list
*
locate_item_list_casefold
(
const
struct
locate_item_list
*
list
)
{
struct
locate_item_list
*
new_list
=
locate_item_list_new
(
list
->
length
);
for
(
unsigned
i
=
0
;
i
<
list
->
length
;
i
++
)
new_list
->
items
[
i
].
needle
=
g_utf8_casefold
(
list
->
items
[
i
].
needle
,
-
1
);
return
new_list
;
}
void
locate_item_free
(
struct
locate_item
*
item
)
{
...
...
src/locate.h
View file @
e6cb939a
...
...
@@ -63,6 +63,13 @@ locate_item_list_new(unsigned length);
struct
locate_item_list
*
locate_item_list_parse
(
char
*
argv
[],
int
argc
);
/**
* Duplicate the struct locate_item_list object and convert all
* needles with g_utf8_casefold().
*/
struct
locate_item_list
*
locate_item_list_casefold
(
const
struct
locate_item_list
*
list
);
void
locate_item_list_free
(
struct
locate_item_list
*
list
);
...
...
src/queue_print.c
View file @
e6cb939a
...
...
@@ -85,11 +85,7 @@ queue_search(struct client *client, const struct queue *queue,
{
unsigned
i
;
struct
locate_item_list
*
new_list
=
locate_item_list_new
(
criteria
->
length
);
for
(
i
=
0
;
i
<
criteria
->
length
;
i
++
)
new_list
->
items
[
i
].
needle
=
g_utf8_casefold
(
criteria
->
items
[
i
].
needle
,
-
1
);
locate_item_list_casefold
(
criteria
);
for
(
i
=
0
;
i
<
queue_length
(
queue
);
i
++
)
{
const
struct
song
*
song
=
queue_get
(
queue
,
i
);
...
...
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