Module Name: src
Committed By: christos
Date: Tue Jul 15 13:17:15 UTC 2014
Modified Files:
src/usr.bin/vgrind: Makefile extern.h pathnames.h regexp.c vfontedpr.c
Removed Files:
src/usr.bin/vgrind: vgrindefs.c
Log Message:
first attempt at toolification.
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/vgrind/Makefile
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/vgrind/extern.h
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/vgrind/pathnames.h
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/vgrind/regexp.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/vgrind/vfontedpr.c
cvs rdiff -u -r1.10 -r0 src/usr.bin/vgrind/vgrindefs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/vgrind/Makefile
diff -u src/usr.bin/vgrind/Makefile:1.21 src/usr.bin/vgrind/Makefile:1.22
--- src/usr.bin/vgrind/Makefile:1.21 Tue Apr 14 18:15:28 2009
+++ src/usr.bin/vgrind/Makefile Tue Jul 15 09:17:15 2014
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.21 2009/04/14 22:15:28 lukem Exp $
+# $NetBSD: Makefile,v 1.22 2014/07/15 13:17:15 christos Exp $
# @(#)Makefile 8.1 (Berkeley) 6/9/93
+WARNS=6
.include <bsd.own.mk>
PROG= vfontedpr
@@ -13,8 +14,8 @@ CLEANFILES+=vgrindefs.src.db
FILES= tmac.vgrind vgrindefs.src vgrindefs.src.db
FILESNAME_vgrindefs.src= vgrindefs
FILESNAME_vgrindefs.src.db= vgrindefs.db
-FILESDIR= /usr/share/misc
-FILESDIR_tmac.vgrind= /usr/share/tmac
+FILESDIR?= /usr/share/misc
+FILESDIR_tmac.vgrind?= /usr/share/tmac
FILESNAME_tmac.vgrind= vgrind.tmac
.endif
@@ -35,8 +36,7 @@ CAP_MKDB_ENDIAN=
.if ${MKSHARE} != "no"
vgrindefs.src.db: vgrindefs.src
${_MKTARGET_CREATE}
- ${TOOL_CAP_MKDB} ${CAP_MKDB_ENDIAN} -f vgrindefs.src \
- ${.CURDIR}/vgrindefs.src
+ ${TOOL_CAP_MKDB} ${CAP_MKDB_ENDIAN} -f vgrindefs.src ${.ALLSRC}
.else
vgrindefs.src.db:
.endif
Index: src/usr.bin/vgrind/extern.h
diff -u src/usr.bin/vgrind/extern.h:1.5 src/usr.bin/vgrind/extern.h:1.6
--- src/usr.bin/vgrind/extern.h:1.5 Fri Apr 23 18:14:57 2004
+++ src/usr.bin/vgrind/extern.h Tue Jul 15 09:17:15 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.5 2004/04/23 22:14:57 christos Exp $ */
+/* $NetBSD: extern.h,v 1.6 2014/07/15 13:17:15 christos Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -32,9 +32,8 @@
* @(#)extern.h 8.1 (Berkeley) 6/6/93
*/
-typedef int boolean;
-extern boolean x_escaped; /* if last character was an escape */
+extern bool x_escaped; /* if last character was an escape */
extern char *x_start; /* start of the current string */
extern char *l_acmbeg; /* string introducing a comment */
extern char *l_acmend; /* string ending a comment */
@@ -46,11 +45,11 @@ extern char *l_combeg; /
extern char *l_comend; /* string ending a comment */
extern char l_escape; /* character used to escape characters */
extern char *l_keywds[]; /* keyword table address */
-extern boolean l_onecase; /* upper and lower case are equivalent */
+extern bool l_onecase; /* upper and lower case are equivalent */
extern char *l_prcbeg; /* regular expr for procedure begin */
extern char *l_strbeg; /* delimiter for string constant */
extern char *l_strend; /* delimiter for string constant */
-extern boolean l_toplex; /* procedures only defined at top lex level */
+extern bool l_toplex; /* procedures only defined at top lex level */
extern const char *language; /* the language indicator */
#include <sys/cdefs.h>
Index: src/usr.bin/vgrind/pathnames.h
diff -u src/usr.bin/vgrind/pathnames.h:1.4 src/usr.bin/vgrind/pathnames.h:1.5
--- src/usr.bin/vgrind/pathnames.h:1.4 Thu Aug 7 07:17:00 2003
+++ src/usr.bin/vgrind/pathnames.h Tue Jul 15 09:17:15 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: pathnames.h,v 1.4 2003/08/07 11:17:00 agc Exp $ */
+/* $NetBSD: pathnames.h,v 1.5 2014/07/15 13:17:15 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -31,4 +31,6 @@
* @(#)pathnames.h 8.1 (Berkeley) 6/6/93
*/
+#ifndef _PATH_VGRINDEFS
#define _PATH_VGRINDEFS "/usr/share/misc/vgrindefs"
+#endif
Index: src/usr.bin/vgrind/regexp.c
diff -u src/usr.bin/vgrind/regexp.c:1.12 src/usr.bin/vgrind/regexp.c:1.13
--- src/usr.bin/vgrind/regexp.c:1.12 Tue Mar 20 16:34:59 2012
+++ src/usr.bin/vgrind/regexp.c Tue Jul 15 09:17:15 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: regexp.c,v 1.12 2012/03/20 20:34:59 matt Exp $ */
+/* $NetBSD: regexp.c,v 1.13 2014/07/15 13:17:15 christos Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -30,6 +30,10 @@
* SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1980, 1993\
@@ -40,27 +44,31 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
#if 0
static char sccsid[] = "@(#)regexp.c 8.1 (Berkeley) 6/6/93";
#endif
-__RCSID("$NetBSD: regexp.c,v 1.12 2012/03/20 20:34:59 matt Exp $");
+__RCSID("$NetBSD: regexp.c,v 1.13 2014/07/15 13:17:15 christos Exp $");
#endif /* not lint */
#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <string.h>
#include "extern.h"
-#define FALSE 0
-#define TRUE !(FALSE)
-#define NIL 0
-
-static void expconv __P((void));
+static void expconv (void);
-boolean x_escaped; /* true if we are currently x_escaped */
+bool x_escaped; /* true if we are currently x_escaped */
char *x_start; /* start of string */
-boolean l_onecase; /* true if upper and lower equivalent */
+bool l_onecase; /* true if upper and lower equivalent */
#define makelower(c) (isupper((unsigned char)(c)) ? tolower((unsigned char)(c)) : (c))
+static char
+tocc(ptrdiff_t x) {
+ if (x & ~0xff)
+ abort();
+ return (char)x;
+}
+
/* STRNCMP - like strncmp except that we convert the
* first string to lower case before comparing
* if l_onecase is set.
@@ -72,7 +80,7 @@ STRNCMP(char *s1, char *s2, int len)
if (l_onecase) {
do
if (*s2 - makelower(*s1))
- return (*s2 - makelower(*s1));
+ return *s2 - makelower(*s1);
else {
s2++;
s1++;
@@ -81,7 +89,7 @@ STRNCMP(char *s1, char *s2, int len)
} else {
do
if (*s2 - *s1)
- return (*s2 - *s1);
+ return *s2 - *s1;
else {
s2++;
s1++;
@@ -152,10 +160,10 @@ convexp(char *re) /* unconverted irregul
char *cre; /* pointer to converted regular expression */
/* allocate room for the converted expression */
- if (re == NIL)
- return (NIL);
+ if (re == NULL)
+ return NULL;
if (*re == '\0')
- return (NIL);
+ return NULL;
cre = malloc(4 * strlen(re) + 3);
ccre = cre;
ure = re;
@@ -168,7 +176,7 @@ convexp(char *re) /* unconverted irregul
/* start the conversion (its recursive) */
expconv();
*ccre = 0;
- return (cre);
+ return cre;
}
static void
@@ -180,9 +188,9 @@ expconv(void)
int temp;
/* let the conversion begin */
- acs = NIL;
- cs = NIL;
- while (*ure != NIL) {
+ acs = NULL;
+ cs = NULL;
+ while (*ure) {
switch (c = *ure++) {
case '\\':
@@ -190,7 +198,7 @@ expconv(void)
/* escaped characters are just characters */
default:
- if (cs == NIL || (*cs & STR) == 0) {
+ if (cs == NULL || (*cs & STR) == 0) {
cs = ccre;
*cs = STR;
SCNT(cs) = 1;
@@ -205,13 +213,13 @@ expconv(void)
case 'd':
case 'e':
case 'p':
- if (acs != NIL && acs != cs) {
+ if (acs != NULL && acs != cs) {
do {
temp = OCNT(acs);
- OCNT(acs) = ccre - acs;
+ OCNT(acs) = tocc(ccre - acs);
acs -= temp;
} while (temp != 0);
- acs = NIL;
+ acs = NULL;
}
cs = ccre;
*cs = META;
@@ -224,13 +232,13 @@ expconv(void)
/* just put the symbol in */
case '^':
case '$':
- if (acs != NIL && acs != cs) {
+ if (acs != NULL && acs != cs) {
do {
temp = OCNT(acs);
- OCNT(acs) = ccre - acs;
+ OCNT(acs) = tocc(ccre - acs);
acs -= temp;
} while (temp != 0);
- acs = NIL;
+ acs = NULL;
}
cs = ccre;
*cs = META;
@@ -246,31 +254,31 @@ expconv(void)
/* recurse and define a subexpression */
case '(':
- if (acs != NIL && acs != cs) {
+ if (acs != NULL && acs != cs) {
do {
temp = OCNT(acs);
- OCNT(acs) = ccre - acs;
+ OCNT(acs) = tocc(ccre - acs);
acs -= temp;
} while (temp != 0);
- acs = NIL;
+ acs = NULL;
}
cs = ccre;
*cs = OPER;
OSYM(cs) = '(';
ccre = ONEXT(cs);
expconv();
- OCNT(cs) = ccre - cs; /* offset to next symbol */
+ OCNT(cs) = tocc(ccre - cs); /* offset to next symbol */
break;
/* reurn from a recursion */
case ')':
- if (acs != NIL) {
+ if (acs != NULL) {
do {
temp = OCNT(acs);
- OCNT(acs) = ccre - acs;
+ OCNT(acs) = tocc(ccre - acs);
acs -= temp;
} while (temp != 0);
- acs = NIL;
+ acs = NULL;
}
cs = ccre;
*cs = META;
@@ -282,8 +290,8 @@ expconv(void)
/* the third byte will contain an offset to jump over the */
/* alternate match in case the first did not fail */
case '|':
- if (acs != NIL && acs != cs)
- OCNT(ccre) = ccre - acs; /* make a back pointer */
+ if (acs != NULL && acs != cs)
+ OCNT(ccre) = tocc(ccre - acs); /* make a back pointer */
else
OCNT(ccre) = 0;
assert(cs != NULL);
@@ -297,7 +305,7 @@ expconv(void)
/* if its not a metasymbol just build a scharacter string */
default:
- if (cs == NIL || (*cs & STR) == 0) {
+ if (cs == NULL || (*cs & STR) == 0) {
cs = ccre;
*cs = STR;
SCNT(cs) = 1;
@@ -308,13 +316,13 @@ expconv(void)
break;
}
}
- if (acs != NIL) {
+ if (acs != NULL) {
do {
temp = OCNT(acs);
- OCNT(acs) = ccre - acs;
+ OCNT(acs) = tocc(ccre - acs);
acs -= temp;
} while (temp != 0);
- acs = NIL;
+ acs = NULL;
}
return;
}
@@ -351,13 +359,13 @@ expmatch(
{
char *cs; /* the current symbol */
char *ptr,*s1; /* temporary pointer */
- boolean matched; /* a temporary boolean */
+ bool matched; /* a temporary bool */
/* initial conditions */
- if (re == NIL)
- return (NIL);
+ if (re == NULL)
+ return NULL;
cs = re;
- matched = FALSE;
+ matched = false;
/* loop till expression string is exhausted (or at least pretty tired) */
while (*cs) {
@@ -383,7 +391,7 @@ expmatch(
} else {
/* no match, error return */
- return (NIL);
+ return NULL;
}
break;
@@ -406,7 +414,7 @@ expmatch(
/* this is a grouping, recurse */
case '(':
ptr = expmatch(s, ONEXT(cs), mstring);
- if (ptr != NIL) {
+ if (ptr != NULL) {
/* the subexpression matched */
matched = 1;
@@ -422,7 +430,7 @@ expmatch(
} else {
/* no match, error return */
- return (NIL);
+ return NULL;
}
cs = OPTR(cs);
break;
@@ -443,29 +451,29 @@ expmatch(
s1 = s;
do {
ptr = expmatch(s1, MNEXT(cs), mstring);
- if (ptr != NIL && s1 != s) {
+ if (ptr != NULL && s1 != s) {
/* we have a match, remember the match */
- strncpy(mstring, s, s1 - s);
+ strncpy(mstring, s, (size_t)(s1 - s));
mstring[s1 - s] = '\0';
- return (ptr);
- } else if (ptr != NIL && (*cs & OPT)) {
+ return ptr;
+ } else if (ptr != NULL && (*cs & OPT)) {
/* it was aoptional so no match is ok */
- return (ptr);
- } else if (ptr != NIL) {
+ return ptr;
+ } else if (ptr != NULL) {
/* not optional and we still matched */
- return (NIL);
+ return NULL;
}
if (!isalnum((unsigned char)*s1) && *s1 != '_')
- return (NIL);
+ return NULL;
if (*s1 == '\\')
- x_escaped = x_escaped ? FALSE : TRUE;
+ x_escaped = x_escaped ? false : true;
else
- x_escaped = FALSE;
+ x_escaped = false;
} while (*s1++);
- return (NIL);
+ return NULL;
/* try to match anything */
case 'a':
@@ -477,30 +485,30 @@ expmatch(
s1 = s;
do {
ptr = expmatch(s1, MNEXT(cs), mstring);
- if (ptr != NIL && s1 != s) {
+ if (ptr != NULL && s1 != s) {
/* we have a match */
- return (ptr);
- } else if (ptr != NIL && (*cs & OPT)) {
+ return ptr;
+ } else if (ptr != NULL && (*cs & OPT)) {
/* it was aoptional so no match is ok */
- return (ptr);
- } else if (ptr != NIL) {
+ return ptr;
+ } else if (ptr != NULL) {
/* not optional and we still matched */
- return (NIL);
+ return NULL;
}
if (*s1 == '\\')
- x_escaped = x_escaped ? FALSE : TRUE;
+ x_escaped = x_escaped ? false : true;
else
- x_escaped = FALSE;
+ x_escaped = false;
} while (*s1++);
- return (NIL);
+ return NULL;
/* fail if we are currently x_escaped */
case 'e':
if (x_escaped)
- return(NIL);
+ return NULL;
cs = MNEXT(cs);
break;
@@ -532,7 +540,7 @@ expmatch(
} else
/* no match, error return */
- return (NIL);
+ return NULL;
break;
/* check for end of line */
@@ -556,7 +564,7 @@ expmatch(
} else
/* no match, error return */
- return (NIL);
+ return NULL;
break;
/* check for start of line */
@@ -579,15 +587,15 @@ expmatch(
} else
/* no match, error return */
- return (NIL);
+ return NULL;
break;
/* end of a subexpression, return success */
case ')':
- return (s);
+ return s;
}
break;
}
}
- return (s);
+ return s;
}
Index: src/usr.bin/vgrind/vfontedpr.c
diff -u src/usr.bin/vgrind/vfontedpr.c:1.14 src/usr.bin/vgrind/vfontedpr.c:1.15
--- src/usr.bin/vgrind/vfontedpr.c:1.14 Tue Mar 20 16:34:59 2012
+++ src/usr.bin/vgrind/vfontedpr.c Tue Jul 15 09:17:15 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: vfontedpr.c,v 1.14 2012/03/20 20:34:59 matt Exp $ */
+/* $NetBSD: vfontedpr.c,v 1.15 2014/07/15 13:17:15 christos Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -29,6 +29,10 @@
* SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1980, 1993\
@@ -39,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
#if 0
static char sccsid[] = "@(#)vfontedpr.c 8.1 (Berkeley) 6/6/93";
#endif
-__RCSID("$NetBSD: vfontedpr.c,v 1.14 2012/03/20 20:34:59 matt Exp $");
+__RCSID("$NetBSD: vfontedpr.c,v 1.15 2014/07/15 13:17:15 christos Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -47,14 +51,12 @@ __RCSID("$NetBSD: vfontedpr.c,v 1.14 201
#include <time.h>
#include <ctype.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <string.h>
#include <stdio.h>
#include "pathnames.h"
#include "extern.h"
-#define FALSE 0
-#define TRUE !(FALSE)
-#define NIL 0
#define STANDARD 0
#define ALTERNATE 1
@@ -69,25 +71,25 @@ __RCSID("$NetBSD: vfontedpr.c,v 1.14 201
#define PNAMELEN 40 /* length of a function/procedure name */
#define PSMAX 20 /* size of procedure name stacking */
-static int iskw __P((char *));
-static boolean isproc __P((char *));
-static void putKcp __P((char *, char *, boolean));
-static void putScp __P((char *));
-static void putcp __P((int));
-static int tabs __P((char *, char *));
-static int width __P((char *, char *));
+static int iskw(char *);
+static bool isproc(char *);
+static void putKcp(char *, char *, bool);
+static void putScp(char *);
+static void putcp(int);
+static int tabs(char *, char *);
+static int width(char *, char *);
/*
* The state variables
*/
-static boolean filter = FALSE; /* act as a filter (like eqn) */
-static boolean inchr; /* in a string constant */
-static boolean incomm; /* in a comment of the primary type */
-static boolean idx = FALSE; /* form an index */
-static boolean instr; /* in a string constant */
-static boolean nokeyw = FALSE; /* no keywords being flagged */
-static boolean pass = FALSE; /*
+static bool filter = false; /* act as a filter (like eqn) */
+static bool inchr; /* in a string constant */
+static bool incomm; /* in a comment of the primary type */
+static bool idx = false; /* form an index */
+static bool instr; /* in a string constant */
+static bool nokeyw = false; /* no keywords being flagged */
+static bool pass = false; /*
* when acting as a filter, pass indicates
* whether we are currently processing
* input.
@@ -100,7 +102,7 @@ static const char *defsfile[2] = { _PATH
static int margin;
static int plstack[PSMAX]; /* the procedure nesting level stack */
static char pname[BUFSIZ+1];
-static boolean prccont; /* continue last procedure */
+static bool prccont; /* continue last procedure */
static int psptr; /* the stack index of the current procedure */
static char pstack[PSMAX][PNAMELEN+1]; /* the procedure name stack */
@@ -121,7 +123,7 @@ char *l_keywds[BUFSIZ/2]; /* keyword tab
char *l_prcbeg; /* regular expr for procedure begin */
char *l_strbeg; /* delimiter for string constant */
char *l_strend; /* delimiter for string constant */
-boolean l_toplex; /* procedures only defined at top lex level */
+bool l_toplex; /* procedures only defined at top lex level */
const char *language = "c"; /* the language indicator */
int main(int, char **);
@@ -240,7 +242,7 @@ main(int argc, char *argv[])
exit(0);
}
if (cgetustr(defs, "kw", &cp) == -1)
- nokeyw = TRUE;
+ nokeyw = true;
else {
char **cpp;
@@ -253,7 +255,7 @@ main(int argc, char *argv[])
while (*cp != ' ' && *cp != '\t' && *cp)
cp++;
}
- *cpp = NIL;
+ *cpp = NULL;
}
cgetustr(defs, "pb", &cp);
l_prcbeg = convexp(cp);
@@ -283,10 +285,10 @@ main(int argc, char *argv[])
/* initialize the program */
- incomm = FALSE;
- instr = FALSE;
- inchr = FALSE;
- x_escaped = FALSE;
+ incomm = false;
+ instr = false;
+ inchr = false;
+ x_escaped = false;
blklevel = 0;
for (psptr=0; psptr<PSMAX; psptr++) {
pstack[psptr][0] = '\0';
@@ -322,12 +324,12 @@ main(int argc, char *argv[])
if (buf[0] == '.') {
printf("%s", buf);
if (!strncmp (buf+1, "vS", 2))
- pass = TRUE;
+ pass = true;
if (!strncmp (buf+1, "vE", 2))
- pass = FALSE;
+ pass = false;
continue;
}
- prccont = FALSE;
+ prccont = false;
if (!filter || pass)
putScp(buf);
else
@@ -362,7 +364,7 @@ putScp(char *os)
char *blkeptr; /* end of a lexical block end */
x_start = os; /* remember the start for expmatch */
- x_escaped = FALSE;
+ x_escaped = false;
if (nokeyw || incomm || instr)
goto skip;
if (isproc(s)) {
@@ -388,15 +390,15 @@ skip:
chrptr = expmatch(s, l_chrbeg, dummy);
/* start of a comment? */
- if (comptr != NIL)
- if ((comptr < strptr || strptr == NIL)
- && (comptr < acmptr || acmptr == NIL)
- && (comptr < chrptr || chrptr == NIL)
- && (comptr < blksptr || blksptr == NIL)
- && (comptr < blkeptr || blkeptr == NIL)) {
- putKcp(s, comptr-1, FALSE);
+ if (comptr != NULL)
+ if ((comptr < strptr || strptr == NULL)
+ && (comptr < acmptr || acmptr == NULL)
+ && (comptr < chrptr || chrptr == NULL)
+ && (comptr < blksptr || blksptr == NULL)
+ && (comptr < blkeptr || blkeptr == NULL)) {
+ putKcp(s, comptr-1, false);
s = comptr;
- incomm = TRUE;
+ incomm = true;
comtype = STANDARD;
if (s != os)
ps("\\c");
@@ -405,14 +407,14 @@ skip:
}
/* start of a comment? */
- if (acmptr != NIL)
- if ((acmptr < strptr || strptr == NIL)
- && (acmptr < chrptr || chrptr == NIL)
- && (acmptr < blksptr || blksptr == NIL)
- && (acmptr < blkeptr || blkeptr == NIL)) {
- putKcp(s, acmptr-1, FALSE);
+ if (acmptr != NULL)
+ if ((acmptr < strptr || strptr == NULL)
+ && (acmptr < chrptr || chrptr == NULL)
+ && (acmptr < blksptr || blksptr == NULL)
+ && (acmptr < blkeptr || blkeptr == NULL)) {
+ putKcp(s, acmptr-1, false);
s = acmptr;
- incomm = TRUE;
+ incomm = true;
comtype = ALTERNATE;
if (s != os)
ps("\\c");
@@ -421,30 +423,30 @@ skip:
}
/* start of a string? */
- if (strptr != NIL)
- if ((strptr < chrptr || chrptr == NIL)
- && (strptr < blksptr || blksptr == NIL)
- && (strptr < blkeptr || blkeptr == NIL)) {
- putKcp(s, strptr-1, FALSE);
+ if (strptr != NULL)
+ if ((strptr < chrptr || chrptr == NULL)
+ && (strptr < blksptr || blksptr == NULL)
+ && (strptr < blkeptr || blkeptr == NULL)) {
+ putKcp(s, strptr-1, false);
s = strptr;
- instr = TRUE;
+ instr = true;
continue;
}
/* start of a character string? */
- if (chrptr != NIL)
- if ((chrptr < blksptr || blksptr == NIL)
- && (chrptr < blkeptr || blkeptr == NIL)) {
- putKcp(s, chrptr-1, FALSE);
+ if (chrptr != NULL)
+ if ((chrptr < blksptr || blksptr == NULL)
+ && (chrptr < blkeptr || blkeptr == NULL)) {
+ putKcp(s, chrptr-1, false);
s = chrptr;
- inchr = TRUE;
+ inchr = true;
continue;
}
/* end of a lexical block */
- if (blkeptr != NIL) {
- if (blkeptr < blksptr || blksptr == NIL) {
- putKcp(s, blkeptr - 1, FALSE);
+ if (blkeptr != NULL) {
+ if (blkeptr < blksptr || blksptr == NULL) {
+ putKcp(s, blkeptr - 1, false);
s = blkeptr;
blklevel--;
if (psptr >= 0 && plstack[psptr] >= blklevel) {
@@ -457,7 +459,7 @@ skip:
/* see if we should print the last proc name */
if (--psptr >= 0)
- prccont = TRUE;
+ prccont = true;
else
psptr = -1;
}
@@ -466,8 +468,8 @@ skip:
}
/* start of a lexical block */
- if (blksptr != NIL) {
- putKcp(s, blksptr - 1, FALSE);
+ if (blksptr != NULL) {
+ putKcp(s, blksptr - 1, false);
s = blksptr;
blklevel++;
continue;
@@ -477,53 +479,53 @@ skip:
} else if (incomm) {
comptr = expmatch(s, l_comend, dummy);
acmptr = expmatch(s, l_acmend, dummy);
- if (((comtype == STANDARD) && (comptr != NIL)) ||
- ((comtype == ALTERNATE) && (acmptr != NIL))) {
+ if (((comtype == STANDARD) && (comptr != NULL)) ||
+ ((comtype == ALTERNATE) && (acmptr != NULL))) {
if (comtype == STANDARD) {
- putKcp(s, comptr-1, TRUE);
+ putKcp(s, comptr-1, true);
s = comptr;
} else {
- putKcp(s, acmptr-1, TRUE);
+ putKcp(s, acmptr-1, true);
s = acmptr;
}
- incomm = FALSE;
+ incomm = false;
ps("\\c\n'-C\n");
continue;
} else {
- putKcp(s, s + strlen(s) -1, TRUE);
+ putKcp(s, s + strlen(s) -1, true);
s = s + strlen(s);
continue;
}
/* check for end of string */
} else if (instr) {
- if ((strptr = expmatch(s, l_strend, dummy)) != NIL) {
- putKcp(s, strptr-1, TRUE);
+ if ((strptr = expmatch(s, l_strend, dummy)) != NULL) {
+ putKcp(s, strptr-1, true);
s = strptr;
- instr = FALSE;
+ instr = false;
continue;
} else {
- putKcp(s, s+strlen(s)-1, TRUE);
+ putKcp(s, s+strlen(s)-1, true);
s = s + strlen(s);
continue;
}
/* check for end of character string */
} else if (inchr) {
- if ((chrptr = expmatch(s, l_chrend, dummy)) != NIL) {
- putKcp(s, chrptr-1, TRUE);
+ if ((chrptr = expmatch(s, l_chrend, dummy)) != NULL) {
+ putKcp(s, chrptr-1, true);
s = chrptr;
- inchr = FALSE;
+ inchr = false;
continue;
} else {
- putKcp(s, s+strlen(s)-1, TRUE);
+ putKcp(s, s+strlen(s)-1, true);
s = s + strlen(s);
continue;
}
}
/* print out the line */
- putKcp(s, s + strlen(s) -1, FALSE);
+ putKcp(s, s + strlen(s) -1, false);
s = s + strlen(s);
} while (*s);
}
@@ -532,7 +534,7 @@ static void
putKcp(
char *start, /* start of string to write */
char *end, /* end of string to write */
- boolean force) /* true if we should force nokeyw */
+ bool force) /* true if we should force nokeyw */
{
int i;
int xfld = 0;
@@ -582,7 +584,7 @@ static int
tabs(char *s, char *os)
{
- return (width(s, os) / 8);
+ return width(s, os) / 8;
}
static int
@@ -602,7 +604,7 @@ width(char *s, char *os)
i++;
s++;
}
- return (i);
+ return i;
}
static void
@@ -669,15 +671,15 @@ putcp(int c)
/*
* look for a process beginning on this line
*/
-static boolean
+static bool
isproc(char *s)
{
pname[0] = '\0';
if (!l_toplex || blklevel == 0)
- if (expmatch(s, l_prcbeg, pname) != NIL) {
- return (TRUE);
+ if (expmatch(s, l_prcbeg, pname) != NULL) {
+ return true;
}
- return (FALSE);
+ return false;
}
@@ -695,6 +697,6 @@ iskw(char *s)
i++;
while ((cp = *ss++) != NULL)
if (!STRNCMP(s,cp,i) && !isidchr((unsigned char)cp[i]))
- return (i);
- return (0);
+ return i;
+ return 0;
}