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
+3 -3
View File
@@ -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;
+3 -3
View File
@@ -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)
+2 -2
View File
@@ -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) {
+2 -2
View File
@@ -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) {
+7 -7
View File
@@ -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();
+2 -2
View File
@@ -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;
+9 -9
View File
@@ -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);
+5 -5
View 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);
+2 -2
View File
@@ -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) {
+6 -6
View File
@@ -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;
+2 -2
View File
@@ -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;