cleanups, add manual page
[unix-history] / usr / src / usr.bin / ex / ex_addr.c
index afe1b7c..1fb6703 100644 (file)
@@ -1,4 +1,13 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)ex_addr.c   7.5 (Berkeley) %G%";
+#endif not lint
+
 #include "ex.h"
 #include "ex_re.h"
 
 #include "ex.h"
 #include "ex_re.h"
 
@@ -79,7 +88,7 @@ getnum()
        register int cnt;
 
        for (cnt = 0; isdigit(peekcd());)
        register int cnt;
 
        for (cnt = 0; isdigit(peekcd());)
-               cnt = cnt * 10 + getchar() - '0';
+               cnt = cnt * 10 + ex_getchar() - '0';
        return (cnt);
 }
 
        return (cnt);
 }
 
@@ -123,8 +132,8 @@ setnoaddr()
  * than the number of lines in the file.
  */
 line *
  * than the number of lines in the file.
  */
 line *
-address(inline)
-       char *inline;
+address(inputline)
+       char *inputline;
 {
        register line *addr;
        register int offset, c;
 {
        register line *addr;
        register int offset, c;
@@ -190,16 +199,16 @@ address(inline)
                        notempty();
                        savere(scanre);
                        addr = dot;
                        notempty();
                        savere(scanre);
                        addr = dot;
-                       if (inline && execute(0, dot)) {
+                       if (inputline && execute(0, dot)) {
                                if (c == '/') {
                                if (c == '/') {
-                                       while (loc1 <= inline) {
+                                       while (loc1 <= inputline) {
                                                if (loc1 == loc2)
                                                        loc2++;
                                                if (!execute(1))
                                                        goto nope;
                                        }
                                        break;
                                                if (loc1 == loc2)
                                                        loc2++;
                                                if (!execute(1))
                                                        goto nope;
                                        }
                                        break;
-                               } else if (loc1 < inline) {
+                               } else if (loc1 < inputline) {
                                        char *last;
 doques:
 
                                        char *last;
 doques:
 
@@ -209,7 +218,7 @@ doques:
                                                        loc2++;
                                                if (!execute(1))
                                                        break;
                                                        loc2++;
                                                if (!execute(1))
                                                        break;
-                                       } while (loc1 < inline);
+                                       } while (loc1 < inputline);
                                        loc1 = last;
                                        break;
                                }
                                        loc1 = last;
                                        break;
                                }
@@ -232,8 +241,8 @@ error("No match to TOP|Address search hit TOP without matching pattern");
                                        }
                                }
                                if (execute(0, addr)) {
                                        }
                                }
                                if (execute(0, addr)) {
-                                       if (inline && c == '?') {
-                                               inline = &linebuf[LBSIZE];
+                                       if (inputline && c == '?') {
+                                               inputline = &linebuf[LBSIZE];
                                                goto doques;
                                        }
                                        break;
                                                goto doques;
                                        }
                                        break;
@@ -252,7 +261,7 @@ error("No match to TOP|Address search hit TOP without matching pattern");
                        continue;
 
                case '\'':
                        continue;
 
                case '\'':
-                       c = markreg(getchar());
+                       c = markreg(ex_getchar());
                        if (c == 0)
                                error("Marks are ' and a-z");
                        addr = getmark(c);
                        if (c == 0)
                                error("Marks are ' and a-z");
                        addr = getmark(c);