Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Namespace cleanup: Prefix artist with ds_

  • Loading branch information...
commit d85176bfc95dacf8fb10389e722d159281dfd466 1 parent f99b54b
@SimonKagstrom authored
View
2  src/bindings/ruby/ext/main.h
@@ -18,7 +18,7 @@ VALUE eDespotifyError;
typedef struct ds_album ds_album_t;
typedef struct ds_album_browse ds_album_browse_t;
-typedef struct artist ds_artist_t;
+typedef struct ds_artist ds_artist_t;
typedef struct artist_browse ds_artist_browse_t;
typedef struct ds_playlist ds_playlist_t;
typedef struct link ds_link_t;
View
2  src/clients/despotify/ui_tracklist.c
@@ -60,7 +60,7 @@ void tracklist_draw(ui_t *ui)
// Concat list of artists.
wchar_t art[slen];
int len = 0;
- for (struct artist* a = t->artist; a && len < slen; a = a->next)
+ for (struct ds_artist* a = t->artist; a && len < slen; a = a->next)
len += swprintf(art + len, slen - len, L"%s%s", a->name, a->next ? "/" : "");
wchar_t str[ui->width];
View
8 src/clients/simple/simple.c
@@ -155,7 +155,7 @@ void print_tracks(struct ds_track* head)
if (t->has_meta_data) {
wrapper_wprintf(L"%3d: %-40s %2d:%02d ", count++, t->title,
t->length / 60000, t->length % 60000 / 1000);
- for (struct artist* a = t->artist; a; a = a->next)
+ for (struct ds_artist* a = t->artist; a; a = a->next)
wrapper_wprintf(L"%s%s", a->name, a->next ? ", " : "");
wrapper_wprintf(L" %s\n", t->playable ? "" : "(Unplayable)");
}
@@ -170,7 +170,7 @@ void print_track_full(struct ds_track* t)
wrapper_wprintf(L"\nTitle: %s\nAlbum: %s\nArtist(s): ",
t->title, t->album);
- for (struct artist* a = t->artist; a; a = a->next)
+ for (struct ds_artist* a = t->artist; a; a = a->next)
wrapper_wprintf(L"%s%s", a->name, a->next ? ", " : "");
wrapper_wprintf(L"\nYear: %d\nLength: %02d:%02d\n\n",
@@ -213,7 +213,7 @@ void print_search(struct ds_search_result *search)
if (search->total_artists > 0) {
wrapper_wprintf(L"\nArtists found (%d):\n", search->total_artists);
- for (struct artist* artist = search->artists; artist; artist = artist->next)
+ for (struct ds_artist* artist = search->artists; artist; artist = artist->next)
wrapper_wprintf(L" %s\n", artist->name);
}
@@ -410,7 +410,7 @@ void command_loop(struct despotify_session* ds)
for (int i=1; i<num; i++)
t = t->next;
- for (struct artist* aptr = t->artist; aptr; aptr = aptr->next) {
+ for (struct ds_artist* aptr = t->artist; aptr; aptr = aptr->next) {
struct artist_browse* a = despotify_get_artist(ds, aptr->id);
print_artist(a);
despotify_free_artist_browse(a);
View
6 src/lib/despotify.c
@@ -882,13 +882,13 @@ static bool despotify_load_tracks(struct despotify_session *ds, bool cache_do_st
t->next = next;
/* deep copy of artist list */
- struct artist* a = calloc(1, sizeof(struct artist));
+ struct ds_artist* a = calloc(1, sizeof(struct ds_artist));
t->artist = a;
- struct artist* ta;
+ struct ds_artist* ta;
for (ta = tt->artist; ta; ta = ta->next) {
*a = *ta;
if (ta->next)
- a = a->next = calloc(1, sizeof(struct artist));
+ a = a->next = calloc(1, sizeof(struct ds_artist));
}
/* deep copy of georestrictions. */
View
8 src/lib/despotify.h
@@ -26,7 +26,7 @@ struct ds_track
char *forbidden;
char title[STRING_LENGTH];
- struct artist* artist;
+ struct ds_artist* artist;
char album[STRING_LENGTH];
int length;
int tracknumber;
@@ -43,7 +43,7 @@ struct ds_search_result
int total_artists;
int total_albums;
int total_tracks;
- struct artist *artists;
+ struct ds_artist *artists;
struct ds_album *albums;
struct ds_track *tracks;
struct ds_playlist *playlist;
@@ -85,13 +85,13 @@ struct ds_album_browse
struct ds_album_browse* next; /* in case of multiple albums in an artist struct */
};
-struct artist
+struct ds_artist
{
char name[STRING_LENGTH];
char id[33];
char portrait_id[41];
float popularity;
- struct artist* next;
+ struct ds_artist* next;
};
struct artist_browse
View
20 src/lib/xml.c
@@ -231,13 +231,13 @@ static int parse_tracks(ezxml_t xml, struct ds_track* t, bool ordered, bool high
xmlstrncpy(t->album_id, sizeof t->album_id, track, "album-id", -1);
/* create list of artists */
- struct artist* preva = NULL;
- struct artist* artist = calloc(1, sizeof(struct artist));
+ struct ds_artist* preva = NULL;
+ struct ds_artist* artist = calloc(1, sizeof(struct ds_artist));
t->artist = artist;
ezxml_t xid = ezxml_get(track, "artist-id", -1);
for (ezxml_t xa = ezxml_get(track, "artist", -1); xa; xa = xa->next) {
if (preva) {
- artist = calloc(1, sizeof(struct artist));
+ artist = calloc(1, sizeof(struct ds_artist));
preva->next = artist;
}
DSFYstrncpy(artist->name, xa->txt, sizeof artist->name);
@@ -335,7 +335,7 @@ static void parse_album(ezxml_t top, struct ds_album* a) {
xmlatof(&a->popularity, top, "popularity", -1);
}
-static void parse_artist(ezxml_t top, struct artist *a) {
+static void parse_artist(ezxml_t top, struct ds_artist *a) {
xmlstrncpy(a->name, sizeof a->name, top, "name", -1);
xmlstrncpy(a->id, sizeof a->id, top, "id", -1);
xmlstrncpy(a->portrait_id, sizeof a->portrait_id, top,
@@ -399,12 +399,12 @@ int xml_parse_search(struct ds_search_result* search,
xmlatoi(&search->total_tracks, top, "total-tracks", -1);
ezxml_t artists = ezxml_get(top, "artists",-1);
- struct artist *prev = NULL;
- struct artist *artist = calloc(1, sizeof(struct artist));
+ struct ds_artist *prev = NULL;
+ struct ds_artist *artist = calloc(1, sizeof(struct ds_artist));
search->artists = artist;
for (ezxml_t xa = ezxml_get(artists, "artist", -1); xa; xa = xa->next) {
if(prev) {
- artist = calloc(1, sizeof(struct artist));
+ artist = calloc(1, sizeof(struct ds_artist));
prev->next = artist;
}
@@ -480,9 +480,9 @@ bool xml_parse_browse_artist(struct artist_browse* a,
return true;
}
-void xml_free_artist(struct artist *artist) {
- struct artist* next_artist = artist;
- for (struct artist* a = next_artist; next_artist; a = next_artist) {
+void xml_free_artist(struct ds_artist *artist) {
+ struct ds_artist* next_artist = artist;
+ for (struct ds_artist* a = next_artist; next_artist; a = next_artist) {
next_artist = a->next;
free(a);
}
View
2  src/lib/xml.h
@@ -40,7 +40,7 @@ bool xml_parse_browse_album(struct ds_album_browse* a,
void xml_free_playlist(struct ds_playlist* pl);
void xml_free_track(struct ds_track* head);
-void xml_free_artist(struct artist* artist);
+void xml_free_artist(struct ds_artist* artist);
void xml_free_artist_browse(struct artist_browse* artist);
void xml_free_album(struct ds_album* album);
void xml_free_album_browse(struct ds_album_browse* album);
Please sign in to comment.
Something went wrong with that request. Please try again.