diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2013-08-04 18:53:43 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2013-08-07 17:37:33 +0200 |
commit | ee2e73cd7b5a1de68c8316e916c4ef3a88302bed (patch) | |
tree | e952d75d075598123d5ecbe92f14838ce75f6db5 /src/libpiano/request.c | |
parent | 36ea2f13f87b9310219790c3cee498201d54f8e0 (diff) | |
download | pianobar-ee2e73cd7b5a1de68c8316e916c4ef3a88302bed.tar.gz pianobar-ee2e73cd7b5a1de68c8316e916c4ef3a88302bed.tar.bz2 pianobar-ee2e73cd7b5a1de68c8316e916c4ef3a88302bed.zip |
piano: Generic linked lists
Introduces generic linked list structure and functions (like append,
delete, …). Removes a lot of copy&pasted code and improves code
readability/reusability.
Heads up: This change breaks libpiano’s ABI.
Diffstat (limited to 'src/libpiano/request.c')
-rw-r--r-- | src/libpiano/request.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libpiano/request.c b/src/libpiano/request.c index 85d6286..82bf350 100644 --- a/src/libpiano/request.c +++ b/src/libpiano/request.c @@ -1,5 +1,5 @@ /* -Copyright (c) 2008-2012 +Copyright (c) 2008-2013 Lars-Dominik Braun <lars@6xq.net> Permission is hereby granted, free of charge, to any person obtaining a copy @@ -272,14 +272,12 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req, PianoStation_t *curStation = ph->stations; json_object *a = json_object_new_array (); - while (curStation != NULL) { + PianoListForeachP (curStation) { /* quick mix can't contain itself */ if (curStation->useQuickMix && !curStation->isQuickMix) { json_object_array_add (a, json_object_new_string (curStation->id)); } - - curStation = curStation->next; } json_object_object_add (j, "quickMixStationIds", a); |