home *** CD-ROM | disk | FTP | other *** search
- /* vi:tabstop=4:shiftwidth=4:smartindent
- *
- * builtins.h - Struct and entries in the builtin functions list.
- *
- */
-
- typedef struct
- {
- char *cmd_name;
- char *cmd_help;
- int (*cmd_fun)(int, char **);
- } builtin;
-
- extern int do_builtin(char *cmd_line, int (*cmd_fun)(int argc, char **argv));
-
- #define CMD(fun) extern int fun(int argc, char **argv)
-
- CMD(sh_cd);
- CMD(sh_exec);
- CMD(sh_history);
- CMD(sh_pwd);
- CMD(sh_exit);
- CMD(sh_read);
- CMD(sh_dirs);
- CMD(sh_pushd);
- CMD(sh_popd);
- CMD(sh_help);
- CMD(sh_dbg);
- CMD(sh_autoconv);
- CMD(sh_source);
-
- #ifdef MAIN
- builtin builtins[] =
- {
- ".", "Execute commands from a file", sh_source,
- "autoconv", "Add a command name for uname conversion", sh_autoconv,
- "bye", "Same as exit", sh_exit,
- "cd", "Change directory, using CDPATH", sh_cd,
- "dirs", "Show the directory stack", sh_dirs,
- "exec", "Replace this shell with a command", sh_exec,
- "exit", "Same as bye", sh_exit,
- "help", "Show help on a command", sh_help,
- "history", "Show the history list", sh_history,
- "popd", "Pop a directory from the stack", sh_popd,
- "pushd", "Push a directory onto the stack", sh_pushd,
- "pwd", "Show the current directory", sh_pwd,
- "read", "Read a line into a variable", sh_read,
- "source", "Execute commands from a file", sh_source,
- "xyzzy", "Toggle debugging flag", sh_dbg,
- NULL, NULL, NULL
- };
- #else
- extern builtin builtins[];
- #endif
-