00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __VCEDIT_H
00012 #define __VCEDIT_H
00013
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017
00018 #include <stdio.h>
00019 #include <ogg/ogg.h>
00020 #include <vorbis/codec.h>
00021
00022 typedef size_t (*vcedit_read_func)(void *, size_t, size_t, void *);
00023 typedef size_t (*vcedit_write_func)(const void *, size_t, size_t, void *);
00024
00025 typedef struct {
00026 ogg_sync_state *oy;
00027 ogg_stream_state *os;
00028
00029 vorbis_comment *vc;
00030 vorbis_info *vi;
00031
00032 vcedit_read_func read;
00033 vcedit_write_func write;
00034
00035 void *in;
00036 long serial;
00037 unsigned char *mainbuf;
00038 unsigned char *bookbuf;
00039 int mainlen;
00040 int booklen;
00041 char *lasterror;
00042 char *vendor;
00043 int prevW;
00044 int extrapage;
00045 int eosin;
00046 } vcedit_state;
00047
00048 extern vcedit_state * vcedit_new_state(void);
00049 extern void vcedit_clear(vcedit_state *state);
00050 extern vorbis_comment * vcedit_comments(vcedit_state *state);
00051 extern int vcedit_open(vcedit_state *state, FILE *in);
00052 extern int vcedit_open_callbacks(vcedit_state *state, void *in,
00053 vcedit_read_func read_func, vcedit_write_func write_func);
00054 extern int vcedit_write(vcedit_state *state, void *out);
00055 extern char * vcedit_error(vcedit_state *state);
00056
00057 #ifdef __cplusplus
00058 }
00059 #endif
00060
00061 #endif
00062