Go to most recent revision |
Blame |
Last modification |
View Log
| Download
| RSS feed
#include <string.h>
#include"libmgfx.h"
static struct mgfx_image_format * the_fmts=NULL;
void register_image_format(struct mgfx_image_format * fmt)
{
fmt->next=the_fmts;
the_fmts=fmt;
}
struct mgfx_image_format * get_image_format(char * fname)
{
char * p;
int j;
struct mgfx_image_format * fmt;
if(!the_fmts) return NULL;
if(!p) return NULL;
p++;
if(!j) return NULL;
strlwr(p);
for(fmt=the_fmts;fmt;fmt=fmt->next)
{
if(!strncmp(p
,fmt
->fmt_ext
,j
)) return fmt
;
}
return NULL;
}