X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=src%2Fdata.h;h=dacde3bc2c877aff10268f082691d1f28c1f5def;hb=5ffc3c31ece77d1debfc619a1e5817b7398209e8;hp=fd97829ac2de5482b040b457e30a19d8138f5e4c;hpb=8efa2df296f672505211b4360c10279d9d57be22;p=aweather diff --git a/src/data.h b/src/data.h index fd97829..dacde3b 100644 --- a/src/data.h +++ b/src/data.h @@ -1,8 +1,33 @@ +/* + * Copyright (C) 2009 Andy Spencer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef __DATA_H__ #define __DATA_H__ -typedef void (*AWeatherCacheDoneCallback)(const gchar *file, gpointer user_data); +typedef enum { + AWEATHER_ONCE, // Cache the file if it does not exist + AWEATHER_UPDATE, // Append additional data to cached copy (resume) + AWEATHER_REFRESH, // Delete existing file and cache a new copy +} AWeatherCacheType; + +typedef void (*AWeatherCacheDoneCallback)(gchar *file, gboolean updated, + gpointer user_data); -void cache_file(char *base, char *path, AWeatherCacheDoneCallback callback, gpointer user_data); +void cache_file(char *base, char *path, AWeatherCacheType update, + AWeatherCacheDoneCallback callback, gpointer user_data); #endif