From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 748e4786 for ; Fri, 15 Apr 2016 16:15:21 -0500 (EST) Date: Fri, 15 Apr 2016 16:15:21 -0500 (EST) Message-Id: <16951591718872616268.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Rename five static functions to make the classification of X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Rename five static functions to make the classification of functions as parsers, page generators, and result generators more obvious. No functional change. Modified Files: -------------- mdocml: cgi.c Revision Data ------------- Index: cgi.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/cgi.c,v retrieving revision 1.128 retrieving revision 1.129 diff -Lcgi.c -Lcgi.c -u -p -r1.128 -r1.129 --- cgi.c +++ cgi.c @@ -59,14 +59,12 @@ struct req { int isquery; /* QUERY_STRING used, not PATH_INFO */ }; -static void catman(const struct req *, const char *); -static void format(const struct req *, const char *); static void html_print(const char *); static void html_putchar(char); static int http_decode(char *); -static void http_parse(struct req *, const char *); -static void pathgen(struct req *); -static void path_parse(struct req *req, const char *path); +static void parse_manpath_conf(struct req *); +static void parse_path_info(struct req *req, const char *path); +static void parse_query_string(struct req *, const char *); static void pg_error_badrequest(const char *); static void pg_error_internal(void); static void pg_index(const struct req *); @@ -77,8 +75,10 @@ static void pg_searchres(const struct static void pg_show(struct req *, const char *); static void resp_begin_html(int, const char *); static void resp_begin_http(int, const char *); +static void resp_catman(const struct req *, const char *); static void resp_copy(const char *); static void resp_end_html(void); +static void resp_format(const struct req *, const char *); static void resp_searchform(const struct req *); static void resp_show(const struct req *, const char *); static void set_query_attr(char **, char **); @@ -185,7 +185,7 @@ set_query_attr(char **attr, char **val) * and store the values into the query structure. */ static void -http_parse(struct req *req, const char *qs) +parse_query_string(struct req *req, const char *qs) { char *key, *val; size_t keysz, valsz; @@ -661,7 +661,7 @@ pg_searchres(const struct req *req, stru } static void -catman(const struct req *req, const char *file) +resp_catman(const struct req *req, const char *file) { FILE *f; char *p; @@ -798,7 +798,7 @@ catman(const struct req *req, const char } static void -format(const struct req *req, const char *file) +resp_format(const struct req *req, const char *file) { struct manoutput conf; struct mparse *mp; @@ -856,9 +856,9 @@ resp_show(const struct req *req, const c file += 2; if ('c' == *file) - catman(req, file); + resp_catman(req, file); else - format(req, file); + resp_format(req, file); } static void @@ -1025,7 +1025,7 @@ main(void) memset(&req, 0, sizeof(struct req)); req.q.equal = 1; - pathgen(&req); + parse_manpath_conf(&req); /* Parse the path info and the query string. */ @@ -1035,11 +1035,11 @@ main(void) path++; if (*path != '\0') { - path_parse(&req, path); + parse_path_info(&req, path); if (access(path, F_OK) == -1) path = ""; } else if ((querystring = getenv("QUERY_STRING")) != NULL) - http_parse(&req, querystring); + parse_query_string(&req, querystring); /* Validate parsed data and add defaults. */ @@ -1080,7 +1080,7 @@ main(void) * If PATH_INFO is not a file name, translate it to a query. */ static void -path_parse(struct req *req, const char *path) +parse_path_info(struct req *req, const char *path) { char *dir; @@ -1132,7 +1132,7 @@ path_parse(struct req *req, const char * * Scan for indexable paths. */ static void -pathgen(struct req *req) +parse_manpath_conf(struct req *req) { FILE *fp; char *dp; -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv