From f2efbb46ef89c7c1693400f7209113c50c959f02 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Wed, 13 Oct 2021 10:51:54 -0700 Subject: Feat(rc): working(ish) version of rc shell Removed compile commands --- sys/cmd/rc/here.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'sys/cmd/rc/here.c') diff --git a/sys/cmd/rc/here.c b/sys/cmd/rc/here.c index 17c6245..8175b04 100644 --- a/sys/cmd/rc/here.c +++ b/sys/cmd/rc/here.c @@ -2,12 +2,14 @@ #include "exec.h" #include "io.h" #include "fns.h" -struct here *here, **ehere; + +struct Here *here, **ehere; + int ser = 0; char tmp[]="/tmp/here0000.0000"; char hex[]="0123456789abcdef"; -void psubst(io*, char*); -void pstrs(io*, word*); +void psubst(Io*, char*); +void pstrs(Io*, Word*); void hexnum(char *p, int n) @@ -18,10 +20,11 @@ hexnum(char *p, int n) *p = hex[n&0xF]; } -tree* -heredoc(tree *tag) +Tree* +heredoc(Tree *tag) { - struct here *h = new(struct here); + struct Here *h = new(struct Here); + if(tag->type!=WORD) yyerror("Bad here tag"); h->next = 0; @@ -45,8 +48,8 @@ heredoc(tree *tag) void readhere(void) { - struct here *h, *nexth; - io *f; + struct Here *h, *nexth; + Io *f; char *s, *tag; int c, subst; char line[NLINE+1]; @@ -86,11 +89,11 @@ readhere(void) } void -psubst(io *f, char *s) +psubst(Io *f, char *s) { char *t, *u; int savec, n; - word *star; + Word *star; while(*s){ if(*s!='$'){ if(0xa0<=(*s&0xff) && (*s&0xff)<=0xf5){ @@ -137,7 +140,7 @@ psubst(io *f, char *s) } void -pstrs(io *f, word *a) +pstrs(Io *f, Word *a) { if(a){ while(a->next && a->next->word){ -- cgit v1.2.1