summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2014-03-31 22:46:58 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2014-03-31 22:46:58 +0200
commitd8b0c45812890670943becd45383f75d57056e52 (patch)
tree055375c12586e9f38f19ce5281f0a2c54de92226 /util.h
parent1fa71087c9d754b687d52059ee88ca82b45ec1eb (diff)
new version
lots of things changed, but cleanup todo. changelog and consistent stream of small updates will come in the future. Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat (limited to 'util.h')
-rw-r--r--util.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/util.h b/util.h
new file mode 100644
index 0000000..cca9c98
--- /dev/null
+++ b/util.h
@@ -0,0 +1,26 @@
+#include <time.h>
+
+/* feed info */
+struct feed {
+ char *name; /* feed name */
+ unsigned long totalnew; /* amount of new items per feed */
+ unsigned long total; /* total items */
+ time_t timenewest;
+ char timenewestformat[64];
+ struct feed *next; /* linked list */
+};
+
+enum { FieldUnixTimestamp = 0, FieldTimeFormatted, FieldTitle, FieldLink,
+ FieldContent, FieldContentType, FieldId, FieldAuthor, FieldFeedType,
+ FieldFeedName, FieldFeedUrl, FieldBaseSiteUrl, FieldLast };
+
+#undef strlcpy
+size_t strlcpy(char *, const char *, size_t);
+
+char * afgets(char **p, size_t *size, FILE *fp);
+void feedsfree(struct feed *f);
+unsigned int parseline(char **line, size_t *size, char **fields,
+ unsigned int maxfields, int separator, FILE *fp);
+void printfeednameid(const char *s, FILE *fp);
+void printhtmlencoded(const char *s, FILE *fp);
+void printlink(const char *link, const char *baseurl, FILE *fp);