From 4c678a04defbf750d9b902c0477620401f74a86b Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 31 Jul 2015 22:29:34 +0200 Subject: update some comments --- sfeed.c | 6 +++--- util.c | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/sfeed.c b/sfeed.c index 1d28e8e..addfdfc 100644 --- a/sfeed.c +++ b/sfeed.c @@ -104,7 +104,7 @@ static void xml_handler_start_element_parsed(XMLParser *, const char *, static FeedContext ctx; static XMLParser parser; /* XML parser state */ -/* unique number for parsed tag (faster comparison) */ +/* Unique id for parsed tag (faster comparison). */ static enum TagId gettag(enum FeedType feedtype, const char *name, size_t namelen) { @@ -164,7 +164,7 @@ gettag(enum FeedType feedtype, const char *name, size_t namelen) return TagUnknown; /* NOTREACHED */ } -/* clear string only; don't free, prevents unnecessary reallocation */ +/* Clear string only; don't free, prevents unnecessary reallocation. */ static void string_clear(String *s) { @@ -210,7 +210,7 @@ string_append(String *s, const char *data, size_t len) s->data[s->len] = '\0'; } -/* get timezone from string, return as formatted string and time offset, +/* Get timezone from string, return as formatted string and time offset, * for the offset it assumes UTC. * NOTE: only parses timezones in RFC-822, other timezones are ambiguous * anyway. If needed you can add ones yourself, like "cest", "cet" etc. */ diff --git a/util.c b/util.c index 00195f8..1404498 100644 --- a/util.c +++ b/util.c @@ -72,8 +72,8 @@ readpath: return strlcat(u->path, p, sizeof(u->path)) >= sizeof(u->path) ? -1 : 0; } -/* get absolute uri; if `link` is relative use `base` to make it absolute. - * the returned string in `buf` is uri encoded, see: encodeuri(). */ +/* Get absolute uri; if `link` is relative use `base` to make it absolute. + * the returned string in `buf` is uri encoded, see: encodeuri(). */ int absuri(const char *link, const char *base, char *buf, size_t bufsiz) { @@ -153,7 +153,7 @@ encodeuri(const char *s, char *buf, size_t bufsiz) return 0; } -/* read a field-separated line from 'fp', +/* Read a field-separated line from 'fp', * separated by a character 'separator', * 'fields' is a list of pointer with a maximum size of 'maxfields'. * 'maxfields' must be > 0. @@ -185,7 +185,7 @@ parseline(char **line, size_t *size, char **fields, return (int)i; } -/* parse time to time_t, assumes time_t is signed */ +/* Parse time to time_t, assumes time_t is signed. */ int strtotime(const char *s, time_t *t) { @@ -207,7 +207,7 @@ print(const char *s, FILE *fp, int (*fn)(int, FILE *)) fn((int)*s, fp); } -/* Unescape / decode fields printed by string_print_encode() +/* Unescape / decode fields printed by string_print_encoded() * "\\" to "\", "\t", to TAB, "\n" to newline. Unrecognised escape sequences * are ignored: "\z" etc. Call `fn` on each escaped character. */ void @@ -245,8 +245,7 @@ xmlencode(int c, FILE *fp) * internal buffer (OpenBSD). Others modify the contents of `path` (POSIX). * This is a wrapper function that is compatible with both versions. * The program will error out if basename(3) failed, this can only happen - * with the OpenBSD version. - */ + * with the OpenBSD version. */ char * xbasename(const char *path) { -- cgit v1.2.3