X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/agedu/blobdiff_plain/70322ae3751bc07ac749dffad79a5f3420e67b55..5a29503dccf98dc8f549d682f543f65d7648869e:/html.h diff --git a/html.h b/html.h index a02babf..63aacb9 100644 --- a/html.h +++ b/html.h @@ -2,16 +2,32 @@ * html.h: HTML output format for agedu. */ +struct html_config { + /* + * If "format" is non-NULL, it is treated as an sprintf format + * string which must contain exactly one %lu and no other + * formatting directives (other than %%, which doesn't count); + * this will be used to construct URLs to use in hrefs + * pointing to queries of other related (parent and child) + * pathnames. + */ + const char *format; + + /* + * Time stamps to assign to the extreme ends of the colour + * scale. If "autoage" is true, they are ignored and the time + * stamps are derived from the limits of the age data stored + * in the index. + */ + int autoage; + time_t oldest, newest; +}; + /* * Generate an HTML document containing the results of a query * against the pathname at a given index. Returns a dynamically * allocated piece of memory containing the entire HTML document, * as an ordinary C zero-terminated string. - * - * If "format" is non-NULL, it is treated as an sprintf format - * string which must contain exactly one %lu and no other - * formatting directives (other than %%, which doesn't count); - * this will be used to construct URLs to use in hrefs pointing to - * queries of other related (parent and child) pathnames. */ -char *html_query(const void *t, unsigned long index, const char *format); +char *html_query(const void *t, unsigned long index, + const struct html_config *cfg);