source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Rename some terms (incremental part of a larger set of
Date: Wed, 27 Jul 2011 10:23:27 -0400 (EDT)	[thread overview]
Message-ID: <201107271423.p6RENRqC021836@krisdoz.my.domain> (raw)

Log Message:
-----------
Rename some terms (incremental part of a larger set of check-ins).

Modified Files:
--------------
    mdocml:
        roff.c

Revision Data
-------------
Index: roff.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/roff.c,v
retrieving revision 1.159
retrieving revision 1.160
diff -Lroff.c -Lroff.c -u -p -r1.159 -r1.160
--- roff.c
+++ roff.c
@@ -82,8 +82,8 @@ struct	reg {
 };
 
 struct	roffstr {
-	char		*name; /* key of symbol */
-	char		*string; /* current value */
+	char		*key; /* key of symbol */
+	char		*val; /* current value */
 	struct roffstr	*next; /* next in list */
 };
 
@@ -1465,20 +1465,20 @@ roff_setstr(struct roff *r, const char *
 
 	/* Search for an existing string with the same name. */
 	n = r->first_string;
-	while (n && strcmp(name, n->name))
+	while (n && strcmp(name, n->key))
 		n = n->next;
 
 	if (NULL == n) {
 		/* Create a new string table entry. */
 		n = mandoc_malloc(sizeof(struct roffstr));
-		n->name = mandoc_strdup(name);
-		n->string = NULL;
+		n->key = mandoc_strdup(name);
+		n->val = NULL;
 		n->next = r->first_string;
 		r->first_string = n;
 	} else if (0 == multiline) {
 		/* In multiline mode, append; else replace. */
-		free(n->string);
-		n->string = NULL;
+		free(n->val);
+		n->val = NULL;
 	}
 
 	if (NULL == string)
@@ -1489,17 +1489,17 @@ roff_setstr(struct roff *r, const char *
 	 * and one for the terminating '\0'.
 	 */
 	newch = strlen(string) + (multiline ? 2u : 1u);
-	if (NULL == n->string) {
-		n->string = mandoc_malloc(newch);
-		*n->string = '\0';
+	if (NULL == n->val) {
+		n->val = mandoc_malloc(newch);
+		*n->val = '\0';
 		oldch = 0;
 	} else {
-		oldch = strlen(n->string);
-		n->string = mandoc_realloc(n->string, oldch + newch);
+		oldch = strlen(n->val);
+		n->val = mandoc_realloc(n->val, oldch + newch);
 	}
 
 	/* Skip existing content in the destination buffer. */
-	c = n->string + (int)oldch;
+	c = n->val + (int)oldch;
 
 	/* Append new content to the destination buffer. */
 	while (*string) {
@@ -1524,9 +1524,9 @@ roff_getstrn(const struct roff *r, const
 	const struct roffstr *n;
 
 	for (n = r->first_string; n; n = n->next)
-		if (0 == strncmp(name, n->name, len) && 
-				'\0' == n->name[(int)len])
-			return(n->string);
+		if (0 == strncmp(name, n->key, len) && 
+				'\0' == n->key[(int)len])
+			return(n->val);
 
 	return(NULL);
 }
@@ -1537,8 +1537,8 @@ roff_freestr(struct roff *r)
 	struct roffstr	 *n, *nn;
 
 	for (n = r->first_string; n; n = nn) {
-		free(n->name);
-		free(n->string);
+		free(n->key);
+		free(n->val);
 		nn = n->next;
 		free(n);
 	}
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2011-07-27 14:23 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=201107271423.p6RENRqC021836@krisdoz.my.domain \
    --to=kristaps@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).