1 /* id3.h
2  *
3  * ID3 format
4  *
5  * Part of id3tool
6  *
7  * Copyright (C) 1999-2002, Christopher Collins
8 */
9 
10 /*  id3tool:  An editor for ID3 tags.
11  *  Copyright (C) 1999-2002  Christopher Collins
12  *
13  * This program was authored principly by Christopher Collins (aka
14  * Crossfire).
15  *
16  * Redistribution and use in source and binary forms, with or without
17  * modification, are permitted provided that the following conditions are
18  * met:
19  *
20  * 1. Redistributions of source code must retain the above copyright
21  *    notice, this list of conditions and the following disclaimer.
22  * 2. Redistributions in binary form must reproduce the above copyright
23  *    notice, this list of conditions and the following disclaimer in the
24  *    documentation and/or other materials provided with the distribution.
25  * 3. The name of the author, Christopher Collins, nor any of his
26  *    aliases may be used to endorse or promote products derived
27  *    from this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY CHRISTOPHER COLLINS ``AS IS'' AND ANY EXPRESS
30  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32  * DISCLAIMED.  IN NO EVENT SHALL CHRISTOPHER COLLINS BE LIABLE FOR ANY
33  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39  * SUCH DAMAGE.
40 */
41 
42 #ifndef _ID3_H
43 #define _ID3_H
44 
45 typedef struct id3tag_s {
46 	char		magic[3];
47 	char		songname[30];
48 	char		artist[30];
49 	char		album[30];
50 	char		year[4];
51 	union {
52 		struct {
53 			char		note[30];
54 		} v10;
55 		struct {
56 			char		note[28];
57 			char		marker;
58 			unsigned char	track;
59 		} v11;
60 	} note;
61 	unsigned char	style;
62 } id3tag_t;
63 
64 struct style_s {
65 	unsigned char	styleid;
66 	char		*name;
67 };
68 
69 extern struct style_s	id3_styles[];
70 
71 extern int	id3_readtag (FILE *fin, id3tag_t *id3tag);
72 extern int	id3_appendtag (FILE *fout, id3tag_t *id3tag);
73 extern int	id3_replacetag (FILE *fout, id3tag_t *id3tag);
74 extern void	id3_cleartag(id3tag_t *id3tag);
75 extern char	*id3_findstyle(int styleid);
76 
77 #endif /* #ifndef _ID3_H */
78