diff options
Diffstat (limited to 'trunk/librosprite.h')
-rw-r--r-- | trunk/librosprite.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/trunk/librosprite.h b/trunk/librosprite.h index 61e5e22..97eea48 100644 --- a/trunk/librosprite.h +++ b/trunk/librosprite.h @@ -5,6 +5,8 @@ #include <stdio.h> #include <stdbool.h> +typedef enum { ROSPRITE_OK, ROSPRITE_NOMEM, ROSPRITE_EOF } rosprite_error; + typedef enum { rosprite_rgb, rosprite_cmyk } rosprite_color_model; typedef int (*reader)(uint8_t* buf, size_t count, void* ctx); @@ -50,11 +52,12 @@ struct rosprite { uint32_t* image; /* image data in 0xRRGGBBAA words */ }; -struct rosprite_file_context* rosprite_create_file_context(FILE* f); +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); -struct rosprite_mem_context* rosprite_create_mem_context(uint8_t* p, unsigned long total_size); +struct rosprite_mem_context; +rosprite_error rosprite_create_mem_context(uint8_t* p, unsigned long total_size, struct rosprite_mem_context** result); void rosprite_destroy_mem_context(struct rosprite_mem_context* ctx); int rosprite_mem_reader(uint8_t* buf, size_t count, void* ctx); |