X-Git-Url: http://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/fa7c556d251ebcb41ef9709b4d85a2c820dee94b..81d9da9a3ab660a3ce6ac1f1660024f2b77dfc95:/src/image.c?ds=sidebyside
diff --git a/src/image.c b/src/image.c
index a5a4bff..4a0fdd8 100644
--- a/src/image.c
+++ b/src/image.c
@@ -16,10 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
+#include
#include
#include
#include
@@ -61,7 +58,7 @@ struct lbx_image {
unsigned long offsets[];
};
-static struct lbx_image *lbximg_init(unsigned char hdr[static HDR_LEN])
+static struct lbx_image *lbx_img_init(unsigned char hdr[static HDR_LEN])
{
unsigned short nframes = unpack_16_le(hdr+6);
struct lbx_image *img;
@@ -88,8 +85,8 @@ static struct lbx_image *lbximg_init(unsigned char hdr[static HDR_LEN])
return img;
}
-struct lbx_image *lbximg_open(void *f, const struct lbx_file_ops *fops,
- int (*destructor)(void *))
+struct lbx_image *lbx_img_open(void *f, const struct lbx_file_ops *fops,
+ int (*destructor)(void *))
{
unsigned char hdr_buf[HDR_LEN];
struct lbx_image *img;
@@ -100,7 +97,7 @@ struct lbx_image *lbximg_open(void *f, const struct lbx_file_ops *fops,
return NULL;
}
- img = lbximg_init(hdr_buf);
+ img = lbx_img_init(hdr_buf);
if (!img)
return NULL;
@@ -172,7 +169,7 @@ static int file_close(void *f)
return fclose((FILE *)f);
}
-struct lbx_image *lbximg_fopen(const char *file)
+struct lbx_image *lbx_img_fopen(const char *file)
{
struct lbx_pipe_state *p;
FILE *f;
@@ -182,7 +179,7 @@ struct lbx_image *lbximg_fopen(const char *file)
return NULL;
if (fseek(f, 0, SEEK_CUR) == 0)
- return lbximg_open(f, &lbx_default_fops, file_close);
+ return lbx_img_open(f, &lbx_default_fops, file_close);
p = malloc(sizeof *p);
if (!p) {
@@ -191,7 +188,7 @@ struct lbx_image *lbximg_fopen(const char *file)
}
*p = (struct lbx_pipe_state) { .f = f };
- return lbximg_open(p, &lbx_pipe_fops, pipe_close);
+ return lbx_img_open(p, &lbx_pipe_fops, pipe_close);
}
static int _lbx_drawrow(int first, struct lbx_image *img)
@@ -323,7 +320,7 @@ static unsigned char **read_raw_frame(struct lbx_image *img, int frame)
return img->framedata;
}
-unsigned char **lbximg_getframe(struct lbx_image *img, int frame)
+unsigned char **lbx_img_getframe(struct lbx_image *img, int frame)
{
if (frame >= img->frames || frame < 0) {
lbx_error_raise(LBX_ENOENT);
@@ -360,7 +357,7 @@ unsigned char **lbximg_getframe(struct lbx_image *img, int frame)
/* We must have previous frame decoded to continue. */
if (frame > img->currentframe + 1) {
- if (!lbximg_getframe(img, frame-1))
+ if (!lbx_img_getframe(img, frame-1))
return NULL;
}
}
@@ -390,8 +387,8 @@ unsigned char **lbximg_getframe(struct lbx_image *img, int frame)
}
int
-lbximg_loadpalette(void *f, const struct lbx_file_ops *fops,
- struct lbx_colour palette[static 256])
+lbx_img_loadpalette(void *f, const struct lbx_file_ops *fops,
+ struct lbx_colour palette[static 256])
{
unsigned char entry[4];
int i;
@@ -420,7 +417,7 @@ lbximg_loadpalette(void *f, const struct lbx_file_ops *fops,
}
int
-lbximg_getpalette(struct lbx_image *img, struct lbx_colour palette[static 256])
+lbx_img_getpalette(struct lbx_image *img, struct lbx_colour palette[static 256])
{
unsigned char entry[4];
unsigned int i;
@@ -460,7 +457,7 @@ readerr:
return -1;
}
-void lbximg_getinfo(struct lbx_image *img, struct lbx_imginfo *info)
+void lbx_img_getinfo(struct lbx_image *img, struct lbx_imginfo *info)
{
*info = (struct lbx_imginfo) {
.width = img->width,
@@ -480,12 +477,12 @@ void lbximg_getinfo(struct lbx_image *img, struct lbx_imginfo *info)
}
}
-unsigned char **lbximg_getmask(struct lbx_image *img)
+unsigned char **lbx_img_getmask(struct lbx_image *img)
{
return img->mask;
}
-int lbximg_close(struct lbx_image *img)
+int lbx_img_close(struct lbx_image *img)
{
int rc = 0;