aboutsummaryrefslogtreecommitdiff
path: root/libid3tag
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-03-20 13:33:11 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2011-03-20 14:01:39 +0200
commit58bc8166fca5ba0f86c07636a7ad71ee1457ec38 (patch)
treeb66816aae86afb8b0a5cf784cd89f9abdea776aa /libid3tag
parent929d8a0d47e8741093bbfd024715a1c7a08cae9e (diff)
downloadidest-58bc8166fca5ba0f86c07636a7ad71ee1457ec38.tar.gz
idest-58bc8166fca5ba0f86c07636a7ad71ee1457ec38.tar.bz2
Reindent libid3tag sources.
Diffstat (limited to 'libid3tag')
-rw-r--r--libid3tag/compat.h4
-rw-r--r--libid3tag/crc.c66
-rw-r--r--libid3tag/crc.h4
-rw-r--r--libid3tag/debug.c272
-rw-r--r--libid3tag/debug.h4
-rw-r--r--libid3tag/field.c1333
-rw-r--r--libid3tag/field.h4
-rw-r--r--libid3tag/file.c1221
-rw-r--r--libid3tag/file.h4
-rw-r--r--libid3tag/frame.c1036
-rw-r--r--libid3tag/frame.h4
-rw-r--r--libid3tag/frametype.h4
-rw-r--r--libid3tag/genre.c174
-rw-r--r--libid3tag/genre.h4
-rw-r--r--libid3tag/global.h4
-rw-r--r--libid3tag/id3tag.h4
-rw-r--r--libid3tag/latin1.c239
-rw-r--r--libid3tag/latin1.h4
-rw-r--r--libid3tag/parse.c297
-rw-r--r--libid3tag/parse.h4
-rw-r--r--libid3tag/render.c278
-rw-r--r--libid3tag/render.h4
-rw-r--r--libid3tag/tag.c1478
-rw-r--r--libid3tag/tag.h4
-rw-r--r--libid3tag/ucs4.c250
-rw-r--r--libid3tag/ucs4.h4
-rw-r--r--libid3tag/utf16.c383
-rw-r--r--libid3tag/utf16.h4
-rw-r--r--libid3tag/utf8.c556
-rw-r--r--libid3tag/utf8.h4
-rw-r--r--libid3tag/util.c200
-rw-r--r--libid3tag/util.h4
-rw-r--r--libid3tag/version.c38
-rw-r--r--libid3tag/version.h4
34 files changed, 4168 insertions, 3729 deletions
diff --git a/libid3tag/compat.h b/libid3tag/compat.h
index 8af71ec..eb51f44 100644
--- a/libid3tag/compat.h
+++ b/libid3tag/compat.h
@@ -19,7 +19,7 @@
19 * $Id: compat.h,v 1.8 2004/01/23 09:41:32 rob Exp $ 19 * $Id: compat.h,v 1.8 2004/01/23 09:41:32 rob Exp $
20 */ 20 */
21 21
22# ifndef LIBID3TAG_COMPAT_H 22#ifndef LIBID3TAG_COMPAT_H
23# define LIBID3TAG_COMPAT_H 23# define LIBID3TAG_COMPAT_H
24 24
25# include "id3tag.h" 25# include "id3tag.h"
@@ -38,4 +38,4 @@ struct id3_compat const *id3_compat_lookup(register char const *,
38 38
39int id3_compat_fixup(struct id3_tag *); 39int id3_compat_fixup(struct id3_tag *);
40 40
41# endif 41#endif
diff --git a/libid3tag/crc.c b/libid3tag/crc.c
index 742a5d8..de56ecd 100644
--- a/libid3tag/crc.c
+++ b/libid3tag/crc.c
@@ -19,17 +19,16 @@
19 * $Id: crc.c,v 1.11 2004/02/17 02:04:10 rob Exp $ 19 * $Id: crc.c,v 1.11 2004/02/17 02:04:10 rob Exp $
20 */ 20 */
21 21
22# ifdef HAVE_CONFIG_H 22#ifdef HAVE_CONFIG_H
23# include "config.h" 23# include "config.h"
24# endif 24#endif
25 25
26# include "global.h" 26#include "global.h"
27 27
28# include "id3tag.h" 28#include "id3tag.h"
29# include "crc.h" 29#include "crc.h"
30 30
31static 31static unsigned long const crc_table[256] = {
32unsigned long const crc_table[256] = {
33 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 32 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL,
34 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 33 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L,
35 0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L, 34 0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L,
@@ -107,31 +106,32 @@ unsigned long const crc_table[256] = {
107 * NAME: crc->compute() 106 * NAME: crc->compute()
108 * DESCRIPTION: calculate CRC-32 value (ISO 3309) 107 * DESCRIPTION: calculate CRC-32 value (ISO 3309)
109 */ 108 */
110unsigned long id3_crc_compute(id3_byte_t const *data, id3_length_t length) 109unsigned long
110id3_crc_compute(id3_byte_t const *data, id3_length_t length)
111{ 111{
112 register unsigned long crc; 112 register unsigned long crc;
113 113
114 for (crc = 0xffffffffL; length >= 8; length -= 8) { 114 for (crc = 0xffffffffL; length >= 8; length -= 8) {
115 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 115 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
116 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 116 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
117 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 117 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
118 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 118 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
119 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 119 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
120 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 120 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
121 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 121 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
122 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 122 crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
123 } 123 }
124 124
125 switch (length) { 125 switch (length) {
126 case 7: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 126 case 7: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
127 case 6: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 127 case 6: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
128 case 5: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 128 case 5: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
129 case 4: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 129 case 4: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
130 case 3: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 130 case 3: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
131 case 2: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 131 case 2: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
132 case 1: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8); 132 case 1: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
133 case 0: break; 133 case 0: break;
134 } 134 }
135 135
136 return crc ^ 0xffffffffL; 136 return crc ^ 0xffffffffL;
137} 137}
diff --git a/libid3tag/crc.h b/libid3tag/crc.h
index 89a5a39..055be13 100644
--- a/libid3tag/crc.h
+++ b/libid3tag/crc.h
@@ -19,11 +19,11 @@
19 * $Id: crc.h,v 1.8 2004/02/17 02:04:10 rob Exp $ 19 * $Id: crc.h,v 1.8 2004/02/17 02:04:10 rob Exp $
20 */ 20 */
21 21
22# ifndef LIBID3TAG_CRC_H 22#ifndef LIBID3TAG_CRC_H
23# define LIBID3TAG_CRC_H 23# define LIBID3TAG_CRC_H
24 24
25# include "id3tag.h" 25# include "id3tag.h"
26 26
27unsigned long id3_crc_compute(id3_byte_t const *, id3_length_t); 27unsigned long id3_crc_compute(id3_byte_t const *, id3_length_t);
28 28
29# endif 29#endif
diff --git a/libid3tag/debug.c b/libid3tag/debug.c
index d91a2c5..a8933be 100644
--- a/libid3tag/debug.c
+++ b/libid3tag/debug.c
@@ -19,204 +19,212 @@
19 * $Id: debug.c,v 1.8 2004/01/23 09:41:32 rob Exp $ 19 * $Id: debug.c,v 1.8 2004/01/23 09:41:32 rob Exp $
20 */ 20 */
21 21
22# ifdef HAVE_CONFIG_H 22#ifdef HAVE_CONFIG_H
23# include "config.h" 23# include "config.h"
24# endif 24#endif
25 25
26# include "global.h" 26#include "global.h"
27 27
28# undef malloc 28#undef malloc
29# undef calloc 29#undef calloc
30# undef realloc 30#undef realloc
31# undef free 31#undef free
32 32
33# include <stdio.h> 33#include <stdio.h>
34# include <stdlib.h> 34#include <stdlib.h>
35# include <string.h> 35#include <string.h>
36 36
37# include "debug.h" 37#include "debug.h"
38 38
39# if defined(DEBUG) 39#if defined(DEBUG)
40 40
41# define DEBUG_MAGIC 0xdeadbeefL 41# define DEBUG_MAGIC 0xdeadbeefL
42 42
43struct debug { 43struct debug {
44 char const *file; 44 char const *file;
45 unsigned int line; 45 unsigned int line;
46 size_t size; 46 size_t size;
47 struct debug *next; 47 struct debug *next;
48 struct debug *prev; 48 struct debug *prev;
49 long int magic; 49 long int magic;
50}; 50};
51 51
52static struct debug *allocated; 52static struct debug *allocated;
53static int registered; 53static int registered;
54 54
55static 55static void
56void check(void) 56check(void)
57{ 57{
58 struct debug *debug; 58 struct debug *debug;
59 59
60 for (debug = allocated; debug; debug = debug->next) { 60 for (debug = allocated; debug; debug = debug->next) {
61 if (debug->magic != DEBUG_MAGIC) { 61 if (debug->magic != D