static int identify1(const RgbImage *base, Rect portion,
char result[MAXIMGIDENT], const char *what,
- const char *which) {
+ const char *which, int (*opener)(const char *fn)) {
char *dbfile_name= masprintf("_%s-pixmap.txt",which);
- if (!dbfile_open(dbfile_name))
+ if (!opener(dbfile_name))
goto not_found;
#define FGETSLINE (dbfile_getsline(result,MAXIMGIDENT,__FILE__,__LINE__))
static int identify(const RgbImage *base, Rect portion,
char result[MAXIMGIDENT], const char *what) {
- return identify1(base,portion,result,what, "master") ||
- identify1(base,portion,result,what, "local");
+ return identify1(base,portion,result,what, "master", dbfile_gzopen) ||
+ identify1(base,portion,result,what, "local", dbfile_open);
}
void fwrite_ppmraw(FILE *f, const RgbImage *ri) {
if (!synced) {
if (o_flags & ff_dict_fetch)
- fetch_with_rsync("pixmap");
+ fetch_with_rsync_gz("pixmap");
synced++;
}