/* * This file is part of the UCB release of Plan 9. It is subject to the license * terms in the LICENSE file found in the top-level directory of this * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No * part of the UCB release of Plan 9, including this file, may be copied, * modified, propagated, or distributed except according to the terms contained * in the LICENSE file. */ /* * * debugger * */ #include "defs.h" #include "fns.h" Rune line[LINSIZ]; extern int infile; Rune *lp; int peekc,lastc = EOR; int eof; /* input routines */ eol(int c) { return(c==EOR || c==';'); } int rdc(void) { do { readchar(); } while (lastc==SPC || lastc==TB); return(lastc); } void reread(void) { peekc = lastc; } void clrinp(void) { flush(); lp = 0; peekc = 0; } int readrune(int fd, Rune *r) { char buf[UTFmax+1]; int i; for(i=0; i: ... * * we handle this case specially because we have to look ahead * at the token after the colon to decide if it is a file reference * or a colon-command with a symbol name prefix. */ int isfileref(void) { Rune *cp; for (cp = lp-1; *cp && !strchr(CMD_VERBS, *cp); cp++) if (*cp == '\\' && cp[1]) /* escape next char */ cp++; if (*cp && cp > lp-1) { while (*cp == ' ' || *cp == '\t') cp++; if (*cp++ == ':') { while (*cp == ' ' || *cp == '\t') cp++; if (isdigit(*cp)) return 1; } } return 0; }