source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Rename five static functions to make the classification of
@ 2016-04-15 21:15 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2016-04-15 21:15 UTC (permalink / raw)
  To: source

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-15 21:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-15 21:15 mdocml: Rename five static functions to make the classification of schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).