home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume6 / help / part1 / help.h < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  2.3 KB  |  94 lines

  1.  
  2.     /*
  3.          *    help.h: header file for the VMS-help emulator
  4.      */
  5.  
  6. #include <stdio.h>
  7. #include <ctype.h>
  8. #define BSD
  9. /* #define USG */
  10. #ifdef USG
  11. #include <sys/types.h>
  12. #endif
  13. #include <sys/file.h>
  14. #include <sys/param.h>
  15. #include <sys/dir.h>
  16. #ifdef BSD
  17. #include <sys/ioctl.h>
  18. #include <sys/signal.h>
  19. #endif
  20.  
  21.  
  22. #define iswhite(_c)       (_c ==' ' || _c =='    ' || _c =='\n' || _c =='\r')
  23. #define PROMPT " Topic? "
  24. #define SUBPROMPT "subtopic? "
  25. #define HELPEX    ".HLP"                /* help extension */
  26. #define    MANEX    ".MANUAL"            /* manual filename*/
  27. #define MAN_SUBEX "/.MANUAL"                    /* other man filename */
  28. #define XREFEX  ".XREF"                         /* cross reference */
  29. #define INFOHEAD "file "
  30. #define INFOTAIL " | sed 's/^/     /'"
  31.  
  32. #define LF '\n'
  33. #define RET '\r'
  34. #define ESC '\033'
  35.  
  36. #define    MAXLINELEN    128
  37. #define    MAXNAMELEN     24        /* max length of NAME of topix */
  38. #define    MAXNAMES    256        /* maximum number of subtopics */
  39. #define COLUMNSPACE      3
  40. #define TERMWID         78
  41. #define HELPDIR "/usr/help"
  42. #define VIEWPROGRAM  "/usr/ucb/more"    /* program to look at text */
  43. #define VIEWPROGOPTS1 "-d"
  44. #define VIEWPROGOPTS2 "-18"
  45. #define SHELLPROG    "/bin/sh"        /* program to execute text */
  46. #define SHELLOPTS    "-c"
  47.  
  48. char     progname[MAXNAMELEN];
  49. char    olddir[MAXNAMELEN + 68];
  50. char    newdir[MAXNAMELEN + 68];
  51. char    *helpdir;
  52. char    **environ;    /* environment, for forks */
  53. char    gbl_ppt[MAXLINELEN];
  54.  
  55. int    dumb_flag;
  56. int    list_flag;
  57. int    col_flag;
  58. int    frst_flag;
  59.  
  60. char    *helpcmds[] =
  61.     { "Return - Exit this level of help",
  62.       "*      - Print this message",
  63.       "?      - Reprint this help and its subtopics",
  64.       "#      - Reprint just subtopics of this help",
  65.       ".      - Look at current manual page, if any",
  66.       "$<topic>    - Get information on topic files",
  67.       ".<topic>    - Look at topic manual page, if any",
  68.       "<topic>     - Look at help for subtopic `topic'" ,
  69.       NULL
  70.     };
  71.  
  72. #ifdef BSD
  73. struct tchars  *init_tchars = NULL;
  74. struct tchars  *here_tchars = NULL;
  75.  
  76. #define Set_Tc_Init(FD) \
  77.         ((init_tchars==NULL)?(0):(ioctl(FD,TIOCSETC,init_tchars)))
  78. #define Set_Tc_Here(FD) \
  79.         ((here_tchars==NULL)?(0):(ioctl(FD,TIOCSETC,here_tchars)))
  80.  
  81. int is_tty = 0;
  82. char *read_resp();
  83.  
  84. #define ESC_COMP       1
  85. #define CTRLD_COMP    -1
  86. #define SPEC_CHARS  ".$?*#"
  87.  
  88. char gbl_match[MAXNAMELEN];
  89.  
  90. #else
  91. #define Set_Tc_Init  1
  92. #define Set_Tc_Here  0
  93. #endif
  94.