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). 3 * 4 * (c) 2000-2001 Michael Smith <msmith@xiph.org> 5 * 6 * VCEdit header. 7 * 8 * last modified: $ID:$ 9 */ 10 11 #ifndef __VCEDIT_H 12 #define __VCEDIT_H 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif 17 18 #include <stdio.h> 19 #include <ogg/ogg.h> 20 #include <vorbis/codec.h> 21 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 *); 24 25 typedef struct { 26 ogg_sync_state *oy; 27 ogg_stream_state *os; 28 29 vorbis_comment *vc; 30 vorbis_info *vi; 31 32 vcedit_read_func read; 33 vcedit_write_func write; 34 35 void *in; 36 long serial; 37 unsigned char *mainbuf; 38 unsigned char *bookbuf; 39 int mainlen; 40 int booklen; 41 char *lasterror; 42 char *vendor; 43 int prevW; 44 int extrapage; 45 int eosin; 46 } vcedit_state; 47 48 extern vcedit_state * vcedit_new_state(void); 49 extern void vcedit_clear(vcedit_state *state); 50 extern vorbis_comment * vcedit_comments(vcedit_state *state); 51 extern int vcedit_open(vcedit_state *state, FILE *in); 52 extern int vcedit_open_callbacks(vcedit_state *state, void *in, 53 vcedit_read_func read_func, vcedit_write_func write_func); 54 extern int vcedit_write(vcedit_state *state, void *out); 55 extern char * vcedit_error(vcedit_state *state); 56 57 #ifdef __cplusplus 58 } 59 #endif 60 61 #endif /* __VCEDIT_H */ 62 63