#ifndef RSS_HTML_COMMON_H
#define RSS_HTML_COMMON_H
#include
#define MAX_UPDATE_ITEMS 10
typedef struct cJSON cJSON;
typedef struct fallback fallback;
typedef struct {
const char *title;
const char *link;
} DownloadItemsData;
typedef struct {
const char *title;
cJSON *json_data;
} TrackedItem;
int write_plugin_json_to_file(const char *dir, const char *filename, const char *url, const char *updated, DownloadItemsData *prev_download_items, size_t num_prev_download_items, const char *plugin_name, fallback *fall);
/*
Note: tracked_item.json_data becomes invalid after this call.
@filenames can be NULL, in which case filenames are not stored for items. This is the case for html items.
@tracked_dir is also modified and then restored at the end.
@download_items and @timestamps both need to be @num_download_items long. If @filenames is not NULL, then it also has to be @num_download_items long.
*/
int tracked_item_update_latest(TrackedItem *tracked_item, char *tracked_dir, DownloadItemsData **download_items, char **filenames, long *timestamps, int num_download_items, fallback *fall);
#endif