]> git.draconx.ca Git - liblbx.git/blobdiff - src/image.c
liblbx: Namespace cleanup.
[liblbx.git] / src / image.c
index 1525fb2d51fe684e170ea807c2dbd79148fde805..4a0fdd88080be4d68d9ad3ac8e7cc0235568cefe 100644 (file)
@@ -58,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;
@@ -85,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;
@@ -97,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;
 
@@ -169,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;
@@ -179,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) {
@@ -188,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)
@@ -320,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);
@@ -357,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;
                }
        }
@@ -387,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;
@@ -417,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;
@@ -457,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,
@@ -477,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;