minor formatting
[platform/upstream/flac.git] / src / plugin_common / id3v2.h
1 /* plugin_common - Routines common to several plugins
2  * Copyright (C) 2002,2003,2004  Josh Coalson
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17  */
18
19 #ifndef FLAC__PLUGIN_COMMON__ID3V2_H
20 #define FLAC__PLUGIN_COMMON__ID3V2_H
21
22 #include "FLAC/ordinals.h"
23
24 /*
25  * This is a simple structure that holds pointers to field values (in ASCII)
26  * for fields we care about.
27  */
28 typedef struct {
29         char *title;
30         char *composer;
31         char *performer;
32         char *album;
33         char *year_recorded;
34         char *year_performed;
35         char *track_number;
36         char *tracks_in_album;
37         char *genre;
38         char *comment;
39 } FLAC_Plugin__Id3v2_Tag;
40
41 /* Fills up an existing FLAC_Plugin__Id3v2_Tag.  All pointers must be NULL on
42  * entry or the function will return false.  For any field for which there is
43  * no corresponding ID3 frame, it's pointer will be NULL.
44  *
45  * If loading fails, all pointers will be cleared and the function will return
46  * false.
47  *
48  * If the function returns true, be sure to call FLAC_plugin__id3v2_tag_clear()
49  * when you are done with 'tag'.
50  */
51 FLAC__bool FLAC_plugin__id3v2_tag_get(const char *filename, FLAC_Plugin__Id3v2_Tag *tag);
52
53 /* free()s any non-NULL pointers in 'tag'.  Does NOT free(tag).
54  */
55 void FLAC_plugin__id3v2_tag_clear(FLAC_Plugin__Id3v2_Tag *tag);
56
57 #endif