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:
parent
f42de62aa2
commit
d0556dc983
@ -419,7 +419,7 @@ void closeAudioDevice(void)
|
||||
audioOpened = 0;
|
||||
}
|
||||
|
||||
void sendMetadataToAudioDevice(const MpdTag * tag)
|
||||
void sendMetadataToAudioDevice(const struct tag *tag)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
@ -55,7 +55,7 @@ int isAudioDeviceOpen(void);
|
||||
|
||||
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
|
||||
process is busy playing to the audio */
|
||||
|
@ -244,7 +244,8 @@ void finishAudioOutput(AudioOutput * audioOutput)
|
||||
free(audioOutput->convBuffer);
|
||||
}
|
||||
|
||||
void sendMetadataToAudioOutput(AudioOutput * audioOutput, const MpdTag * tag)
|
||||
void sendMetadataToAudioOutput(AudioOutput * audioOutput,
|
||||
const struct tag *tag)
|
||||
{
|
||||
if (!audioOutput->sendMetdataFunc)
|
||||
return;
|
||||
|
@ -50,7 +50,7 @@ typedef void (*AudioOutputDropBufferedAudioFunc) (AudioOutput * audioOutput);
|
||||
typedef void (*AudioOutputCloseDeviceFunc) (AudioOutput * audioOutput);
|
||||
|
||||
typedef void (*AudioOutputSendMetadataFunc) (AudioOutput * audioOutput,
|
||||
const MpdTag * tag);
|
||||
const struct tag *tag);
|
||||
|
||||
struct _AudioOutput {
|
||||
int open;
|
||||
@ -104,7 +104,8 @@ void dropBufferedAudioOutput(AudioOutput * audioOutput);
|
||||
void closeAudioOutput(AudioOutput * audioOutput);
|
||||
void finishAudioOutput(AudioOutput * audioOutput);
|
||||
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);
|
||||
|
||||
|
@ -56,7 +56,7 @@ typedef struct _ShoutData {
|
||||
|
||||
int opened;
|
||||
|
||||
MpdTag *tag;
|
||||
struct tag *tag;
|
||||
int tagToSend;
|
||||
|
||||
int timeout;
|
||||
@ -663,7 +663,7 @@ static int myShout_play(AudioOutput * audioOutput,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void myShout_setTag(AudioOutput * audioOutput, MpdTag * tag)
|
||||
static void myShout_setTag(AudioOutput * audioOutput, struct tag *tag)
|
||||
{
|
||||
ShoutData *sd = (ShoutData *) audioOutput->data;
|
||||
|
||||
|
@ -257,7 +257,7 @@ static void freeListCommandItem(ListCommandItem * item)
|
||||
static void visitTag(int fd, Song * song, enum tag_type tagType)
|
||||
{
|
||||
int i;
|
||||
MpdTag *tag = song->tag;
|
||||
struct tag *tag = song->tag;
|
||||
|
||||
if (tagType == LOCATE_TAG_FILE_TYPE) {
|
||||
printSongUrl(fd, song);
|
||||
|
@ -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
|
||||
* or read */
|
||||
typedef MpdTag *(*decoder_tag_dup_func) (char *file);
|
||||
typedef struct tag *(*decoder_tag_dup_func) (char *file);
|
||||
|
||||
struct decoder_plugin {
|
||||
const char *name;
|
||||
|
@ -103,7 +103,7 @@ static const char *VORBIS_COMMENT_DISC_KEY = "discnumber";
|
||||
static unsigned int commentMatchesAddToTag(const
|
||||
FLAC__StreamMetadata_VorbisComment_Entry
|
||||
* entry, unsigned int itemType,
|
||||
MpdTag ** tag)
|
||||
struct tag ** tag)
|
||||
{
|
||||
const char *str;
|
||||
size_t slen;
|
||||
@ -136,8 +136,8 @@ static unsigned int commentMatchesAddToTag(const
|
||||
return 0;
|
||||
}
|
||||
|
||||
MpdTag *copyVorbisCommentBlockToMpdTag(const FLAC__StreamMetadata * block,
|
||||
MpdTag * tag)
|
||||
struct tag *copyVorbisCommentBlockToMpdTag(const FLAC__StreamMetadata * block,
|
||||
struct tag * tag)
|
||||
{
|
||||
unsigned int i, j;
|
||||
FLAC__StreamMetadata_VorbisComment_Entry *comments;
|
||||
|
@ -149,7 +149,7 @@ typedef struct {
|
||||
struct decoder *decoder;
|
||||
InputStream *inStream;
|
||||
ReplayGainInfo *replayGainInfo;
|
||||
MpdTag *tag;
|
||||
struct tag *tag;
|
||||
} FlacData;
|
||||
|
||||
/* initializes a given FlacData struct */
|
||||
@ -161,8 +161,8 @@ void flac_error_common_cb(const char *plugin,
|
||||
FLAC__StreamDecoderErrorStatus status,
|
||||
FlacData * data);
|
||||
|
||||
MpdTag *copyVorbisCommentBlockToMpdTag(const FLAC__StreamMetadata * block,
|
||||
MpdTag * tag);
|
||||
struct tag *copyVorbisCommentBlockToMpdTag(const FLAC__StreamMetadata * block,
|
||||
struct tag *tag);
|
||||
|
||||
/* keep this inlined, this is just macro but prettier :) */
|
||||
static inline int flacSendChunk(FlacData * data)
|
||||
|
@ -572,9 +572,9 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
|
||||
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);
|
||||
|
||||
if (file_time >= 0) {
|
||||
|
@ -120,9 +120,9 @@ static int audiofile_decode(struct decoder * decoder, char *path)
|
||||
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);
|
||||
|
||||
if (total_time >= 0) {
|
||||
|
@ -290,9 +290,9 @@ static FLAC__StreamDecoderWriteStatus flacWrite(const flac_decoder *dec,
|
||||
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__StreamMetadata *block = NULL;
|
||||
|
||||
@ -348,9 +348,9 @@ static MpdTag *flacMetadataDup(char *file, int *vorbisCommentFound)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static MpdTag *flacTagDup(char *file)
|
||||
static struct tag *flacTagDup(char *file)
|
||||
{
|
||||
MpdTag *ret = NULL;
|
||||
struct tag *ret = NULL;
|
||||
int foundVorbisComment = 0;
|
||||
|
||||
ret = flacMetadataDup(file, &foundVorbisComment);
|
||||
@ -360,7 +360,7 @@ static MpdTag *flacTagDup(char *file)
|
||||
return NULL;
|
||||
}
|
||||
if (!foundVorbisComment) {
|
||||
MpdTag *temp = id3Dup(file);
|
||||
struct tag *temp = id3Dup(file);
|
||||
if (temp) {
|
||||
temp->time = ret->time;
|
||||
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 */
|
||||
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__StreamMetadata *block;
|
||||
FLAC__Metadata_Chain *chain = FLAC__metadata_chain_new();
|
||||
|
@ -213,9 +213,9 @@ static int mod_decode(struct decoder * decoder, char *path)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static MpdTag *modTagDup(char *file)
|
||||
static struct tag *modTagDup(char *file)
|
||||
{
|
||||
MpdTag *ret = NULL;
|
||||
struct tag *ret = NULL;
|
||||
MODULE *moduleHandle;
|
||||
char *title;
|
||||
|
||||
|
@ -299,13 +299,13 @@ static ReplayGainInfo *parseId3ReplayGainInfo(struct id3_tag *tag)
|
||||
|
||||
#ifdef HAVE_ID3TAG
|
||||
static void mp3_parseId3Tag(mp3DecodeData * data, size_t tagsize,
|
||||
MpdTag ** mpdTag, ReplayGainInfo ** replayGainInfo)
|
||||
struct tag ** mpdTag, ReplayGainInfo ** replayGainInfo)
|
||||
{
|
||||
struct id3_tag *id3Tag = NULL;
|
||||
id3_length_t count;
|
||||
id3_byte_t const *id3_data;
|
||||
id3_byte_t *allocated = NULL;
|
||||
MpdTag *tmpMpdTag;
|
||||
struct tag *tmpMpdTag;
|
||||
ReplayGainInfo *tmpReplayGainInfo;
|
||||
|
||||
count = data->stream.bufend - data->stream.this_frame;
|
||||
@ -370,7 +370,7 @@ fail:
|
||||
#endif
|
||||
|
||||
static enum mp3_action
|
||||
decodeNextFrameHeader(mp3DecodeData * data, MpdTag ** tag,
|
||||
decodeNextFrameHeader(mp3DecodeData * data, struct tag ** tag,
|
||||
ReplayGainInfo ** replayGainInfo)
|
||||
{
|
||||
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,
|
||||
MpdTag ** tag, ReplayGainInfo ** replayGainInfo)
|
||||
struct tag ** tag, ReplayGainInfo ** replayGainInfo)
|
||||
{
|
||||
struct decoder *decoder = data->decoder;
|
||||
struct xing xing;
|
||||
@ -813,7 +813,7 @@ static int getMp3TotalTime(char *file)
|
||||
}
|
||||
|
||||
static int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data,
|
||||
struct decoder * decoder, MpdTag ** tag,
|
||||
struct decoder * decoder, struct tag ** tag,
|
||||
ReplayGainInfo ** replayGainInfo)
|
||||
{
|
||||
initMp3DecodeData(data, decoder, inStream);
|
||||
@ -896,7 +896,7 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo)
|
||||
}
|
||||
|
||||
if (data->inStream->metaTitle) {
|
||||
MpdTag *tag = newMpdTag();
|
||||
struct tag *tag = newMpdTag();
|
||||
if (data->inStream->metaName) {
|
||||
addItemToMpdTag(tag,
|
||||
TAG_ITEM_NAME,
|
||||
@ -1032,7 +1032,7 @@ static void initAudioFormatFromMp3DecodeData(mp3DecodeData * data,
|
||||
static int mp3_decode(struct decoder * decoder, InputStream * inStream)
|
||||
{
|
||||
mp3DecodeData data;
|
||||
MpdTag *tag = NULL;
|
||||
struct tag *tag = NULL;
|
||||
ReplayGainInfo *replayGainInfo = NULL;
|
||||
AudioFormat audio_format;
|
||||
|
||||
@ -1092,9 +1092,9 @@ static int mp3_decode(struct decoder * decoder, InputStream * inStream)
|
||||
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;
|
||||
|
||||
ret = id3Dup(file);
|
||||
|
@ -296,9 +296,9 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
|
||||
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;
|
||||
mp4ff_t *mp4fh;
|
||||
mp4ff_callback_t *callback;
|
||||
@ -385,16 +385,16 @@ static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static MpdTag *mp4TagDup(char *file)
|
||||
static struct tag *mp4TagDup(char *file)
|
||||
{
|
||||
MpdTag *ret = NULL;
|
||||
struct tag *ret = NULL;
|
||||
int mp4MetadataFound = 0;
|
||||
|
||||
ret = mp4DataDup(file, &mp4MetadataFound);
|
||||
if (!ret)
|
||||
return NULL;
|
||||
if (!mp4MetadataFound) {
|
||||
MpdTag *temp = id3Dup(file);
|
||||
struct tag *temp = id3Dup(file);
|
||||
if (temp) {
|
||||
temp->time = ret->time;
|
||||
freeMpdTag(ret);
|
||||
|
@ -279,9 +279,9 @@ static float mpcGetTime(char *file)
|
||||
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);
|
||||
|
||||
if (total_time < 0) {
|
||||
|
@ -140,7 +140,7 @@ static const char *VORBIS_COMMENT_DISC_KEY = "discnumber";
|
||||
|
||||
static unsigned int ogg_parseCommentAddToTag(char *comment,
|
||||
unsigned int itemType,
|
||||
MpdTag ** tag)
|
||||
struct tag ** tag)
|
||||
{
|
||||
const char *needle;
|
||||
unsigned int len;
|
||||
@ -168,9 +168,9 @@ static unsigned int ogg_parseCommentAddToTag(char *comment,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static MpdTag *oggCommentsParse(char **comments)
|
||||
static struct tag *oggCommentsParse(char **comments)
|
||||
{
|
||||
MpdTag *tag = NULL;
|
||||
struct tag *tag = NULL;
|
||||
|
||||
while (*comments) {
|
||||
int j;
|
||||
@ -187,7 +187,7 @@ static MpdTag *oggCommentsParse(char **comments)
|
||||
static void putOggCommentsIntoOutputBuffer(char *streamName,
|
||||
char **comments)
|
||||
{
|
||||
MpdTag *tag;
|
||||
struct tag *tag;
|
||||
|
||||
tag = oggCommentsParse(comments);
|
||||
if (!tag && streamName) {
|
||||
@ -337,9 +337,9 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static MpdTag *oggvorbis_TagDup(char *file)
|
||||
static struct tag *oggvorbis_TagDup(char *file)
|
||||
{
|
||||
MpdTag *ret;
|
||||
struct tag *ret;
|
||||
FILE *fp;
|
||||
OggVorbis_File vf;
|
||||
|
||||
|
@ -281,10 +281,10 @@ static ReplayGainInfo *wavpack_replaygain(WavpackContext *wpc)
|
||||
/*
|
||||
* Reads metainfo from the specified file.
|
||||
*/
|
||||
static MpdTag *wavpack_tagdup(char *fname)
|
||||
static struct tag *wavpack_tagdup(char *fname)
|
||||
{
|
||||
WavpackContext *wpc;
|
||||
MpdTag *tag;
|
||||
struct tag *tag;
|
||||
char error[ERRORLEN];
|
||||
char *s;
|
||||
int ssize;
|
||||
|
@ -36,7 +36,7 @@
|
||||
typedef struct _Song {
|
||||
char *url;
|
||||
mpd_sint8 type;
|
||||
MpdTag *tag;
|
||||
struct tag *tag;
|
||||
struct _Directory *parentDir;
|
||||
time_t mtime;
|
||||
} Song;
|
||||
|
45
src/tag.c
45
src/tag.c
@ -114,7 +114,7 @@ void printTagTypes(int fd)
|
||||
}
|
||||
}
|
||||
|
||||
void printMpdTag(int fd, MpdTag * tag)
|
||||
void printMpdTag(int fd, struct tag *tag)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -164,8 +164,8 @@ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4,
|
||||
return utf8;
|
||||
}
|
||||
|
||||
static MpdTag *getID3Info(
|
||||
struct id3_tag *tag, const char *id, int type, MpdTag * mpdTag)
|
||||
static struct tag *getID3Info(
|
||||
struct id3_tag *tag, const char *id, int type, struct tag *mpdTag)
|
||||
{
|
||||
struct id3_frame const *frame;
|
||||
id3_ucs4_t const *ucs4;
|
||||
@ -283,9 +283,9 @@ static MpdTag *getID3Info(
|
||||
#endif
|
||||
|
||||
#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_TITLE, TAG_ITEM_TITLE, ret);
|
||||
@ -425,9 +425,9 @@ static struct id3_tag *findId3TagFromEnd(FILE * stream)
|
||||
}
|
||||
#endif
|
||||
|
||||
MpdTag *id3Dup(char *file)
|
||||
struct tag *id3Dup(char *file)
|
||||
{
|
||||
MpdTag *ret = NULL;
|
||||
struct tag *ret = NULL;
|
||||
#ifdef HAVE_ID3TAG
|
||||
struct id3_tag *tag;
|
||||
FILE *stream;
|
||||
@ -453,9 +453,9 @@ MpdTag *id3Dup(char *file)
|
||||
return ret;
|
||||
}
|
||||
|
||||
MpdTag *apeDup(char *file)
|
||||
struct tag *apeDup(char *file)
|
||||
{
|
||||
MpdTag *ret = NULL;
|
||||
struct tag *ret = NULL;
|
||||
FILE *fp;
|
||||
int tagCount;
|
||||
char *buffer = NULL;
|
||||
@ -574,16 +574,16 @@ fail:
|
||||
return ret;
|
||||
}
|
||||
|
||||
MpdTag *newMpdTag(void)
|
||||
struct tag *newMpdTag(void)
|
||||
{
|
||||
MpdTag *ret = xmalloc(sizeof(MpdTag));
|
||||
struct tag *ret = xmalloc(sizeof(*ret));
|
||||
ret->items = NULL;
|
||||
ret->time = -1;
|
||||
ret->numOfItems = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void deleteItem(MpdTag * tag, int idx)
|
||||
static void deleteItem(struct tag *tag, int idx)
|
||||
{
|
||||
assert(idx < tag->numOfItems);
|
||||
tag->numOfItems--;
|
||||
@ -598,14 +598,14 @@ static void deleteItem(MpdTag * tag, int idx)
|
||||
|
||||
if (tag->numOfItems > 0) {
|
||||
tag->items = xrealloc(tag->items,
|
||||
tag->numOfItems * sizeof(MpdTagItem));
|
||||
tag->numOfItems * sizeof(*tag->items));
|
||||
} else {
|
||||
free(tag->items);
|
||||
tag->items = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void clearItemsFromMpdTag(MpdTag * tag, enum tag_type type)
|
||||
void clearItemsFromMpdTag(struct tag *tag, enum tag_type type)
|
||||
{
|
||||
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;
|
||||
|
||||
@ -636,15 +636,15 @@ static void clearMpdTag(MpdTag * tag)
|
||||
tag->time = -1;
|
||||
}
|
||||
|
||||
void freeMpdTag(MpdTag * tag)
|
||||
void freeMpdTag(struct tag *tag)
|
||||
{
|
||||
clearMpdTag(tag);
|
||||
free(tag);
|
||||
}
|
||||
|
||||
MpdTag *mpdTagDup(MpdTag * tag)
|
||||
struct tag *mpdTagDup(struct tag *tag)
|
||||
{
|
||||
MpdTag *ret;
|
||||
struct tag *ret;
|
||||
int i;
|
||||
|
||||
if (!tag)
|
||||
@ -660,7 +660,7 @@ MpdTag *mpdTagDup(MpdTag * tag)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mpdTagsAreEqual(MpdTag * tag1, MpdTag * tag2)
|
||||
int mpdTagsAreEqual(struct tag *tag1, struct tag *tag2)
|
||||
{
|
||||
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)
|
||||
{
|
||||
unsigned int i = tag->numOfItems;
|
||||
@ -709,7 +709,8 @@ static void appendToTagItems(MpdTag * tag, enum tag_type type,
|
||||
stripReturnChar(duplicated);
|
||||
|
||||
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].value = getTagItemString(type, duplicated);
|
||||
@ -717,7 +718,7 @@ static void appendToTagItems(MpdTag * tag, enum tag_type type,
|
||||
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)
|
||||
{
|
||||
if (ignoreTagItems[itemType])
|
||||
|
30
src/tag.h
30
src/tag.h
@ -45,34 +45,34 @@ enum tag_type {
|
||||
|
||||
extern const char *mpdTagItemKeys[];
|
||||
|
||||
typedef struct _MpdTagItem {
|
||||
struct tag_item {
|
||||
enum tag_type type;
|
||||
char *value;
|
||||
} MpdTagItem;
|
||||
};
|
||||
|
||||
typedef struct _MpdTag {
|
||||
struct tag {
|
||||
int time;
|
||||
MpdTagItem *items;
|
||||
struct tag_item *items;
|
||||
mpd_uint8 numOfItems;
|
||||
} MpdTag;
|
||||
};
|
||||
|
||||
#ifdef HAVE_ID3TAG
|
||||
MpdTag *parseId3Tag(struct id3_tag *);
|
||||
struct tag *parseId3Tag(struct id3_tag *);
|
||||
#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 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);
|
||||
|
||||
#define addItemToMpdTag(tag, itemType, value) \
|
||||
@ -80,10 +80,10 @@ void addItemToMpdTagWithLen(MpdTag * tag, enum tag_type itemType,
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user