diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-07-15 16:49:36 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-15 17:02:25 +0200 |
commit | 9946c0363648b44d396b07d8a1a4557c568edc88 (patch) | |
tree | d5a2426e266c14f4e4773bacccff7cb8456466c5 /src/rss_html_common.h | |
parent | 73393bfab65515c68159a649c10856659b5ac016 (diff) |
Implement html sync, fix rss sync
Diffstat (limited to 'src/rss_html_common.h')
-rw-r--r-- | src/rss_html_common.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/rss_html_common.h b/src/rss_html_common.h index 472f090..3ae9d77 100644 --- a/src/rss_html_common.h +++ b/src/rss_html_common.h @@ -1,11 +1,34 @@ #ifndef RSS_HTML_COMMON_H #define RSS_HTML_COMMON_H +#define MAX_UPDATE_ITEMS 10 + struct json_value_s; struct json_object_s; struct json_string_s; +typedef struct { + const char *title; + const char *link; +} DownloadItemsData; + +typedef struct { + char *title; + char *link; + struct json_object_s *json_data; +} TrackedItem; + int write_plugin_json_to_file(const char *dir, const char *filename, const char *url, const char *updated, const char *start_after, const char *start_after_url, const char *plugin_name); + +/* + @num_download_items can't be more than MAX_UPDATE_ITEMS. + @filenames can be NULL, in which case filenames are not stored for items. This is the case for html items. +*/ +/* + Note: tracked_item.json_data becomes invalid after this call. + @tracked_dir is also modified and then restored at the end. +*/ +int tracked_item_update_latest(TrackedItem *tracked_item, char *tracked_dir, DownloadItemsData **download_items, char **filenames, int num_download_items); struct json_value_s* json_object_get_field_by_name(struct json_object_s *json_obj, const char *name); void create_json_string(struct json_string_s *json_result, const char *str, int len); void init_json_value_str(struct json_value_s *json_value, struct json_string_s *json_str); |