tag: renamed MpdTag and MpdTagItem to struct tag, struct mpd_tag_item

Getting rid of CamelCase; not having typedefs also allows us to
forward-declare the structures.
This commit is contained in:
Max Kellermann 2008-08-29 09:38:11 +02:00
parent f42de62aa2
commit d0556dc983
21 changed files with 93 additions and 90 deletions

View File

@ -419,7 +419,7 @@ void closeAudioDevice(void)
audioOpened = 0; audioOpened = 0;
} }
void sendMetadataToAudioDevice(const MpdTag * tag) void sendMetadataToAudioDevice(const struct tag *tag)
{ {
unsigned int i; unsigned int i;

View File

@ -55,7 +55,7 @@ int isAudioDeviceOpen(void);
int isCurrentAudioFormat(const AudioFormat * audioFormat); int isCurrentAudioFormat(const AudioFormat * audioFormat);
void sendMetadataToAudioDevice(const MpdTag * tag); void sendMetadataToAudioDevice(const struct tag *tag);
/* these functions are called in the main parent process while the child /* these functions are called in the main parent process while the child
process is busy playing to the audio */ process is busy playing to the audio */

View File

@ -244,7 +244,8 @@ void finishAudioOutput(AudioOutput * audioOutput)
free(audioOutput->convBuffer); free(audioOutput->convBuffer);
} }
void sendMetadataToAudioOutput(AudioOutput * audioOutput, const MpdTag * tag) void sendMetadataToAudioOutput(AudioOutput * audioOutput,
const struct tag *tag)
{ {
if (!audioOutput->sendMetdataFunc) if (!audioOutput->sendMetdataFunc)
return; return;

View File

@ -50,7 +50,7 @@ typedef void (*AudioOutputDropBufferedAudioFunc) (AudioOutput * audioOutput);
typedef void (*AudioOutputCloseDeviceFunc) (AudioOutput * audioOutput); typedef void (*AudioOutputCloseDeviceFunc) (AudioOutput * audioOutput);
typedef void (*AudioOutputSendMetadataFunc) (AudioOutput * audioOutput, typedef void (*AudioOutputSendMetadataFunc) (AudioOutput * audioOutput,
const MpdTag * tag); const struct tag *tag);
struct _AudioOutput { struct _AudioOutput {
int open; int open;
@ -104,7 +104,8 @@ void dropBufferedAudioOutput(AudioOutput * audioOutput);
void closeAudioOutput(AudioOutput * audioOutput); void closeAudioOutput(AudioOutput * audioOutput);
void finishAudioOutput(AudioOutput * audioOutput); void finishAudioOutput(AudioOutput * audioOutput);
int keepAudioOutputAlive(AudioOutput * audioOutput, int ms); int keepAudioOutputAlive(AudioOutput * audioOutput, int ms);
void sendMetadataToAudioOutput(AudioOutput * audioOutput, const MpdTag * tag); void sendMetadataToAudioOutput(AudioOutput * audioOutput,
const struct tag *tag);
void printAllOutputPluginTypes(FILE * fp); void printAllOutputPluginTypes(FILE * fp);

View File

@ -56,7 +56,7 @@ typedef struct _ShoutData {
int opened; int opened;
MpdTag *tag; struct tag *tag;
int tagToSend; int tagToSend;
int timeout; int timeout;
@ -663,7 +663,7 @@ static int myShout_play(AudioOutput * audioOutput,
return 0; return 0;
} }
static void myShout_setTag(AudioOutput * audioOutput, MpdTag * tag) static void myShout_setTag(AudioOutput * audioOutput, struct tag *tag)
{ {
ShoutData *sd = (ShoutData *) audioOutput->data; ShoutData *sd = (ShoutData *) audioOutput->data;

View File

@ -257,7 +257,7 @@ static void freeListCommandItem(ListCommandItem * item)
static void visitTag(int fd, Song * song, enum tag_type tagType) static void visitTag(int fd, Song * song, enum tag_type tagType)
{ {
int i; int i;
MpdTag *tag = song->tag; struct tag *tag = song->tag;
if (tagType == LOCATE_TAG_FILE_TYPE) { if (tagType == LOCATE_TAG_FILE_TYPE) {
printSongUrl(fd, song); printSongUrl(fd, song);

View File

@ -74,7 +74,7 @@ typedef int (*decoder_file_decode_func) (struct decoder *, char *path);
/* file should be the full path! Returns NULL if a tag cannot be found /* file should be the full path! Returns NULL if a tag cannot be found
* or read */ * or read */
typedef MpdTag *(*decoder_tag_dup_func) (char *file); typedef struct tag *(*decoder_tag_dup_func) (char *file);
struct decoder_plugin { struct decoder_plugin {
const char *name; const char *name;

View File

@ -103,7 +103,7 @@ static const char *VORBIS_COMMENT_DISC_KEY = "discnumber";
static unsigned int commentMatchesAddToTag(const static unsigned int commentMatchesAddToTag(const
FLAC__StreamMetadata_VorbisComment_Entry FLAC__StreamMetadata_VorbisComment_Entry
* entry, unsigned int itemType, * entry, unsigned int itemType,
MpdTag ** tag) struct tag ** tag)
{ {
const char *str; const char *str;
size_t slen; size_t slen;
@ -136,8 +136,8 @@ static unsigned int commentMatchesAddToTag(const
return 0; return 0;
} }
MpdTag *copyVorbisCommentBlockToMpdTag(const FLAC__StreamMetadata * block, struct tag *copyVorbisCommentBlockToMpdTag(const FLAC__StreamMetadata * block,
MpdTag * tag) struct tag * tag)
{ {
unsigned int i, j; unsigned int i, j;
FLAC__StreamMetadata_VorbisComment_Entry *comments; FLAC__StreamMetadata_VorbisComment_Entry *comments;

View File

@ -149,7 +149,7 @@ typedef struct {
struct decoder *decoder; struct decoder *decoder;
InputStream *inStream; InputStream *inStream;
ReplayGainInfo *replayGainInfo; ReplayGainInfo *replayGainInfo;
MpdTag *tag; struct tag *tag;
} FlacData; } FlacData;
/* initializes a given FlacData struct */ /* initializes a given FlacData struct */
@ -161,8 +161,8 @@ void flac_error_common_cb(const char *plugin,
FLAC__StreamDecoderErrorStatus status, FLAC__StreamDecoderErrorStatus status,
FlacData * data); FlacData * data);
MpdTag *copyVorbisCommentBlockToMpdTag(const FLAC__StreamMetadata * block, struct tag *copyVorbisCommentBlockToMpdTag(const FLAC__StreamMetadata * block,
MpdTag * tag); struct tag *tag);
/* keep this inlined, this is just macro but prettier :) */ /* keep this inlined, this is just macro but prettier :) */
static inline int flacSendChunk(FlacData * data) static inline int flacSendChunk(FlacData * data)

View File

@ -572,9 +572,9 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
return 0; return 0;
} }
static MpdTag *aacTagDup(char *file) static struct tag *aacTagDup(char *file)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
int file_time = getAacTotalTime(file); int file_time = getAacTotalTime(file);
if (file_time >= 0) { if (file_time >= 0) {

View File

@ -120,9 +120,9 @@ static int audiofile_decode(struct decoder * decoder, char *path)
return 0; return 0;
} }
static MpdTag *audiofileTagDup(char *file) static struct tag *audiofileTagDup(char *file)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
int total_time = getAudiofileTotalTime(file); int total_time = getAudiofileTotalTime(file);
if (total_time >= 0) { if (total_time >= 0) {

View File

@ -290,9 +290,9 @@ static FLAC__StreamDecoderWriteStatus flacWrite(const flac_decoder *dec,
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
} }
static MpdTag *flacMetadataDup(char *file, int *vorbisCommentFound) static struct tag *flacMetadataDup(char *file, int *vorbisCommentFound)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
FLAC__Metadata_SimpleIterator *it; FLAC__Metadata_SimpleIterator *it;
FLAC__StreamMetadata *block = NULL; FLAC__StreamMetadata *block = NULL;
@ -348,9 +348,9 @@ static MpdTag *flacMetadataDup(char *file, int *vorbisCommentFound)
return ret; return ret;
} }
static MpdTag *flacTagDup(char *file) static struct tag *flacTagDup(char *file)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
int foundVorbisComment = 0; int foundVorbisComment = 0;
ret = flacMetadataDup(file, &foundVorbisComment); ret = flacMetadataDup(file, &foundVorbisComment);
@ -360,7 +360,7 @@ static MpdTag *flacTagDup(char *file)
return NULL; return NULL;
} }
if (!foundVorbisComment) { if (!foundVorbisComment) {
MpdTag *temp = id3Dup(file); struct tag *temp = id3Dup(file);
if (temp) { if (temp) {
temp->time = ret->time; temp->time = ret->time;
freeMpdTag(ret); freeMpdTag(ret);
@ -464,9 +464,9 @@ static int flac_decode(struct decoder * decoder, InputStream * inStream)
/* some of this stuff is duplicated from oggflac_plugin.c */ /* some of this stuff is duplicated from oggflac_plugin.c */
extern struct decoder_plugin oggflacPlugin; extern struct decoder_plugin oggflacPlugin;
static MpdTag *oggflac_tag_dup(char *file) static struct tag *oggflac_tag_dup(char *file)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
FLAC__Metadata_Iterator *it; FLAC__Metadata_Iterator *it;
FLAC__StreamMetadata *block; FLAC__StreamMetadata *block;
FLAC__Metadata_Chain *chain = FLAC__metadata_chain_new(); FLAC__Metadata_Chain *chain = FLAC__metadata_chain_new();

View File

@ -213,9 +213,9 @@ static int mod_decode(struct decoder * decoder, char *path)
return 0; return 0;
} }
static MpdTag *modTagDup(char *file) static struct tag *modTagDup(char *file)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
MODULE *moduleHandle; MODULE *moduleHandle;
char *title; char *title;

View File

@ -299,13 +299,13 @@ static ReplayGainInfo *parseId3ReplayGainInfo(struct id3_tag *tag)
#ifdef HAVE_ID3TAG #ifdef HAVE_ID3TAG
static void mp3_parseId3Tag(mp3DecodeData * data, size_t tagsize, static void mp3_parseId3Tag(mp3DecodeData * data, size_t tagsize,
MpdTag ** mpdTag, ReplayGainInfo ** replayGainInfo) struct tag ** mpdTag, ReplayGainInfo ** replayGainInfo)
{ {
struct id3_tag *id3Tag = NULL; struct id3_tag *id3Tag = NULL;
id3_length_t count; id3_length_t count;
id3_byte_t const *id3_data; id3_byte_t const *id3_data;
id3_byte_t *allocated = NULL; id3_byte_t *allocated = NULL;
MpdTag *tmpMpdTag; struct tag *tmpMpdTag;
ReplayGainInfo *tmpReplayGainInfo; ReplayGainInfo *tmpReplayGainInfo;
count = data->stream.bufend - data->stream.this_frame; count = data->stream.bufend - data->stream.this_frame;
@ -370,7 +370,7 @@ fail:
#endif #endif
static enum mp3_action static enum mp3_action
decodeNextFrameHeader(mp3DecodeData * data, MpdTag ** tag, decodeNextFrameHeader(mp3DecodeData * data, struct tag ** tag,
ReplayGainInfo ** replayGainInfo) ReplayGainInfo ** replayGainInfo)
{ {
enum mad_layer layer; enum mad_layer layer;
@ -685,7 +685,7 @@ static int parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen)
} }
static int decodeFirstFrame(mp3DecodeData * data, static int decodeFirstFrame(mp3DecodeData * data,
MpdTag ** tag, ReplayGainInfo ** replayGainInfo) struct tag ** tag, ReplayGainInfo ** replayGainInfo)
{ {
struct decoder *decoder = data->decoder; struct decoder *decoder = data->decoder;
struct xing xing; struct xing xing;
@ -813,7 +813,7 @@ static int getMp3TotalTime(char *file)
} }
static int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data, static int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data,
struct decoder * decoder, MpdTag ** tag, struct decoder * decoder, struct tag ** tag,
ReplayGainInfo ** replayGainInfo) ReplayGainInfo ** replayGainInfo)
{ {
initMp3DecodeData(data, decoder, inStream); initMp3DecodeData(data, decoder, inStream);
@ -896,7 +896,7 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo)
} }
if (data->inStream->metaTitle) { if (data->inStream->metaTitle) {
MpdTag *tag = newMpdTag(); struct tag *tag = newMpdTag();
if (data->inStream->metaName) { if (data->inStream->metaName) {
addItemToMpdTag(tag, addItemToMpdTag(tag,
TAG_ITEM_NAME, TAG_ITEM_NAME,
@ -1032,7 +1032,7 @@ static void initAudioFormatFromMp3DecodeData(mp3DecodeData * data,
static int mp3_decode(struct decoder * decoder, InputStream * inStream) static int mp3_decode(struct decoder * decoder, InputStream * inStream)
{ {
mp3DecodeData data; mp3DecodeData data;
MpdTag *tag = NULL; struct tag *tag = NULL;
ReplayGainInfo *replayGainInfo = NULL; ReplayGainInfo *replayGainInfo = NULL;
AudioFormat audio_format; AudioFormat audio_format;
@ -1092,9 +1092,9 @@ static int mp3_decode(struct decoder * decoder, InputStream * inStream)
return 0; return 0;
} }
static MpdTag *mp3_tagDup(char *file) static struct tag *mp3_tagDup(char *file)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
int total_time; int total_time;
ret = id3Dup(file); ret = id3Dup(file);

View File

@ -296,9 +296,9 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
return 0; return 0;
} }
static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound) static struct tag *mp4DataDup(char *file, int *mp4MetadataFound)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
InputStream inStream; InputStream inStream;
mp4ff_t *mp4fh; mp4ff_t *mp4fh;
mp4ff_callback_t *callback; mp4ff_callback_t *callback;
@ -385,16 +385,16 @@ static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound)
return ret; return ret;
} }
static MpdTag *mp4TagDup(char *file) static struct tag *mp4TagDup(char *file)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
int mp4MetadataFound = 0; int mp4MetadataFound = 0;
ret = mp4DataDup(file, &mp4MetadataFound); ret = mp4DataDup(file, &mp4MetadataFound);
if (!ret) if (!ret)
return NULL; return NULL;
if (!mp4MetadataFound) { if (!mp4MetadataFound) {
MpdTag *temp = id3Dup(file); struct tag *temp = id3Dup(file);
if (temp) { if (temp) {
temp->time = ret->time; temp->time = ret->time;
freeMpdTag(ret); freeMpdTag(ret);

View File

@ -279,9 +279,9 @@ static float mpcGetTime(char *file)
return total_time; return total_time;
} }
static MpdTag *mpcTagDup(char *file) static struct tag *mpcTagDup(char *file)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
float total_time = mpcGetTime(file); float total_time = mpcGetTime(file);
if (total_time < 0) { if (total_time < 0) {

View File

@ -140,7 +140,7 @@ static const char *VORBIS_COMMENT_DISC_KEY = "discnumber";
static unsigned int ogg_parseCommentAddToTag(char *comment, static unsigned int ogg_parseCommentAddToTag(char *comment,
unsigned int itemType, unsigned int itemType,
MpdTag ** tag) struct tag ** tag)
{ {
const char *needle; const char *needle;
unsigned int len; unsigned int len;
@ -168,9 +168,9 @@ static unsigned int ogg_parseCommentAddToTag(char *comment,
return 0; return 0;
} }
static MpdTag *oggCommentsParse(char **comments) static struct tag *oggCommentsParse(char **comments)
{ {
MpdTag *tag = NULL; struct tag *tag = NULL;
while (*comments) { while (*comments) {
int j; int j;
@ -187,7 +187,7 @@ static MpdTag *oggCommentsParse(char **comments)
static void putOggCommentsIntoOutputBuffer(char *streamName, static void putOggCommentsIntoOutputBuffer(char *streamName,
char **comments) char **comments)
{ {
MpdTag *tag; struct tag *tag;
tag = oggCommentsParse(comments); tag = oggCommentsParse(comments);
if (!tag && streamName) { if (!tag && streamName) {
@ -337,9 +337,9 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
return 0; return 0;
} }
static MpdTag *oggvorbis_TagDup(char *file) static struct tag *oggvorbis_TagDup(char *file)
{ {
MpdTag *ret; struct tag *ret;
FILE *fp; FILE *fp;
OggVorbis_File vf; OggVorbis_File vf;

View File

@ -281,10 +281,10 @@ static ReplayGainInfo *wavpack_replaygain(WavpackContext *wpc)
/* /*
* Reads metainfo from the specified file. * Reads metainfo from the specified file.
*/ */
static MpdTag *wavpack_tagdup(char *fname) static struct tag *wavpack_tagdup(char *fname)
{ {
WavpackContext *wpc; WavpackContext *wpc;
MpdTag *tag; struct tag *tag;
char error[ERRORLEN]; char error[ERRORLEN];
char *s; char *s;
int ssize; int ssize;

View File

@ -36,7 +36,7 @@
typedef struct _Song { typedef struct _Song {
char *url; char *url;
mpd_sint8 type; mpd_sint8 type;
MpdTag *tag; struct tag *tag;
struct _Directory *parentDir; struct _Directory *parentDir;
time_t mtime; time_t mtime;
} Song; } Song;

View File

@ -114,7 +114,7 @@ void printTagTypes(int fd)
} }
} }
void printMpdTag(int fd, MpdTag * tag) void printMpdTag(int fd, struct tag *tag)
{ {
int i; int i;
@ -164,8 +164,8 @@ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4,
return utf8; return utf8;
} }
static MpdTag *getID3Info( static struct tag *getID3Info(
struct id3_tag *tag, const char *id, int type, MpdTag * mpdTag) struct id3_tag *tag, const char *id, int type, struct tag *mpdTag)
{ {
struct id3_frame const *frame; struct id3_frame const *frame;
id3_ucs4_t const *ucs4; id3_ucs4_t const *ucs4;
@ -283,9 +283,9 @@ static MpdTag *getID3Info(
#endif #endif
#ifdef HAVE_ID3TAG #ifdef HAVE_ID3TAG
MpdTag *parseId3Tag(struct id3_tag * tag) struct tag *parseId3Tag(struct id3_tag * tag)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
ret = getID3Info(tag, ID3_FRAME_ARTIST, TAG_ITEM_ARTIST, ret); ret = getID3Info(tag, ID3_FRAME_ARTIST, TAG_ITEM_ARTIST, ret);
ret = getID3Info(tag, ID3_FRAME_TITLE, TAG_ITEM_TITLE, ret); ret = getID3Info(tag, ID3_FRAME_TITLE, TAG_ITEM_TITLE, ret);
@ -425,9 +425,9 @@ static struct id3_tag *findId3TagFromEnd(FILE * stream)
} }
#endif #endif
MpdTag *id3Dup(char *file) struct tag *id3Dup(char *file)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
#ifdef HAVE_ID3TAG #ifdef HAVE_ID3TAG
struct id3_tag *tag; struct id3_tag *tag;
FILE *stream; FILE *stream;
@ -453,9 +453,9 @@ MpdTag *id3Dup(char *file)
return ret; return ret;
} }
MpdTag *apeDup(char *file) struct tag *apeDup(char *file)
{ {
MpdTag *ret = NULL; struct tag *ret = NULL;
FILE *fp; FILE *fp;
int tagCount; int tagCount;
char *buffer = NULL; char *buffer = NULL;
@ -574,16 +574,16 @@ fail:
return ret; return ret;
} }
MpdTag *newMpdTag(void) struct tag *newMpdTag(void)
{ {
MpdTag *ret = xmalloc(sizeof(MpdTag)); struct tag *ret = xmalloc(sizeof(*ret));
ret->items = NULL; ret->items = NULL;
ret->time = -1; ret->time = -1;
ret->numOfItems = 0; ret->numOfItems = 0;
return ret; return ret;
} }
static void deleteItem(MpdTag * tag, int idx) static void deleteItem(struct tag *tag, int idx)
{ {
assert(idx < tag->numOfItems); assert(idx < tag->numOfItems);
tag->numOfItems--; tag->numOfItems--;
@ -598,14 +598,14 @@ static void deleteItem(MpdTag * tag, int idx)
if (tag->numOfItems > 0) { if (tag->numOfItems > 0) {
tag->items = xrealloc(tag->items, tag->items = xrealloc(tag->items,
tag->numOfItems * sizeof(MpdTagItem)); tag->numOfItems * sizeof(*tag->items));
} else { } else {
free(tag->items); free(tag->items);
tag->items = NULL; tag->items = NULL;
} }
} }
void clearItemsFromMpdTag(MpdTag * tag, enum tag_type type) void clearItemsFromMpdTag(struct tag *tag, enum tag_type type)
{ {
int i; int i;
@ -618,7 +618,7 @@ void clearItemsFromMpdTag(MpdTag * tag, enum tag_type type)
} }
} }
static void clearMpdTag(MpdTag * tag) static void clearMpdTag(struct tag *tag)
{ {
int i; int i;
@ -636,15 +636,15 @@ static void clearMpdTag(MpdTag * tag)
tag->time = -1; tag->time = -1;
} }
void freeMpdTag(MpdTag * tag) void freeMpdTag(struct tag *tag)
{ {
clearMpdTag(tag); clearMpdTag(tag);
free(tag); free(tag);
} }
MpdTag *mpdTagDup(MpdTag * tag) struct tag *mpdTagDup(struct tag *tag)
{ {
MpdTag *ret; struct tag *ret;
int i; int i;
if (!tag) if (!tag)
@ -660,7 +660,7 @@ MpdTag *mpdTagDup(MpdTag * tag)
return ret; return ret;
} }
int mpdTagsAreEqual(MpdTag * tag1, MpdTag * tag2) int mpdTagsAreEqual(struct tag *tag1, struct tag *tag2)
{ {
int i; int i;
@ -696,7 +696,7 @@ int mpdTagsAreEqual(MpdTag * tag1, MpdTag * tag2)
} \ } \
} }
static void appendToTagItems(MpdTag * tag, enum tag_type type, static void appendToTagItems(struct tag *tag, enum tag_type type,
const char *value, size_t len) const char *value, size_t len)
{ {
unsigned int i = tag->numOfItems; unsigned int i = tag->numOfItems;
@ -709,7 +709,8 @@ static void appendToTagItems(MpdTag * tag, enum tag_type type,
stripReturnChar(duplicated); stripReturnChar(duplicated);
tag->numOfItems++; tag->numOfItems++;
tag->items = xrealloc(tag->items, tag->numOfItems * sizeof(MpdTagItem)); tag->items = xrealloc(tag->items,
tag->numOfItems * sizeof(*tag->items));
tag->items[i].type = type; tag->items[i].type = type;
tag->items[i].value = getTagItemString(type, duplicated); tag->items[i].value = getTagItemString(type, duplicated);
@ -717,7 +718,7 @@ static void appendToTagItems(MpdTag * tag, enum tag_type type,
free(duplicated); free(duplicated);
} }
void addItemToMpdTagWithLen(MpdTag * tag, enum tag_type itemType, void addItemToMpdTagWithLen(struct tag *tag, enum tag_type itemType,
const char *value, size_t len) const char *value, size_t len)
{ {
if (ignoreTagItems[itemType]) if (ignoreTagItems[itemType])

View File

@ -45,34 +45,34 @@ enum tag_type {
extern const char *mpdTagItemKeys[]; extern const char *mpdTagItemKeys[];
typedef struct _MpdTagItem { struct tag_item {
enum tag_type type; enum tag_type type;
char *value; char *value;
} MpdTagItem; };
typedef struct _MpdTag { struct tag {
int time; int time;
MpdTagItem *items; struct tag_item *items;
mpd_uint8 numOfItems; mpd_uint8 numOfItems;
} MpdTag; };
#ifdef HAVE_ID3TAG #ifdef HAVE_ID3TAG
MpdTag *parseId3Tag(struct id3_tag *); struct tag *parseId3Tag(struct id3_tag *);
#endif #endif
MpdTag *apeDup(char *file); struct tag *apeDup(char *file);
MpdTag *id3Dup(char *file); struct tag *id3Dup(char *file);
MpdTag *newMpdTag(void); struct tag *newMpdTag(void);
void initTagConfig(void); void initTagConfig(void);
void clearItemsFromMpdTag(MpdTag * tag, enum tag_type itemType); void clearItemsFromMpdTag(struct tag *tag, enum tag_type itemType);
void freeMpdTag(MpdTag * tag); void freeMpdTag(struct tag *tag);
void addItemToMpdTagWithLen(MpdTag * tag, enum tag_type itemType, void addItemToMpdTagWithLen(struct tag *tag, enum tag_type itemType,
const char *value, size_t len); const char *value, size_t len);
#define addItemToMpdTag(tag, itemType, value) \ #define addItemToMpdTag(tag, itemType, value) \
@ -80,10 +80,10 @@ void addItemToMpdTagWithLen(MpdTag * tag, enum tag_type itemType,
void printTagTypes(int fd); void printTagTypes(int fd);
void printMpdTag(int fd, MpdTag * tag); void printMpdTag(int fd, struct tag *tag);
MpdTag *mpdTagDup(MpdTag * tag); struct tag *mpdTagDup(struct tag *tag);
int mpdTagsAreEqual(MpdTag * tag1, MpdTag * tag2); int mpdTagsAreEqual(struct tag *tag1, struct tag *tag2);
#endif #endif