* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
+#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
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;
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;
return NULL;
}
- img = lbximg_init(hdr_buf);
+ img = lbx_img_init(hdr_buf);
if (!img)
return NULL;
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;
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) {
}
*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)
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);
/* 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;
}
}
}
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;
}
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;
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,
}
}
-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;