00001
00006
00007
00008 #ifndef _SHELL_H_
00009 #define _SHELL_H_
00010
00011
00012 struct centry
00013 {
00014 char *name;
00015 bool builtin;
00018 command (*procedure)(ushort, ushort, ushort, ushort, char *[]);
00019 };
00020
00021
00022 #define SHELL_BUFLEN 80
00023 #define SHELL_MAXTOK 16
00024 #define SHELL_CMDSTK 8192
00025 #define SHELL_CMDPRIO 20
00027
00028 #define SHELL_BANNER "\033[1;35m_______________________________________\n _ _ _____ ______ _ _ \n \\ \\ / /(_____)| ___ \\ | | | |\n \\ \\/ / _ | | | || | | |\n ) ( | | | | | || | | |\n / /\\ \\ _| |_ | | | || |___| |\n /_/ \\_\\(_____)|_| |_| \\______|\n---------------------------------------\033[0;39m\n"
00029
00030 #define SHELL_START "Welcome to the wonderful world of XINU!\n"
00031 #define SHELL_EXIT "Shell closed.\n"
00032 #define SHELL_PROMPT "xsh$ "
00033 #define SHELL_SYNTAXERR "Syntax error.\n"
00034 #define SHELL_CHILDERR "Cannot create.\n"
00036
00037 #define isEndOfLine(c) ((c) == '\0' || (c) == '\r' || (c) == '\n')
00038 #define isQuote(c) ((c) == '"' || (c) == '\'')
00039 #define isOtherSpecial(c) ((c) == '<' || (c) == '>' || (c) == '&')
00040 #define isWhitespace(c) ((c) == ' ' || (c) == '\t')
00041
00042 extern struct centry commandtab[];
00043 extern ulong ncommand;
00045
00046 process shell(ushort);
00047 short lexan(char *, ushort, char *, char *[]);
00048 command xsh_exit( ushort, ushort, ushort, ushort, char *[]);
00049 command xsh_gpiostat( ushort, ushort, ushort, ushort, char *[]);
00050 command xsh_help( ushort, ushort, ushort, ushort, char *[]);
00051 command xsh_kill( ushort, ushort, ushort, ushort, char *[]);
00052 command xsh_led( ushort, ushort, ushort, ushort, char *[]);
00053 command xsh_memstat( ushort, ushort, ushort, ushort, char *[]);
00054 command xsh_ps( ushort, ushort, ushort, ushort, char *[]);
00055 command xsh_reset( ushort, ushort, ushort, ushort, char *[]);
00056 command xsh_sleep ( ushort, ushort, ushort, ushort, char *[]);
00057 command xsh_test( ushort, ushort, ushort, ushort, char *[]);
00058 command xsh_testsuite(ushort, ushort, ushort, ushort, char *[]);
00059 command xsh_uartstat( ushort, ushort, ushort, ushort, char *[]);
00060
00061 #endif