sash.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (c) 1993 by David I. Bell
  3. * Permission is granted to use, distribute, or modify this source,
  4. * provided that this copyright notice remains intact.
  5. *
  6. * Definitions for stand-alone shell for system maintainance for Linux.
  7. */
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <malloc.h>
  12. #include <ctype.h>
  13. #define PATHLEN 256
  14. #define CMDLEN 1024
  15. #define MAXARGS 50
  16. #define ALIASALLOC 20
  17. #define STDIN 0
  18. #define STDOUT 1
  19. #define MAXSOURCE 10
  20. #ifdef COMMAND_HISTORY
  21. #define HISTORY_SIZE 20 /* Number of entries in command history */
  22. #endif
  23. #ifndef isblank
  24. #define isblank(ch) (((ch) == ' ') || ((ch) == '\t'))
  25. #endif
  26. #define isquote(ch) (((ch) == '"') || ((ch) == '\''))
  27. #define isdecimal(ch) (((ch) >= '0') && ((ch) <= '9'))
  28. #define isoctal(ch) (((ch) >= '0') && ((ch) <= '7'))
  29. typedef int BOOL;
  30. #define FALSE ((BOOL) 0)
  31. #define TRUE ((BOOL) 1)
  32. extern void do_alias(), do_cd(), do_exec(), do_exit(), do_prompt();
  33. extern void do_source(), do_umask(), do_unalias(), do_help(), do_ln();
  34. extern void do_cp(), do_mv(), do_rm(), do_chmod(), do_mkdir(), do_rmdir();
  35. extern void do_mknod(), do_chown(), do_chgrp(), do_sync(), do_printenv();
  36. extern void do_more(), do_cmp(), do_touch(), do_ls(), do_dd(), do_tar();
  37. extern void do_mount(), do_umount(), do_setenv(), do_pwd(), do_echo();
  38. extern void do_kill(), do_grep(), do_ed(), do_hexdump(), do_pid();
  39. extern void do_df(), do_ps(), do_reboot(), do_cat(), do_time(), do_free();
  40. extern void do_hostname(), do_sleep();
  41. extern void do_date();
  42. extern char *buildname();
  43. extern char *modestring();
  44. extern char *timestring();
  45. extern BOOL isadir();
  46. extern BOOL copyfile();
  47. extern BOOL match();
  48. extern BOOL makestring();
  49. extern BOOL makeargs();
  50. extern int expandwildcards();
  51. extern int namesort();
  52. extern char *getchunk();
  53. extern void freechunks();
  54. extern char *expandenvvar();
  55. extern BOOL intflag;
  56. extern int exit_code;
  57. /* END CODE */