#include "spice.h"
#include "cpdefs.h"
#include "scedio.h"
Go to the source code of this file.
Definition at line 558 of file cshpar.c.
562 fprintf(
cp_err,
"Error: 'chdir' not available.\n");
Definition at line 468 of file cshpar.c.
475 fprintf(
cp_err,
"Error: unixcom not set.\n");
482 fprintf(
cp_err,
"Error: no PATH in environment.\n");
Definition at line 391 of file cshpar.c.
395 char *com, *shell =
NULL;
398 static RETSIGTYPE (*svint)( ), (*svquit)( ), (*svtstp)( );
416 (void) execl(shell, shell, 0);
421 (void) execl(
"/bin/sh",
"sh",
"-c", com, 0);
426 svint = signal(SIGINT, SIG_DFL);
427 svquit = signal(SIGQUIT, SIG_DFL);
428 svtstp = signal(SIGTSTP, SIG_DFL);
432 }
while ((r != pid) && pid != -1);
433 (void) signal(SIGINT, svint);
434 (void) signal(SIGQUIT, svquit);
435 (void) signal(SIGTSTP, svtstp);
void ShowPrompt(char *str)
Definition at line 572 of file cshpar.c.
struct wordlist * wl_next
void cp_fixdescriptors |
( |
| ) |
|
Definition at line 454 of file cshpar.c.
457 (void) dup2(fileno(
cp_in), fileno(stdin));
459 (void) dup2(fileno(
cp_out), fileno(stdout));
461 (void) dup2(fileno(
cp_err), fileno(stderr));
Definition at line 83 of file cshpar.c.
87 char *
s, *singlec =
"<>;&";
91 for (s = singlec; *s; s++)
int bzero(char *ptr, int num)
Definition at line 104 of file cshpar.c.
118 pwlist(wlist,
"Initial parse");
124 pwlist(wlist,
"After history substitution");
128 (void) putc(
'\n', stdout);
132 if (!
string && *wlist->
wl_word)
136 pwlist(wlist,
"After alias substitution");
Definition at line 197 of file cshpar.c.
201 bool gotinput =
false, gotoutput =
false, goterror =
false;
202 bool app =
false, erralso =
false;
216 "Error: ambiguous input redirect.\n");
223 "Error: missing name for input.\n");
232 tmpfp = fopen(t,
"r");
243 fprintf(
cp_err,
"Input file is %s...\n",
258 "Error: ambiguous output redirect.\n");
265 "Error: missing name for output.\n");
273 "Error: missing name for output.\n");
281 "Error: ambiguous error redirect.\n");
288 "Error: missing name for output.\n");
295 fprintf(stderr,
"Error: %s: file exists\n", s);
300 tmpfp = fopen(s,
"a");
302 tmpfp = fopen(s,
"w+");
314 fprintf(
cp_err,
"Output file is %s... %s\n",
315 w->
wl_word, app ?
"(append)" :
"");
struct wordlist * wl_prev
struct wordlist * wl_next
static bool fileexists |
( |
| ) |
|
|
static |
static bool fileexists |
( |
char * |
name | ) |
|
|
static |
Definition at line 378 of file cshpar.c.
int access(char *pth, int m)
static void pwlist |
( |
wordlist * |
wlist, |
|
|
char * |
name |
|
) |
| |
|
static |
Definition at line 143 of file cshpar.c.
152 fprintf(
cp_err,
"%s : [ ", name);
153 for (wl = wlist; wl; wl = wl->
wl_next)
struct wordlist * wl_next