Skip to content

Commit

Permalink
Namespace cleanup: Prefix album with ds_
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKagstrom committed Mar 18, 2011
1 parent 25e9236 commit 284a225
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/bindings/ruby/ext/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ VALUE cTrack;

VALUE eDespotifyError;

typedef struct album ds_album_t;
typedef struct ds_album ds_album_t;
typedef struct album_browse ds_album_browse_t;
typedef struct artist ds_artist_t;
typedef struct artist_browse ds_artist_browse_t;
Expand Down
2 changes: 1 addition & 1 deletion src/clients/simple/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void print_search(struct search_result *search)

if (search->total_albums > 0) {
wrapper_wprintf(L"\nAlbums found (%d):\n", search->total_albums);
for (struct album* album = search->albums; album; album = album->next)
for (struct ds_album* album = search->albums; album; album = album->next)
wrapper_wprintf(L" %s\n", album->name);
}

Expand Down
6 changes: 3 additions & 3 deletions src/lib/despotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct search_result
int total_albums;
int total_tracks;
struct artist *artists;
struct album *albums;
struct ds_album *albums;
struct track *tracks;
struct ds_playlist *playlist;
};
Expand All @@ -62,15 +62,15 @@ struct ds_playlist
struct ds_playlist *next; /* in case of multiple playlists in the root list */
};

struct album
struct ds_album
{
char name[STRING_LENGTH];
char id[33];
char artist[STRING_LENGTH];
char artist_id[33];
char cover_id[41];
float popularity;
struct album* next;
struct ds_album* next;
};

struct album_browse
Expand Down
16 changes: 8 additions & 8 deletions src/lib/xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ void xml_free_track(struct track* head)
}


static void parse_album(ezxml_t top, struct album* a) {
static void parse_album(ezxml_t top, struct ds_album* a) {
xmlstrncpy(a->name, sizeof a->name, top, "name", -1);
xmlstrncpy(a->id, sizeof a->id, top, "id", -1);
xmlstrncpy(a->artist, sizeof a->artist, top, "artist-name", -1);
Expand Down Expand Up @@ -413,12 +413,12 @@ int xml_parse_search(struct search_result* search,
}

ezxml_t albums = ezxml_get(top, "albums",-1);
struct album *aprev = NULL;
struct album *album = calloc(1, sizeof(struct album));
struct ds_album *aprev = NULL;
struct ds_album *album = calloc(1, sizeof(struct ds_album));
search->albums = album;
for (ezxml_t xa = ezxml_get(albums, "album", -1); xa; xa = xa->next) {
if(aprev) {
album = calloc(1, sizeof(struct album));
album = calloc(1, sizeof(struct ds_album));
aprev->next = album;
}

Expand Down Expand Up @@ -465,7 +465,7 @@ bool xml_parse_browse_artist(struct artist_browse* a,
int album_count = 0;
for (ezxml_t xalb = ezxml_get(x, "album", -1); xalb; xalb = xalb->next) {
if (prev) {
album = calloc(1, sizeof(struct album));
album = calloc(1, sizeof(struct ds_album));
prev->next = album;
}

Expand Down Expand Up @@ -509,10 +509,10 @@ bool xml_parse_browse_album(struct album_browse* a,
return true;
}

void xml_free_album(struct album* album)
void xml_free_album(struct ds_album* album)
{
struct album* next_album = album;
for (struct album* a = next_album; next_album; a = next_album) {
struct ds_album* next_album = album;
for (struct ds_album* a = next_album; next_album; a = next_album) {
next_album = a->next;
free(a);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void xml_free_playlist(struct ds_playlist* pl);
void xml_free_track(struct track* head);
void xml_free_artist(struct artist* artist);
void xml_free_artist_browse(struct artist_browse* artist);
void xml_free_album(struct album* album);
void xml_free_album(struct ds_album* album);
void xml_free_album_browse(struct album_browse* album);

void xml_parse_prodinfo(struct user_info* u, unsigned char* xml, int len);
Expand Down

0 comments on commit 284a225

Please sign in to comment.