rush
Revamped UNIX Shell
shellutils.h
Go to the documentation of this file.
1
13#ifndef SHELLUTILS_H
14#define SHELLUTILS_H
15
16
17#include <limits.h>
18#include <stdbool.h>
19
20
22#if (defined ARG_MAX && ARG_MAX <= 1048576)
23 #define MAX_CMDLINE_LEN ARG_MAX
24#else
25 #define MAX_CMDLINE_LEN 1048576
26#endif
27
28
30typedef struct {
31 char *inFile;
33 char *outFile;
37 const char *parseError;
40 char *cmdLine;
42 char **argv;
44} ShCommand;
45
46
53void shPrompt(void);
54
86ShCommand *shParseCmdLine(char cmdLine[]);
87
88
89#endif /* SHELLUTILS_H */
ShCommand * shParseCmdLine(char cmdLine[])
Parses a command line.
void shPrompt(void)
Prints a prompt symbol including the shell's current working directory.
The ShCommand structure contains a parsed command.
Definition: shellutils.h:30
char * inFile
Definition: shellutils.h:31
const char * parseError
Definition: shellutils.h:37
char * outFile
Definition: shellutils.h:33
char * cmdLine
Definition: shellutils.h:40
bool background
Definition: shellutils.h:35
char ** argv
Definition: shellutils.h:42