liboggz: oggz_comments.h Source File

liboggz 1.1.1

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_H__
34 #define __OGGZ_COMMENT_H__
35
86 #include <oggz/oggz.h>
87
91 typedef struct {
93 char * name;
94
96 char * value;
97 } OggzComment;
98
99 #ifdef __cplusplus
100 extern "C" {
101 #endif
102
112 const char *
113 oggz_comment_get_vendor (OGGZ * oggz, long serialno);
114
128 int
129 oggz_comment_set_vendor (OGGZ * oggz, long serialno,
130 const char * vendor_string);
131
140 const OggzComment *
141 oggz_comment_first (OGGZ * oggz, long serialno);
142
153 const OggzComment *
154 oggz_comment_next (OGGZ * oggz, long serialno, const OggzComment * comment);
155
167 const OggzComment *
168 oggz_comment_first_byname (OGGZ * oggz, long serialno, char * name);
169
182 const OggzComment *
183 oggz_comment_next_byname (OGGZ * oggz, long serialno,
184 const OggzComment * comment);
185
196 int
197 oggz_comment_add (OGGZ * oggz, long serialno, OggzComment * comment);
198
210 int
211 oggz_comment_add_byname (OGGZ * oggz, long serialno,
212 const char * name, const char * value);
213
226 int
227 oggz_comment_remove (OGGZ * oggz, long serialno, OggzComment * comment);
228
240 int
241 oggz_comment_remove_byname (OGGZ * oggz, long serialno, char * name);
242
265 ogg_packet *
266 oggz_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 */
278 int
279 oggz_comments_copy (OGGZ * src, long src_serialno,
280 OGGZ * dest, long dest_serialno);
281
287 void oggz_packet_destroy (ogg_packet *packet);
288
289 #ifdef __cplusplus
290 }
291 #endif
292
293 #endif /* __OGGZ_COMMENTS_H__ */
oggz.h
oggz_comment_set_vendor
int oggz_comment_set_vendor(OGGZ *oggz, long serialno, const char *vendor_string)
Set the vendor string.
oggz_comment_add
int oggz_comment_add(OGGZ *oggz, long serialno, OggzComment *comment)
Add a comment.
OGGZ
void OGGZ
An opaque handle to an Ogg file.
Definition: oggz.h:441
oggz_comment_remove
int oggz_comment_remove(OGGZ *oggz, long serialno, OggzComment *comment)
Remove a comment.
OggzComment::name
char * name
The name of the comment, eg.
Definition: oggz_comments.h:93
oggz_comment_next
const OggzComment * oggz_comment_next(OGGZ *oggz, long serialno, const OggzComment *comment)
Retrieve the next comment.
oggz_comments_generate
ogg_packet * oggz_comments_generate(OGGZ *oggz, long serialno, int FLAC_final_metadata_block)
Output a comment packet for the specified stream.
OggzComment::value
char * value
The value of the comment, as UTF-8.
Definition: oggz_comments.h:96
oggz_comment_get_vendor
const char * oggz_comment_get_vendor(OGGZ *oggz, long serialno)
Retrieve the vendor string.
oggz_comment_first_byname
const OggzComment * oggz_comment_first_byname(OGGZ *oggz, long serialno, char *name)
Retrieve the first comment with a given name.
OggzComment
A comment.
Definition: oggz_comments.h:91
oggz_packet_destroy
void oggz_packet_destroy(ogg_packet *packet)
Free a packet and its payload.
oggz_comment_next_byname
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.
oggz_comment_add_byname
int oggz_comment_add_byname(OGGZ *oggz, long serialno, const char *name, const char *value)
Add a comment by name and value.
oggz_comment_remove_byname
int oggz_comment_remove_byname(OGGZ *oggz, long serialno, char *name)
Remove all comments with a given name.
oggz_comment_first
const OggzComment * oggz_comment_first(OGGZ *oggz, long serialno)
Retrieve the first comment.