home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3594 / xc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-11  |  5.5 KB  |  165 lines

  1. /*    xc.h -- header  file for XC
  2.     This file uses 4-character tabstops
  3. */
  4.  
  5. /* Local preferences and modems */
  6.  
  7. /*    ESCAPE_CHR
  8.     This is the character used as the "escape" character in terminal mode.
  9.     The default is ASCII 01 (control-A). To change this, redefine ESCAPE_CHR
  10.     and also ESC_STR.
  11.  
  12.     ESC_STR
  13.     This is the string used to describe the "escape" character within the
  14.     XC on-line help text. For example, if you want to change the "escape"
  15.     character to ESCAPE (ASCII 27), you'd redefine ESCAPE_CHR as 27 and ESC_STR
  16.     as "ESC".
  17.  
  18.     We deliberately did not choose the ESCAPE key itself because it used so
  19.     often by other programs: if you were logged into a remote system and
  20.     running, say, /bin/vi, it would be a great annoyance to have to hit ESCAPE
  21.     twice to get it transmitted once.)
  22. */
  23.  
  24. #define MY_ESC    01            /* control-A */
  25. #define ESC_STR    "Ctrl-A"    /* How MY_ESC is shown in on-line help */
  26.  
  27. /*    CAPTFILE
  28.     This is the default name given to the capture buffer in terminal mode (and
  29.     during script processing). You can always reset this while running the
  30.     program.
  31. */
  32. #define    CAPTFILE "capture.log"    /* Default capture file */
  33.  
  34. /*    LIBDIR
  35.     This is the default name given to a directory where PHFILE, STARTUP, and
  36.     any XC scripts might be found. XC will search for such files
  37.         1st) in a path in a colon-separated list of directories in
  38.              XC_PATH, if such an environment variable exists,
  39.         2nd) in the current directory,
  40.         3rd) in your HOME directory, if HOME is an environment variable,
  41.         4th) in LIBDIR.
  42. */
  43. #define LIBDIR "/pub/jpr/comm"    /* System wide storage of dot-files */
  44.  
  45. /*    PHFILE
  46.     This is the default name given to the dialing directory.
  47. */
  48. #define PHFILE ".phonelist"        /* Default phonelist file */
  49.  
  50. /*    STARTUP
  51.     This is the default name of the startup script for XC. If this file is
  52.     found it will be executed immediately on XC startup.
  53. */
  54. #define STARTUP ".xc"            /* XC Startup Script */
  55.  
  56. /*    DIALSTR
  57.     A format string to send a telephone number to the modem with the
  58.     appropriate dialing command.
  59. */
  60. #define DIALSTR "ATDT%s\r"        /* printf format for modem dial command */
  61.  
  62. /* DTR_DROPS_CARRIER
  63.     On some (most?) modems, dropping the DTR signal will instruct the modem
  64.     to disconnect the phone line. On most (some?) Unix systems, setting a
  65.     bit/second rate of 0 will drop carrier.
  66.  
  67.     If either of these conditions do NOT apply to your setup, set this value to
  68.     0 and an alternate hangup function will be used. This alternate function
  69.     sends the modem the ATTEN string, waits a few seconds, and then sends the
  70.     HANGUP string, so check if those are correct for your modem.
  71. */
  72. #define    DTR_DROPS_CARRIER    1    /* Dropping DTR drops carrier */
  73. #if !DTR_DROPS_CARRIER            /* If not, then we need the next two defines */
  74. # define ATTEN "+++"            /* Modem "attention" signal */
  75. # define HANGUP "ATH\r"            /* Modem "hang up" command */
  76. #endif
  77.  
  78.  
  79. /* Local Unix peculiarities */
  80.  
  81. /*    strchr and strrchr vs. index and rindex
  82.     Some Berkely and Xenix systems have index() and rindex() which are
  83.     functionally identical to the more standard strchr() and strrchr()
  84.     functions. Include these defines if your Unix supports index and
  85.     rindex INSTEAD of strchr and strrchr.
  86. */
  87. /* #define strchr    index    /**/
  88. /* #define strrchr    rindex    /**/
  89.  
  90. /*    DUP2
  91.     dup2() is not included with all versions of Unix. If your implementation
  92.     does not have dup2() (or if you are just not sure), define this as 0 and a
  93.     functional equivalent will be included in the source code.
  94. */
  95. #define DUP2    1            /* 0 if dup2() not available */
  96.  
  97. /*    STRSTR
  98.     The draft Ansi C standard specifies the "strstr" function to return the
  99.     position of a substring within a string. This is NOT included in many Unix
  100.     systems, so code for this function is included unless you define this as 1.
  101. */
  102. #define    STRSTR    0            /* 0 if strstr() not available */
  103.  
  104. /*    MEMSET
  105.     This function is not on earlier implementations of Unix. Define this as 0
  106.     if you don't have it; making it 1 will not include our equivalent code.
  107. */
  108. #define MEMSET    1            /* 0 if memset() not available */
  109.  
  110. /*    STRDUP
  111.     Again, a function not present on earlier versions of Unix, and again,
  112.     defining this as 0 will thereby include our functional equivalent.
  113. */
  114. #define STRDUP    1            /* 0 if strdup() not available */
  115.  
  116.  
  117. /* The reader is kindly invited to leave the rest of this just as it is! */
  118.  
  119. #define SOH        0x1        /* ^A */
  120. #define ETX        0x3        /* ^C */
  121. #define EOT        0x4        /* ^D */
  122. #define ENQ        0x5        /* ^E */
  123. #define ACK        0x6        /* ^F */
  124. #define DLE        0x10    /* ^P */
  125. #define XON        0x11    /* ^Q */
  126. #define XOFF    0x13    /* ^S */
  127. #define NAK         0x15    /* ^U */
  128. #define CAN        0x18    /* ^X */
  129.  
  130. #ifndef TRUE
  131. # define TRUE    1
  132. # define FALSE    0
  133. # define SUCCESS    1
  134. # define FAILURE    0
  135. #endif
  136.  
  137. #define SM_BUFF     256
  138. #define LG_BUFF 2048
  139. #define S    show(1,Msg)
  140. #define S2    show(2,Msg)
  141. #define    NULLS    ((char*)0)
  142. #define    NULLF    ((FILE*)0)
  143.  
  144. #ifdef DEBUG
  145. # define fprintf Fprintf
  146. # define fputc Fputc
  147. #endif
  148.  
  149. /* globals in three or more files */
  150.  
  151. extern int    CO, LI, bitmask, beep(), hangup(), mrate(), cbaud;
  152. extern short    capture, cismode, flowflag, linkflag, reterm;
  153. extern char captfile[], ddsname[], phonefile[], *mport(), word[], *wptr,
  154.             line[], Msg[], *lptr, Name[], *getenv(), *strstr(), *strcat(),
  155.             *strncat(), *strcpy(),*strncpy(), *strchr(), *strrchr(), *strdup();
  156. extern unsigned sleep();
  157. extern unsigned short getuid(), getgid(), geteuid(), getegid();
  158. extern void    cls(), cur_on(), cur_off(), do_script(), drawline(), exit(),
  159.             free(), getline(), getword(), intdel(), lc_word(), mescs(),
  160.             purge(), send_mbyte(), send_slowly(), sendbyte(), show(),
  161.             show_abort(), ttgoto(), xc_setflow();
  162. extern FILE *tfp,            /* the local terminal */
  163.             *openfile(), *QueryCreate();
  164. extern struct termio newmode, sigmode;
  165.