/* Simplistic zip support, only loads the first file in a zip file with no check as to the type (or filename/extension). returns 1 if a filename is a zip file  */
static int check_zip(char *filename)
/* Simplistic zip support, only loads the first file in a zip file with no check as to the type (or filename/extension). returns 1 if a filename is a zip file  */
static int check_zip(char *filename)
{
    char buf[2];
    FILE *fd = NULL;
    fd = fopen(filename, "rb");
    if(!fd) return (0);
    fread(buf, 2, 1, fd);
    fclose(fd);
    if(memcmp(buf, "PK", 2) == 0) return (1);
    return (0);
}