#include<stdio.h>
#include <unistd.h>
#include <gnome.h>
#define PACKAGE "check-mime"
#define VERSION "1.0"

int main(int argc, char* argv[])
{
    int i;
    gnomelib_init(PACKAGE, VERSION);

    for(i=1; i<argc; i++) {
	printf("Checking mime type of file: %s\n", argv[i]);
	if(access(argv[i], F_OK) == 0) {
	    printf("gnome_mime_type(): %s\n", 
		   gnome_mime_type(argv[i]));
	    printf("gnome_mime_type_of_file(): %s\n", 
		   gnome_mime_type_of_file(argv[i]));
	    printf("gnome_mime_from_magic(): %s\n", 
		   gnome_mime_type_from_magic(argv[i]));
	} else 
	    fprintf(stderr,"File %s cannot be accessed.\n", argv[i]);
    }
    return 0;
}
