diff options
author | James Shaw <jshaw@netsurf-browser.org> | 2008-03-26 21:11:51 +0000 |
---|---|---|
committer | James Shaw <jshaw@netsurf-browser.org> | 2008-03-26 21:11:51 +0000 |
commit | 9aa23badba0cb139ee23b696649dae67f0686805 (patch) | |
tree | 15e1f6bb4d17a1a2e24c30a04f5bcbbc1fa98b7d /trunk/palette2c.c | |
parent | 83231da18da90d329f3a3b825119ba5e7d7670aa (diff) | |
download | librosprite-9aa23badba0cb139ee23b696649dae67f0686805.tar.gz |
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/palette2c.c')
-rw-r--r-- | trunk/palette2c.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/trunk/palette2c.c b/trunk/palette2c.c index 5f668c0..2e83e85 100644 --- a/trunk/palette2c.c +++ b/trunk/palette2c.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <stdlib.h> -#include "libsprite.h" +#include "librosprite.h" int main(int argc, char *argv[]) { @@ -18,9 +18,15 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - struct rosprite_file_context* ctx = rosprite_create_file_context(f); + struct rosprite_file_context* ctx; + if (rosprite_create_file_context(f, &ctx) != ROSPRITE_OK) { + exit(EXIT_FAILURE); + } - struct rosprite_palette* palette = rosprite_load_palette(rosprite_file_reader, ctx); + struct rosprite_palette* palette; + if (rosprite_load_palette(rosprite_file_reader, ctx, &palette) != ROSPRITE_OK) { + exit(EXIT_FAILURE); + } for (uint32_t i = 0; i < palette->size; i++) { printf("0x%x, ", palette->palette[i]); |