summaryrefslogtreecommitdiff
path: root/trunk/librosprite.h
diff options
context:
space:
mode:
authorJames Shaw <jshaw@netsurf-browser.org>2008-03-26 21:11:51 +0000
committerJames Shaw <jshaw@netsurf-browser.org>2008-03-26 21:11:51 +0000
commit9aa23badba0cb139ee23b696649dae67f0686805 (patch)
tree15e1f6bb4d17a1a2e24c30a04f5bcbbc1fa98b7d /trunk/librosprite.h
parent83231da18da90d329f3a3b825119ba5e7d7670aa (diff)
downloadlibrosprite-9aa23badba0cb139ee23b696649dae67f0686805.tar.gz
librosprite-9aa23badba0cb139ee23b696649dae67f0686805.tar.bz2
Change all functions to return an error code, with the result
struc being passed as a function argument svn path=/import/jshaw/libsprite/; revision=10017
Diffstat (limited to 'trunk/librosprite.h')
-rw-r--r--trunk/librosprite.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/trunk/librosprite.h b/trunk/librosprite.h
index 97eea48..bbe7f7d 100644
--- a/trunk/librosprite.h
+++ b/trunk/librosprite.h
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdbool.h>
-typedef enum { ROSPRITE_OK, ROSPRITE_NOMEM, ROSPRITE_EOF } rosprite_error;
+typedef enum { ROSPRITE_OK, ROSPRITE_NOMEM, ROSPRITE_EOF, ROSPRITE_BADMODE } rosprite_error;
typedef enum { rosprite_rgb, rosprite_cmyk } rosprite_color_model;
@@ -52,6 +52,7 @@ struct rosprite {
uint32_t* image; /* image data in 0xRRGGBBAA words */
};
+struct rosprite_file_context;
rosprite_error rosprite_create_file_context(FILE* f, struct rosprite_file_context** ctx);
void rosprite_destroy_file_context(struct rosprite_file_context* ctx);
int rosprite_file_reader(uint8_t* buf, size_t count, void* ctx);
@@ -61,10 +62,10 @@ rosprite_error rosprite_create_mem_context(uint8_t* p, unsigned long total_size,
void rosprite_destroy_mem_context(struct rosprite_mem_context* ctx);
int rosprite_mem_reader(uint8_t* buf, size_t count, void* ctx);
-struct rosprite_area* rosprite_load(reader reader, void* ctx);
+rosprite_error rosprite_load(reader reader, void* ctx, struct rosprite_area** result);
void rosprite_destroy_sprite_area(struct rosprite_area *);
-struct rosprite_palette* rosprite_load_palette(reader reader, void* ctx);
+rosprite_error rosprite_load_palette(reader reader, void* ctx, struct rosprite_palette** result);
void rosprite_destroy_palette(struct rosprite_palette *);