source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Rename five static functions to make the classification of
Date: Fri, 15 Apr 2016 16:15:21 -0500 (EST)	[thread overview]
Message-ID: <16951591718872616268.enqueue@fantadrom.bsd.lv> (raw)

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

                 reply	other threads:[~2016-04-15 21:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16951591718872616268.enqueue@fantadrom.bsd.lv \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).