Recognizes if input is ogg or not.
[xiph.git] / vorbis-tools / vorbiscomment / vcedit.h
blob173876f355c0b4cd15c58cd6aeaa47e73734480b
1 /* This program is licensed under the GNU Library General Public License, version 2,
2 * a copy of which is included with this program (with filename LICENSE.LGPL).
4 * (c) 2000-2001 Michael Smith <msmith@xiph.org>
6 * VCEdit header.
8 * last modified: $ID:$
9 */
11 #ifndef __VCEDIT_H
12 #define __VCEDIT_H
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
18 #include <stdio.h>
19 #include <ogg/ogg.h>
20 #include <vorbis/codec.h>
22 typedef size_t (*vcedit_read_func)(void *, size_t, size_t, void *);
23 typedef size_t (*vcedit_write_func)(const void *, size_t, size_t, void *);
25 typedef struct {
26 long *streams;
27 size_t streams_len;
28 } vcedit_serial_nos;
30 typedef struct {
31 ogg_sync_state *oy;
32 ogg_stream_state *os;
34 vorbis_comment *vc;
35 vorbis_info *vi;
37 vcedit_read_func read;
38 vcedit_write_func write;
40 void *in;
41 int serial;
42 vcedit_serial_nos serials;
43 unsigned char *mainbuf;
44 unsigned char *bookbuf;
45 int mainlen;
46 int booklen;
47 char *lasterror;
48 char *vendor;
49 int prevW;
50 int extrapage;
51 int eosin;
52 struct vcedit_buffer_chain *sidebuf;
53 } vcedit_state;
55 extern vcedit_state * vcedit_new_state(void);
56 extern void vcedit_clear(vcedit_state *state);
57 extern vorbis_comment * vcedit_comments(vcedit_state *state);
58 extern int vcedit_open(vcedit_state *state, FILE *in);
59 extern int vcedit_open_callbacks(vcedit_state *state, void *in,
60 vcedit_read_func read_func, vcedit_write_func write_func);
61 extern int vcedit_write(vcedit_state *state, void *out);
62 extern char * vcedit_error(vcedit_state *state);
64 #ifdef __cplusplus
66 #endif
68 #endif /* __VCEDIT_H */