version 1.1, 1995/10/18 08:45:35 |
version 1.2, 1996/01/15 01:12:11 |
|
|
/* $NetBSD: eval.c,v 1.4 1995/09/28 05:37:28 tls Exp $ */ |
/* $NetBSD: eval.c,v 1.5 1996/01/13 23:25:23 pk Exp $ */ |
|
|
/* |
/* |
* Copyright (c) 1989, 1993 |
* Copyright (c) 1989, 1993 |
|
|
#if 0 |
#if 0 |
static char sccsid[] = "@(#)eval.c 8.2 (Berkeley) 4/27/95"; |
static char sccsid[] = "@(#)eval.c 8.2 (Berkeley) 4/27/95"; |
#else |
#else |
static char rcsid[] = "$NetBSD: eval.c,v 1.4 1995/09/28 05:37:28 tls Exp $"; |
static char rcsid[] = "$NetBSD: eval.c,v 1.5 1996/01/13 23:25:23 pk Exp $"; |
#endif |
#endif |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
|
|
* argv[2]) |
* argv[2]) |
*/ |
*/ |
if (argc > 3) { |
if (argc > 3) { |
|
int k; |
for (n = argc - 1; n > 3; n--) { |
for (n = argc - 1; n > 3; n--) { |
putback(rquote); |
k = strlen(rquote); |
|
while (k--) |
|
putback(rquote[k]); |
pbstr(argv[n]); |
pbstr(argv[n]); |
putback(lquote); |
k = strlen(lquote); |
|
while (k--) |
|
putback(lquote[k]); |
putback(','); |
putback(','); |
} |
} |
putback(rquote); |
k = strlen(rquote); |
|
while (k--) |
|
putback(rquote[k]); |
pbstr(argv[3]); |
pbstr(argv[3]); |
putback(lquote); |
k = strlen(lquote); |
|
while (k--) |
|
putback(lquote[k]); |
} |
} |
break; |
break; |
|
|
|
|
register ndptr p; |
register ndptr p; |
|
|
if ((p = lookup(name)) != nil && p->defn != null) { |
if ((p = lookup(name)) != nil && p->defn != null) { |
putback(rquote); |
int n = strlen(rquote); |
|
while (n--) |
|
putback(rquote[n]); |
pbstr(p->defn); |
pbstr(p->defn); |
putback(lquote); |
n = strlen(lquote); |
|
while (n--) |
|
putback(lquote[n]); |
} |
} |
} |
} |
|
|
|
|
{ |
{ |
if (argc > 2) { |
if (argc > 2) { |
if (*argv[2]) |
if (*argv[2]) |
lquote = *argv[2]; |
strncpy(lquote, argv[2], MAXCCHARS); |
if (argc > 3) { |
if (argc > 3) { |
if (*argv[3]) |
if (*argv[3]) |
rquote = *argv[3]; |
strncpy(rquote, argv[3], MAXCCHARS); |
} |
} |
else |
else |
rquote = lquote; |
strcpy(rquote, lquote); |
} |
} |
else { |
else { |
lquote = LQUOTE; |
lquote[0] = LQUOTE, lquote[1] = '\0'; |
rquote = RQUOTE; |
rquote[0] = RQUOTE, rquote[1] = '\0'; |
} |
} |
} |
} |
|
|
|
|
{ |
{ |
if (argc > 2) { |
if (argc > 2) { |
if (*argv[2]) |
if (*argv[2]) |
scommt = *argv[2]; |
strncpy(scommt, argv[2], MAXCCHARS); |
if (argc > 3) { |
if (argc > 3) { |
if (*argv[3]) |
if (*argv[3]) |
ecommt = *argv[3]; |
strncpy(ecommt, argv[3], MAXCCHARS); |
} |
} |
else |
else |
ecommt = ECOMMT; |
ecommt[0] = ECOMMT, ecommt[1] = '\0'; |
} |
} |
else { |
else { |
scommt = SCOMMT; |
scommt[0] = SCOMMT, scommt[1] = '\0'; |
ecommt = ECOMMT; |
ecommt[0] = ECOMMT, ecommt[1] = '\0'; |
} |
} |
} |
} |
|
|