liboggz 1.1.3
oggz_comments.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2003 Commonwealth Scientific and Industrial Research
3 Organisation (CSIRO) Australia
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
7 are met:
8
9 - Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11
12 - Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15
16 - Neither the name of CSIRO Australia nor the names of its
17 contributors may be used to endorse or promote products derived from
18 this software without specific prior written permission.
19
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
24 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31*/
32
33#ifndef OGGZ_COMMENT_HEADER
34#define OGGZ_COMMENT_HEADER
35
86#include <oggz/oggz.h>
87
91typedef struct {
93 char * name;
94
96 char * value;
98
99#ifdef __cplusplus
100extern "C" {
101#endif
102
112const char *
113oggz_comment_get_vendor (OGGZ * oggz, long serialno);
114
128int
129oggz_comment_set_vendor (OGGZ * oggz, long serialno,
130 const char * vendor_string);
131
140const OggzComment *
141oggz_comment_first (OGGZ * oggz, long serialno);
142
153const OggzComment *
154oggz_comment_next (OGGZ * oggz, long serialno, const OggzComment * comment);
155
167const OggzComment *
168oggz_comment_first_byname (OGGZ * oggz, long serialno, char * name);
169
182const OggzComment *
183oggz_comment_next_byname (OGGZ * oggz, long serialno,
184 const OggzComment * comment);
185
196int
197oggz_comment_add (OGGZ * oggz, long serialno, OggzComment * comment);
198
210int
211oggz_comment_add_byname (OGGZ * oggz, long serialno,
212 const char * name, const char * value);
213
226int
227oggz_comment_remove (OGGZ * oggz, long serialno, OggzComment * comment);
228
240int
241oggz_comment_remove_byname (OGGZ * oggz, long serialno, char * name);
242
265ogg_packet *
266oggz_comments_generate(OGGZ * oggz, long serialno,
267 int FLAC_final_metadata_block);
268
269/*
270 * Copy comments between two streams.
271 * \param src A OGGZ* handle
272 * \param src_serialno Identify a logical bitstream within \a src
273 * \param dest A OGGZ* handle (created with OGGZ_WRITE)
274 * \param dest_serialno Identify a logical bitstream within \a dest
275 * \retval OGGZ_ERR_BAD \a oggz is not a valid OGGZ* handle
276 * \retval OGGZ_ERR_INVALID Operation not suitable for \a dest
277 */
278int
279oggz_comments_copy (OGGZ * src, long src_serialno,
280 OGGZ * dest, long dest_serialno);
281
287void oggz_packet_destroy (ogg_packet *packet);
288
289#ifdef __cplusplus
290}
291#endif
292
293#endif /* OGGZ_COMMENT_HEADER */
The liboggz C API.
void OGGZ
An opaque handle to an Ogg file.
Definition: oggz.h:441
int oggz_comment_set_vendor(OGGZ *oggz, long serialno, const char *vendor_string)
Set the vendor string.
int oggz_comment_remove(OGGZ *oggz, long serialno, OggzComment *comment)
Remove a comment.
ogg_packet * oggz_comments_generate(OGGZ *oggz, long serialno, int FLAC_final_metadata_block)
Output a comment packet for the specified stream.
void oggz_packet_destroy(ogg_packet *packet)
Free a packet and its payload.
const OggzComment * oggz_comment_first_byname(OGGZ *oggz, long serialno, char *name)
Retrieve the first comment with a given name.
int oggz_comment_remove_byname(OGGZ *oggz, long serialno, char *name)
Remove all comments with a given name.
const char * oggz_comment_get_vendor(OGGZ *oggz, long serialno)
Retrieve the vendor string.
const OggzComment * oggz_comment_next_byname(OGGZ *oggz, long serialno, const OggzComment *comment)
Retrieve the next comment following and with the same name as a given comment.
const OggzComment * oggz_comment_next(OGGZ *oggz, long serialno, const OggzComment *comment)
Retrieve the next comment.
int oggz_comment_add_byname(OGGZ *oggz, long serialno, const char *name, const char *value)
Add a comment by name and value.
int oggz_comment_add(OGGZ *oggz, long serialno, OggzComment *comment)
Add a comment.
const OggzComment * oggz_comment_first(OGGZ *oggz, long serialno)
Retrieve the first comment.
A comment.
Definition: oggz_comments.h:91
char * value
The value of the comment, as UTF-8.
Definition: oggz_comments.h:96
char * name
The name of the comment, eg.
Definition: oggz_comments.h:93