summaryrefslogtreecommitdiffabout
path: root/libid3tag
authorSergey Poznyakoff <gray@gnu.org.ua>2011-07-11 07:46:35 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2011-07-11 07:46:35 (GMT)
commit3eca38aa7fa33362df0acc9c17493ad027809437 (patch) (side-by-side diff)
tree95e544e82330a71ce4fee482ba57cb9511bb5b33 /libid3tag
parent8da9ed187d4e0b8b358e12a5fb69233601581772 (diff)
downloadidest-3eca38aa7fa33362df0acc9c17493ad027809437.tar.gz
idest-3eca38aa7fa33362df0acc9c17493ad027809437.tar.bz2
Minor change in the library.
* libid3tag/field.c: Add a missing break. * libid3tag/id3tag.h: Reindent.
Diffstat (limited to 'libid3tag') (more/less context) (ignore whitespace changes)
-rw-r--r--libid3tag/field.c3
-rw-r--r--libid3tag/id3tag.h264
2 files changed, 134 insertions, 133 deletions
diff --git a/libid3tag/field.c b/libid3tag/field.c
index b334b0c..ba47c92 100644
--- a/libid3tag/field.c
+++ b/libid3tag/field.c
@@ -66,7 +66,8 @@ id3_field_init(union id3_field *field, enum id3_field_type type)
case ID3_FIELD_TYPE_LATIN1LIST:
field->latin1list.nstrings = 0;
field->latin1list.strings = 0;
-
+ break;
+
case ID3_FIELD_TYPE_STRING:
case ID3_FIELD_TYPE_STRINGFULL:
field->string.ptr = 0;
diff --git a/libid3tag/id3tag.h b/libid3tag/id3tag.h
index ab442c1..5ec93a8 100644
--- a/libid3tag/id3tag.h
+++ b/libid3tag/id3tag.h
@@ -43,15 +43,15 @@ typedef unsigned short id3_utf16_t;
typedef signed char id3_utf8_t;
struct id3_tag {
- unsigned int refcount;
- unsigned int version;
- int flags;
- int extendedflags;
- int restrictions;
- int options;
- unsigned int nframes;
- struct id3_frame **frames;
- id3_length_t paddedsize;
+ unsigned int refcount;
+ unsigned int version;
+ int flags;
+ int extendedflags;
+ int restrictions;
+ int options;
+ unsigned int nframes;
+ struct id3_frame **frames;
+ id3_length_t paddedsize;
};
# define ID3_TAG_QUERYSIZE 10
@@ -73,176 +73,176 @@ struct id3_tag {
/* tag flags */
enum {
- ID3_TAG_FLAG_UNSYNCHRONISATION = 0x80,
- ID3_TAG_FLAG_EXTENDEDHEADER = 0x40,
- ID3_TAG_FLAG_EXPERIMENTALINDICATOR = 0x20,
- ID3_TAG_FLAG_FOOTERPRESENT = 0x10,
-
- ID3_TAG_FLAG_KNOWNFLAGS = 0xf0
+ ID3_TAG_FLAG_UNSYNCHRONISATION = 0x80,
+ ID3_TAG_FLAG_EXTENDEDHEADER = 0x40,
+ ID3_TAG_FLAG_EXPERIMENTALINDICATOR = 0x20,
+ ID3_TAG_FLAG_FOOTERPRESENT = 0x10,
+
+ ID3_TAG_FLAG_KNOWNFLAGS = 0xf0
};
/* tag extended flags */
enum {
- ID3_TAG_EXTENDEDFLAG_TAGISANUPDATE = 0x40,
- ID3_TAG_EXTENDEDFLAG_CRCDATAPRESENT = 0x20,
- ID3_TAG_EXTENDEDFLAG_TAGRESTRICTIONS = 0x10,
-
- ID3_TAG_EXTENDEDFLAG_KNOWNFLAGS = 0x70
+ ID3_TAG_EXTENDEDFLAG_TAGISANUPDATE = 0x40,
+ ID3_TAG_EXTENDEDFLAG_CRCDATAPRESENT = 0x20,
+ ID3_TAG_EXTENDEDFLAG_TAGRESTRICTIONS = 0x10,
+
+ ID3_TAG_EXTENDEDFLAG_KNOWNFLAGS = 0x70
};
/* tag restrictions */
enum {
- ID3_TAG_RESTRICTION_TAGSIZE_MASK = 0xc0,
- ID3_TAG_RESTRICTION_TAGSIZE_128_FRAMES_1_MB = 0x00,
- ID3_TAG_RESTRICTION_TAGSIZE_64_FRAMES_128_KB = 0x40,
- ID3_TAG_RESTRICTION_TAGSIZE_32_FRAMES_40_KB = 0x80,
- ID3_TAG_RESTRICTION_TAGSIZE_32_FRAMES_4_KB = 0xc0
+ ID3_TAG_RESTRICTION_TAGSIZE_MASK = 0xc0,
+ ID3_TAG_RESTRICTION_TAGSIZE_128_FRAMES_1_MB = 0x00,
+ ID3_TAG_RESTRICTION_TAGSIZE_64_FRAMES_128_KB = 0x40,
+ ID3_TAG_RESTRICTION_TAGSIZE_32_FRAMES_40_KB = 0x80,
+ ID3_TAG_RESTRICTION_TAGSIZE_32_FRAMES_4_KB = 0xc0
};
enum {
- ID3_TAG_RESTRICTION_TEXTENCODING_MASK = 0x20,
- ID3_TAG_RESTRICTION_TEXTENCODING_NONE = 0x00,
- ID3_TAG_RESTRICTION_TEXTENCODING_LATIN1_UTF8 = 0x20
+ ID3_TAG_RESTRICTION_TEXTENCODING_MASK = 0x20,
+ ID3_TAG_RESTRICTION_TEXTENCODING_NONE = 0x00,
+ ID3_TAG_RESTRICTION_TEXTENCODING_LATIN1_UTF8 = 0x20
};
enum {
- ID3_TAG_RESTRICTION_TEXTSIZE_MASK = 0x18,
- ID3_TAG_RESTRICTION_TEXTSIZE_NONE = 0x00,
- ID3_TAG_RESTRICTION_TEXTSIZE_1024_CHARS = 0x08,
- ID3_TAG_RESTRICTION_TEXTSIZE_128_CHARS = 0x10,
- ID3_TAG_RESTRICTION_TEXTSIZE_30_CHARS = 0x18
+ ID3_TAG_RESTRICTION_TEXTSIZE_MASK = 0x18,
+ ID3_TAG_RESTRICTION_TEXTSIZE_NONE = 0x00,
+ ID3_TAG_RESTRICTION_TEXTSIZE_1024_CHARS = 0x08,
+ ID3_TAG_RESTRICTION_TEXTSIZE_128_CHARS = 0x10,
+ ID3_TAG_RESTRICTION_TEXTSIZE_30_CHARS = 0x18
};
enum {
- ID3_TAG_RESTRICTION_IMAGEENCODING_MASK = 0x04,
- ID3_TAG_RESTRICTION_IMAGEENCODING_NONE = 0x00,
- ID3_TAG_RESTRICTION_IMAGEENCODING_PNG_JPEG = 0x04
+ ID3_TAG_RESTRICTION_IMAGEENCODING_MASK = 0x04,
+ ID3_TAG_RESTRICTION_IMAGEENCODING_NONE = 0x00,
+ ID3_TAG_RESTRICTION_IMAGEENCODING_PNG_JPEG = 0x04
};
enum {
- ID3_TAG_RESTRICTION_IMAGESIZE_MASK = 0x03,
- ID3_TAG_RESTRICTION_IMAGESIZE_NONE = 0x00,
- ID3_TAG_RESTRICTION_IMAGESIZE_256_256 = 0x01,
- ID3_TAG_RESTRICTION_IMAGESIZE_64_64 = 0x02,
- ID3_TAG_RESTRICTION_IMAGESIZE_64_64_EXACT = 0x03
+ ID3_TAG_RESTRICTION_IMAGESIZE_MASK = 0x03,
+ ID3_TAG_RESTRICTION_IMAGESIZE_NONE = 0x00,
+ ID3_TAG_RESTRICTION_IMAGESIZE_256_256 = 0x01,
+ ID3_TAG_RESTRICTION_IMAGESIZE_64_64 = 0x02,
+ ID3_TAG_RESTRICTION_IMAGESIZE_64_64_EXACT = 0x03
};
/* library options */
enum {
- ID3_TAG_OPTION_UNSYNCHRONISATION = 0x0001, /* use unsynchronisation */
- ID3_TAG_OPTION_COMPRESSION = 0x0002, /* use compression */
- ID3_TAG_OPTION_CRC = 0x0004, /* use CRC */
-
- ID3_TAG_OPTION_APPENDEDTAG = 0x0010, /* tag will be appended */
- ID3_TAG_OPTION_FILEALTERED = 0x0020, /* audio data was altered */
-
- ID3_TAG_OPTION_ID3V1 = 0x0100, /* render ID3v1/ID3v1.1 tag */
- ID3_TAG_OPTION_NO_ID3V2 = 0x0200, /* do not render ID3v2 tag */
+ ID3_TAG_OPTION_UNSYNCHRONISATION = 0x0001, /* use unsynchronisation */
+ ID3_TAG_OPTION_COMPRESSION = 0x0002, /* use compression */
+ ID3_TAG_OPTION_CRC = 0x0004, /* use CRC */
+
+ ID3_TAG_OPTION_APPENDEDTAG = 0x0010, /* tag will be appended */
+ ID3_TAG_OPTION_FILEALTERED = 0x0020, /* audio data was altered */
+
+ ID3_TAG_OPTION_ID3V1 = 0x0100, /* render ID3v1/ID3v1.1 tag */
+ ID3_TAG_OPTION_NO_ID3V2 = 0x0200, /* do not render ID3v2 tag */
};
struct id3_frame {
- char id[5];
- char const *description;
- unsigned int refcount;
- int flags;
- int group_id;
- int encryption_method;
- id3_byte_t *encoded;
- id3_length_t encoded_length;
- id3_length_t decoded_length;
- unsigned int nfields;
- union id3_field *fields;
+ char id[5];
+ char const *description;
+ unsigned int refcount;
+ int flags;
+ int group_id;
+ int encryption_method;
+ id3_byte_t *encoded;
+ id3_length_t encoded_length;
+ id3_length_t decoded_length;
+ unsigned int nfields;
+ union id3_field *fields;
};
enum {
- /* frame status flags */
- ID3_FRAME_FLAG_TAGALTERPRESERVATION = 0x4000,
- ID3_FRAME_FLAG_FILEALTERPRESERVATION = 0x2000,
- ID3_FRAME_FLAG_READONLY = 0x1000,
-
- ID3_FRAME_FLAG_STATUSFLAGS = 0xff00,
-
- /* frame format flags */
- ID3_FRAME_FLAG_GROUPINGIDENTITY = 0x0040,
- ID3_FRAME_FLAG_COMPRESSION = 0x0008,
- ID3_FRAME_FLAG_ENCRYPTION = 0x0004,
- ID3_FRAME_FLAG_UNSYNCHRONISATION = 0x0002,
- ID3_FRAME_FLAG_DATALENGTHINDICATOR = 0x0001,
-
- ID3_FRAME_FLAG_FORMATFLAGS = 0x00ff,
-
- ID3_FRAME_FLAG_KNOWNFLAGS = 0x704f
+ /* frame status flags */
+ ID3_FRAME_FLAG_TAGALTERPRESERVATION = 0x4000,
+ ID3_FRAME_FLAG_FILEALTERPRESERVATION = 0x2000,
+ ID3_FRAME_FLAG_READONLY = 0x1000,
+
+ ID3_FRAME_FLAG_STATUSFLAGS = 0xff00,
+
+ /* frame format flags */
+ ID3_FRAME_FLAG_GROUPINGIDENTITY = 0x0040,
+ ID3_FRAME_FLAG_COMPRESSION = 0x0008,
+ ID3_FRAME_FLAG_ENCRYPTION = 0x0004,
+ ID3_FRAME_FLAG_UNSYNCHRONISATION = 0x0002,
+ ID3_FRAME_FLAG_DATALENGTHINDICATOR = 0x0001,
+
+ ID3_FRAME_FLAG_FORMATFLAGS = 0x00ff,
+
+ ID3_FRAME_FLAG_KNOWNFLAGS = 0x704f
};
enum id3_field_type {
- ID3_FIELD_TYPE_TEXTENCODING,
- ID3_FIELD_TYPE_LATIN1,
- ID3_FIELD_TYPE_LATIN1FULL,
- ID3_FIELD_TYPE_LATIN1LIST,
- ID3_FIELD_TYPE_STRING,
- ID3_FIELD_TYPE_STRINGFULL,
- ID3_FIELD_TYPE_STRINGLIST,
- ID3_FIELD_TYPE_LANGUAGE,
- ID3_FIELD_TYPE_FRAMEID,
- ID3_FIELD_TYPE_DATE,
- ID3_FIELD_TYPE_INT8,
- ID3_FIELD_TYPE_INT16,
- ID3_FIELD_TYPE_INT24,
- ID3_FIELD_TYPE_INT32,
- ID3_FIELD_TYPE_INT32PLUS,
- ID3_FIELD_TYPE_BINARYDATA
+ ID3_FIELD_TYPE_TEXTENCODING,
+ ID3_FIELD_TYPE_LATIN1,
+ ID3_FIELD_TYPE_LATIN1FULL,
+ ID3_FIELD_TYPE_LATIN1LIST,
+ ID3_FIELD_TYPE_STRING,
+ ID3_FIELD_TYPE_STRINGFULL,
+ ID3_FIELD_TYPE_STRINGLIST,
+ ID3_FIELD_TYPE_LANGUAGE,
+ ID3_FIELD_TYPE_FRAMEID,
+ ID3_FIELD_TYPE_DATE,
+ ID3_FIELD_TYPE_INT8,
+ ID3_FIELD_TYPE_INT16,
+ ID3_FIELD_TYPE_INT24,
+ ID3_FIELD_TYPE_INT32,
+ ID3_FIELD_TYPE_INT32PLUS,
+ ID3_FIELD_TYPE_BINARYDATA
};
enum id3_field_textencoding {
- ID3_FIELD_TEXTENCODING_ISO_8859_1 = 0x00,
- ID3_FIELD_TEXTENCODING_UTF_16 = 0x01,
- ID3_FIELD_TEXTENCODING_UTF_16BE = 0x02,
- ID3_FIELD_TEXTENCODING_UTF_8 = 0x03
+ ID3_FIELD_TEXTENCODING_ISO_8859_1 = 0x00,
+ ID3_FIELD_TEXTENCODING_UTF_16 = 0x01,
+ ID3_FIELD_TEXTENCODING_UTF_16BE = 0x02,
+ ID3_FIELD_TEXTENCODING_UTF_8 = 0x03
};
union id3_field {
- enum id3_field_type type;
- struct {
- enum id3_field_type type;
- signed long value;
- } number;
- struct {
- enum id3_field_type type;
- id3_latin1_t *ptr;
- } latin1;
- struct {
- enum id3_field_type type;
- unsigned int nstrings;
- id3_latin1_t **strings;
- } latin1list;
- struct {
- enum id3_field_type type;
- id3_ucs4_t *ptr;
- } string;
- struct {
- enum id3_field_type type;
- unsigned int nstrings;
- id3_ucs4_t **strings;
- } stringlist;
- struct {
- enum id3_field_type type;
- char value[9];
- } immediate;
- struct {
- enum id3_field_type type;
- id3_byte_t *data;
- id3_length_t length;
- } binary;
+ enum id3_field_type type;
+ struct {
+ enum id3_field_type type;
+ signed long value;
+ } number;
+ struct {
+ enum id3_field_type type;
+ id3_latin1_t *ptr;
+ } latin1;
+ struct {
+ enum id3_field_type type;
+ unsigned int nstrings;
+ id3_latin1_t **strings;
+ } latin1list;
+ struct {
+ enum id3_field_type type;
+ id3_ucs4_t *ptr;
+ } string;
+ struct {
+ enum id3_field_type type;
+ unsigned int nstrings;
+ id3_ucs4_t **strings;
+ } stringlist;
+ struct {
+ enum id3_field_type type;
+ char value[9];
+ } immediate;
+ struct {
+ enum id3_field_type type;
+ id3_byte_t *data;
+ id3_length_t length;
+ } binary;
};
/* file interface */
enum id3_file_mode {
- ID3_FILE_MODE_READONLY = 0,
- ID3_FILE_MODE_READWRITE
+ ID3_FILE_MODE_READONLY = 0,
+ ID3_FILE_MODE_READWRITE
};
struct id3_file *id3_file_open(char const *, enum id3_file_mode);

Return to:

Send suggestions and report system problems to the System administrator.