parsing filename for filetype
This commit is contained in:
28
funcs/t.c
28
funcs/t.c
@@ -9,7 +9,7 @@
|
||||
#include "../floatimg.h"
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
int main(int argc, char *argv[])
|
||||
int essai_parse_double(void)
|
||||
{
|
||||
int foo;
|
||||
double dval;
|
||||
@@ -34,3 +34,29 @@ printf("%-10s -> %3d %g\n", str, foo, dval);
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
int essai_detect_type(void)
|
||||
{
|
||||
int foo;
|
||||
char *fname;
|
||||
|
||||
foo = format_from_extension(fname="foo.fimg");
|
||||
printf("%-10s %d\n\n", fname, foo);
|
||||
|
||||
foo = format_from_extension(fname="foo.pNm");
|
||||
printf("%-10s %d\n\n", fname, foo);
|
||||
|
||||
foo = format_from_extension(fname="foo.xyzzy");
|
||||
printf("%-10s %d\n\n", fname, foo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int foo;
|
||||
|
||||
foo = essai_detect_type();
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user