vcedit.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 <[email protected]>
  5. *
  6. * VCEdit header.
  7. *
  8. * last modified: $ID:$
  9. */
  10. #ifndef __VCEDIT_H
  11. #define __VCEDIT_H
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include <stdio.h>
  16. #include <ogg/ogg.h>
  17. #include <vorbis/codec.h>
  18. typedef size_t (*vcedit_read_func)(void *, size_t, size_t, void *);
  19. typedef size_t (*vcedit_write_func)(const void *, size_t, size_t, void *);
  20. typedef struct {
  21. ogg_sync_state *oy;
  22. ogg_stream_state *os;
  23. vorbis_comment *vc;
  24. vorbis_info *vi;
  25. vcedit_read_func read;
  26. vcedit_write_func write;
  27. void *in;
  28. long serial;
  29. unsigned char *mainbuf;
  30. unsigned char *bookbuf;
  31. int mainlen;
  32. int booklen;
  33. char *lasterror;
  34. char *vendor;
  35. int prevW;
  36. int extrapage;
  37. int eosin;
  38. } vcedit_state;
  39. extern vcedit_state * vcedit_new_state(void);
  40. extern void vcedit_clear(vcedit_state *state);
  41. extern vorbis_comment * vcedit_comments(vcedit_state *state);
  42. extern int vcedit_open(vcedit_state *state, FILE *in);
  43. extern int vcedit_open_callbacks(vcedit_state *state, void *in,
  44. vcedit_read_func read_func, vcedit_write_func write_func);
  45. extern int vcedit_write(vcedit_state *state, void *out);
  46. extern char * vcedit_error(vcedit_state *state);
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif /* __VCEDIT_H */