diff options
Diffstat (limited to '')
-rw-r--r-- | src/tag.c | 48 |
1 files changed, 24 insertions, 24 deletions
@@ -55,7 +55,7 @@ const char *mpdTagItemKeys[TAG_NUM_OF_ITEM_TYPES] = { static mpd_sint8 ignoreTagItems[TAG_NUM_OF_ITEM_TYPES]; -void initTagConfig(void) +void tag_lib_init(void) { int quit = 0; char *temp; @@ -104,7 +104,7 @@ void initTagConfig(void) free(temp); } -void printTagTypes(int fd) +void tag_print_types(int fd) { int i; @@ -114,7 +114,7 @@ void printTagTypes(int fd) } } -void printMpdTag(int fd, struct mpd_tag *tag) +void tag_print(int fd, struct mpd_tag *tag) { int i; @@ -224,8 +224,8 @@ static struct mpd_tag *getID3Info( continue; if (mpdTag == NULL) - mpdTag = newMpdTag(); - addItemToMpdTag(mpdTag, type, (char *)utf8); + mpdTag = tag_new(); + tag_add_item(mpdTag, type, (char *)utf8); free(utf8); } } @@ -256,8 +256,8 @@ static struct mpd_tag *getID3Info( if(utf8) { if (mpdTag == NULL) - mpdTag = newMpdTag(); - addItemToMpdTag(mpdTag, type, (char *)utf8); + mpdTag = tag_new(); + tag_add_item(mpdTag, type, (char *)utf8); free(utf8); } } @@ -283,7 +283,7 @@ static struct mpd_tag *getID3Info( #endif #ifdef HAVE_ID3TAG -struct mpd_tag *parseId3Tag(struct id3_tag * tag) +struct mpd_tag *tag_id3_import(struct id3_tag * tag) { struct mpd_tag *ret = NULL; @@ -425,7 +425,7 @@ static struct id3_tag *findId3TagFromEnd(FILE * stream) } #endif -struct mpd_tag *id3Dup(char *file) +struct mpd_tag *tag_id3_load(char *file) { struct mpd_tag *ret = NULL; #ifdef HAVE_ID3TAG @@ -434,7 +434,7 @@ struct mpd_tag *id3Dup(char *file) stream = fopen(file, "r"); if (!stream) { - DEBUG("id3Dup: Failed to open file: '%s', %s\n", file, + DEBUG("tag_id3_load: Failed to open file: '%s', %s\n", file, strerror(errno)); return NULL; } @@ -447,13 +447,13 @@ struct mpd_tag *id3Dup(char *file) if (!tag) return NULL; - ret = parseId3Tag(tag); + ret = tag_id3_import(tag); id3_tag_delete(tag); #endif return ret; } -struct mpd_tag *apeDup(char *file) +struct mpd_tag *tag_ape_load(char *file) { struct mpd_tag *ret = NULL; FILE *fp; @@ -556,9 +556,9 @@ struct mpd_tag *apeDup(char *file) for (i = 0; i < 7; i++) { if (strcasecmp(key, apeItems[i]) == 0) { if (!ret) - ret = newMpdTag(); - addItemToMpdTagWithLen(ret, tagItems[i], - p, size); + ret = tag_new(); + tag_add_item_n(ret, tagItems[i], + p, size); } } } @@ -574,7 +574,7 @@ fail: return ret; } -struct mpd_tag *newMpdTag(void) +struct mpd_tag *tag_new(void) { struct mpd_tag *ret = xmalloc(sizeof(*ret)); ret->items = NULL; @@ -605,7 +605,7 @@ static void deleteItem(struct mpd_tag *tag, int idx) } } -void clearItemsFromMpdTag(struct mpd_tag *tag, enum tag_type type) +void tag_clear_items_by_type(struct mpd_tag *tag, enum tag_type type) { int i; @@ -636,13 +636,13 @@ static void clearMpdTag(struct mpd_tag *tag) tag->time = -1; } -void freeMpdTag(struct mpd_tag *tag) +void tag_free(struct mpd_tag *tag) { clearMpdTag(tag); free(tag); } -struct mpd_tag *mpdTagDup(struct mpd_tag *tag) +struct mpd_tag *tag_dup(struct mpd_tag *tag) { struct mpd_tag *ret; int i; @@ -650,17 +650,17 @@ struct mpd_tag *mpdTagDup(struct mpd_tag *tag) if (!tag) return NULL; - ret = newMpdTag(); + ret = tag_new(); ret->time = tag->time; for (i = 0; i < tag->numOfItems; i++) { - addItemToMpdTag(ret, tag->items[i].type, tag->items[i].value); + tag_add_item(ret, tag->items[i].type, tag->items[i].value); } return ret; } -int mpdTagsAreEqual(struct mpd_tag *tag1, struct mpd_tag *tag2) +int tag_equal(struct mpd_tag *tag1, struct mpd_tag *tag2) { int i; @@ -718,8 +718,8 @@ static void appendToTagItems(struct mpd_tag *tag, enum tag_type type, free(duplicated); } -void addItemToMpdTagWithLen(struct mpd_tag *tag, enum tag_type itemType, - const char *value, size_t len) +void tag_add_item_n(struct mpd_tag *tag, enum tag_type itemType, + const char *value, size_t len) { if (ignoreTagItems[itemType]) { |