Reworked error handling.
[ruby-vorbistagger.git] / ext / vcedit.h
index cdd7be513c2bca55786b7e9a5362284d6d948cf3..c0f15dccb9a64f1b12bbd91112d0678e311e74e5 100644 (file)
@@ -27,15 +27,22 @@ extern "C" {
 #include <ogg/ogg.h>
 #include <vorbis/codec.h>
 
+typedef enum {
+       VCEDIT_ERR_SUCCESS = 0,
+       VCEDIT_ERR_OPEN,
+       VCEDIT_ERR_INVAL,
+       VCEDIT_ERR_TMPFILE,
+       VCEDIT_ERR_REOPEN
+} vcedit_error;
+
 typedef struct vcedit_state_St vcedit_state;
 
 vcedit_state *vcedit_state_new (const char *filename);
 void vcedit_state_ref (vcedit_state *state);
 void vcedit_state_unref (vcedit_state *state);
 vorbis_comment *vcedit_comments (vcedit_state *state);
-int vcedit_open (vcedit_state *state);
-int vcedit_write (vcedit_state *state);
-const char *vcedit_error (vcedit_state *state);
+vcedit_error vcedit_open (vcedit_state *state);
+vcedit_error vcedit_write (vcedit_state *state);
 
 #ifdef __cplusplus
 }