systemMessage(MSG_CANNOT_OPEN_FILE, "Cannot open file %s", file);
systemMessage(MSG_CANNOT_OPEN_FILE, N_("Cannot open file %s"), file);
IMAGE_TYPE utilFindType(const char *file){  char buffer[2048];    if(utilIsZipFile(file)) {    unzFile unz = unzOpen(file);        if(unz == NULL) {      systemMessage(MSG_CANNOT_OPEN_FILE, "Cannot open file %s", file);      return IMAGE_UNKNOWN;    }        int r = unzGoToFirstFile(unz);        if(r != UNZ_OK) {      unzClose(unz);      systemMessage(MSG_BAD_ZIP_FILE, "Bad ZIP file %s", file);      return IMAGE_UNKNOWN;    }        IMAGE_TYPE found = IMAGE_UNKNOWN;        unz_file_info info;        while(true) {      r = unzGetCurrentFileInfo(unz,                                &info,                                buffer,                                sizeof(buffer),                                NULL,                                0,                                NULL,                                0);            if(r != UNZ_OK) {        unzClose(unz);        systemMessage(MSG_BAD_ZIP_FILE,"Bad ZIP file %s", file);        return IMAGE_UNKNOWN;      }            if(utilIsGBAImage(buffer)) {        found = IMAGE_GBA;        break;      }      if(utilIsGBImage(buffer)) {        found = IMAGE_GB;        break;      }              r = unzGoToNextFile(unz);            if(r != UNZ_OK)        break;    }    unzClose(unz);        if(found == IMAGE_UNKNOWN) {      systemMessage(MSG_NO_IMAGE_ON_ZIP,                    "No image found on ZIP file %s", file);      return found;    }    return found;#if 0  } else if(utilIsRarFile(file)) {    IMAGE_TYPE found = IMAGE_UNKNOWN;        ArchiveList_struct *rarList = NULL;    if(urarlib_list((void *)file, (ArchiveList_struct *)&rarList)) {      ArchiveList_struct *p = rarList;      while(p) {        if(utilIsGBAImage(p->item.Name)) {          found = IMAGE_GBA;          break;        }        if(utilIsGBImage(p->item.Name)) {          found = IMAGE_GB;          break;        }        p = p->next;      }            urarlib_freelist(rarList);    }    return found;#endif  } else {    if(utilIsGzipFile(file))      utilGetBaseName(file, buffer);    else      strcpy(buffer, file);        if(utilIsGBAImage(buffer))      return IMAGE_GBA;    if(utilIsGBImage(buffer))      return IMAGE_GB;  }  return IMAGE_UNKNOWN;  }