shithub: neatroff

Download patch

ref: 5dbd616947a3e745c06103627574ca31e706b50a
parent: 2537e65c9654edeacfb99ffa33c3b220294e2303
author: Ali Gholami Rudi <ali@rudi.ir>
date: Sat Nov 24 13:23:36 EST 2012

rename N_ID() to REG()

--- a/cp.c
+++ b/cp.c
@@ -12,7 +12,7 @@
 		c1 = cp_next();
 		c2 = cp_next();
 	}
-	return N_ID(c1, c2);
+	return REG(c1, c2);
 }
 
 static void cp_num(void)
--- a/reg.c
+++ b/reg.c
@@ -25,7 +25,7 @@
 	int id;
 	if (argc < 3)
 		return;
-	id = N_ID(args[1][0], args[1][1]);
+	id = REG(args[1][0], args[1][1]);
 	nreg[id] = tr_int(args[2], nreg[id], 'u');
 }
 
--- a/tr.c
+++ b/tr.c
@@ -92,7 +92,7 @@
 {
 	if (argc < 3)
 		return;
-	str_set(N_ID(args[1][0], args[1][1]), args[2]);
+	str_set(REG(args[1][0], args[1][1]), args[2]);
 }
 
 static char *arg_regname(char *s, int len);
@@ -129,7 +129,7 @@
 			}
 		}
 	}
-	str_set(N_ID(args[1][0], args[1][1]), sbuf_buf(&sbuf));
+	str_set(REG(args[1][0], args[1][1]), sbuf_buf(&sbuf));
 	sbuf_done(&sbuf);
 }
 
--- a/xroff.h
+++ b/xroff.h
@@ -19,17 +19,17 @@
 char *str_get(int id);
 
 /* builtin number registers; n_X for .X register */
-#define N_ID(c1, c2)	((c1) * 256 + (c2))
-#define n_f		nreg[N_ID('.', 'f')]
-#define n_s		nreg[N_ID('.', 's')]
-#define n_o		nreg[N_ID('.', 'o')]
-#define n_p		nreg[N_ID('.', 'p')]
-#define n_l		nreg[N_ID('.', 'l')]
-#define n_v		nreg[N_ID('.', 'v')]
-#define n_i		nreg[N_ID('.', 'i')]
-#define n_f0		nreg[N_ID('\0', 'f')]	/* last font */
-#define n_s0		nreg[N_ID('\0', 's')]	/* last size */
-#define n_ad		nreg[N_ID('\0', 'a')]	/* adjustment */
+#define REG(c1, c2)	((c1) * 256 + (c2))
+#define n_f		nreg[REG('.', 'f')]
+#define n_s		nreg[REG('.', 's')]
+#define n_o		nreg[REG('.', 'o')]
+#define n_p		nreg[REG('.', 'p')]
+#define n_l		nreg[REG('.', 'l')]
+#define n_v		nreg[REG('.', 'v')]
+#define n_i		nreg[REG('.', 'i')]
+#define n_f0		nreg[REG('\0', 'f')]	/* last font */
+#define n_s0		nreg[REG('\0', 's')]	/* last size */
+#define n_ad		nreg[REG('\0', 'a')]	/* adjustment */
 
 /* device related variables */
 extern int dev_res;