summaryrefslogtreecommitdiff
path: root/sfeed.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2022-02-04 20:18:35 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2022-02-04 20:18:35 +0100
commit01b950a8f719068508a245e9ee6b3d1b1fafe056 (patch)
tree6c69a289b065511029942b209b981698e1c315d7 /sfeed.c
parente9f70bdc2bf9eb75ee36ce32768109317fddaea1 (diff)
improve some code comments
Diffstat (limited to 'sfeed.c')
-rw-r--r--sfeed.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sfeed.c b/sfeed.c
index 6b4a423..126c685 100644
--- a/sfeed.c
+++ b/sfeed.c
@@ -360,6 +360,7 @@ string_print_trimmed(String *s)
printtrimmed(s->data);
}
+/* Print each field with trimmed whitespace, separated by '|'. */
void
string_print_trimmed_multi(String *s)
{
@@ -383,7 +384,7 @@ string_print_trimmed_multi(String *s)
}
}
-/* print URL, if it's a relative URL then it uses global baseurl */
+/* Print URL, if it's a relative URL then it uses the global `baseurl`. */
void
printuri(char *s)
{
@@ -409,7 +410,7 @@ printuri(char *s)
*e = c; /* restore NUL byte to original character */
}
-/* print URL, if it's a relative URL then it uses global baseurl */
+/* Print URL, if it's a relative URL then it uses the global `baseurl`. */
void
string_print_uri(String *s)
{
@@ -419,7 +420,7 @@ string_print_uri(String *s)
printuri(s->data);
}
-/* print as UNIX timestamp, print nothing if the parsed time is invalid */
+/* Print as UNIX timestamp, print nothing if the time is empty or invalid. */
void
string_print_timestamp(String *s)
{
@@ -432,6 +433,7 @@ string_print_timestamp(String *s)
printf("%lld", t);
}
+/* Convert time fields. Returns a UNIX timestamp. */
long long
datetounix(long long year, int mon, int day, int hour, int min, int sec)
{
@@ -538,6 +540,8 @@ gettzoffset(const char *s)
return 0;
}
+/* Parse time string `s` into the UNIX timestamp `tp`.
+ Returns 0 on success or -1 on failure. */
static int
parsetime(const char *s, long long *tp)
{
@@ -799,8 +803,6 @@ xmlattrstart(XMLParser *p, const char *t, size_t tl, const char *n, size_t nl)
string_clear(&tmpstr); /* use the last value for multiple attribute values */
}
-/* NOTE: this handler can be called multiple times if the data in this
- * block is bigger than the buffer. */
static void
xmldata(XMLParser *p, const char *s, size_t len)
{