Reworked error handling.
[ruby-vorbistagger.git] / ext / vcedit.h
1 /*
2  * Copyright (C) 2000-2001 Michael Smith (msmith at xiph org)
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation, version 2.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16  * MA 02110-1301 USA
17  */
18
19 #ifndef __VCEDIT_H
20 #define __VCEDIT_H
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #include <stdio.h>
27 #include <ogg/ogg.h>
28 #include <vorbis/codec.h>
29
30 typedef enum {
31         VCEDIT_ERR_SUCCESS = 0,
32         VCEDIT_ERR_OPEN,
33         VCEDIT_ERR_INVAL,
34         VCEDIT_ERR_TMPFILE,
35         VCEDIT_ERR_REOPEN
36 } vcedit_error;
37
38 typedef struct vcedit_state_St vcedit_state;
39
40 vcedit_state *vcedit_state_new (const char *filename);
41 void vcedit_state_ref (vcedit_state *state);
42 void vcedit_state_unref (vcedit_state *state);
43 vorbis_comment *vcedit_comments (vcedit_state *state);
44 vcedit_error vcedit_open (vcedit_state *state);
45 vcedit_error vcedit_write (vcedit_state *state);
46
47 #ifdef __cplusplus
48 }
49 #endif
50
51 #endif /* __VCEDIT_H */
52