home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / pine / pico / os_unix.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-06  |  4.5 KB  |  171 lines

  1. /*
  2.  * $Id: os_unix.h,v 4.18 1993/11/08 19:13:10 mikes Exp $
  3.  *
  4.  * Program:    Operating system dependent routines - Ultrix 4.1
  5.  *
  6.  *
  7.  * Michael Seibel
  8.  * Networks and Distributed Computing
  9.  * Computing and Communications
  10.  * University of Washington
  11.  * Administration Builiding, AG-44
  12.  * Seattle, Washington, 98195, USA
  13.  * Internet: mikes@cac.washington.edu
  14.  *
  15.  * Please address all bugs and comments to "pine-bugs@cac.washington.edu"
  16.  *
  17.  * Copyright 1991-1993  University of Washington
  18.  *
  19.  *  Permission to use, copy, modify, and distribute this software and its
  20.  * documentation for any purpose and without fee to the University of
  21.  * Washington is hereby granted, provided that the above copyright notice
  22.  * appears in all copies and that both the above copyright notice and this
  23.  * permission notice appear in supporting documentation, and that the name
  24.  * of the University of Washington not be used in advertising or publicity
  25.  * pertaining to distribution of the software without specific, written
  26.  * prior permission.  This software is made available "as is", and
  27.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  28.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  29.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  30.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  31.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  32.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  33.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  34.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  35.  *
  36.  * Pine and Pico are trademarks of the University of Washington.
  37.  * No commercial use of these trademarks may be made without prior
  38.  * written permission of the University of Washington.
  39.  *
  40.  */
  41.  
  42. #ifndef    OSDEP_H
  43. #define    OSDEP_H
  44.  
  45. #if    defined(dyn) || defined(AUX)
  46. #include    <strings.h>
  47. #else
  48. #include    <string.h>
  49. #endif
  50.  
  51. #undef    CTRL
  52. #include    <signal.h>
  53. #if    defined (ptx) || defined(sv4)
  54. /* DYNIX/ptx signal semantics are AT&T/POSIX; the sigset() call sets
  55.    the handler permanently, more like BSD signal(). */
  56. #define signal(s,f) sigset (s, f)
  57. #endif
  58.  
  59. #include    <ctype.h>
  60. #include    <sys/types.h>
  61.  
  62. #if    defined(POSIX) || defined(aix) || defined(COHERENT) || defined(isc) || defined(sv3)
  63. #include    <dirent.h>
  64. #else
  65. #include    <sys/dir.h>
  66. #endif
  67.  
  68. #if    defined(sco)
  69. #include    <sys/stream.h>
  70. #include    <sys/ptem.h>
  71. #endif
  72.  
  73. #include    <sys/stat.h>
  74.  
  75. /*
  76.  * 3b1 definition requirements
  77.  */
  78. #if    defined(ct)
  79. #define opendir(dn)    fopen(dn, "r")
  80. #define closedir(dirp)    fclose(dirp)
  81. typedef struct
  82.     {
  83.     int    dd_fd;            /* file descriptor */
  84.     int    dd_loc;            /* offset in block */
  85.     int    dd_size;        /* amount of valid data */
  86.     char    *dd_buf;        /* directory block */
  87.     }    DIR;            /* stream data from opendir() */
  88. #endif
  89.  
  90. /* Machine/OS definition            */
  91. #if    defined(ptx) || defined(sgi) || defined(sv4)
  92. #define TERMINFO    1               /* Use TERMINFO                  */
  93. #else
  94. #define TERMCAP        1               /* Use TERMCAP                  */
  95. #endif
  96.  
  97. /*
  98.  * type qsort() expects
  99.  */
  100. #if    defined(nxt)
  101. #define    QSType      void
  102. #define QcompType const void
  103. #else
  104. #define    QSType      int
  105. #define QcompType void
  106. #endif
  107.  
  108. /*
  109.  * File name separator, as a char and string
  110.  */
  111. #define    C_FILESEP    '/'
  112. #define    S_FILESEP    "/"
  113.  
  114. /*
  115.  * Place where mail gets delivered (for pico's new mail checking)
  116.  */
  117. #if    defined(sv3) || defined(ct) || defined(isc) || defined(AUX) || defined(sgi)
  118. #define    MAILDIR        "/usr/mail"
  119. #else
  120. #define    MAILDIR        "/usr/spool/mail"
  121. #endif
  122.  
  123.  
  124. /*
  125.  * What and where the tool that checks spelling is located.  If this is
  126.  * undefined, then the spelling checker is not compiled into pico.
  127.  */
  128. #if    defined(COHERENT) || defined(AUX)
  129. #define SPELLER         "/bin/spell"
  130. #else
  131. #define    SPELLER        "/usr/bin/spell"
  132. #endif
  133.  
  134. /* memcpy() is no good for overlapping blocks.  If that's a problem, use
  135.  * the memmove() in ../c-client
  136.  */
  137. #if    defined (ptx) || defined(sv4) || defined(sco) || defined(isc) || defined(AUX)
  138. #define bcopy(a,b,s) memcpy (b, a, s)
  139. #endif
  140.  
  141. /* memmove() is a built-in for AIX 3.2 xlc. */
  142. #if    defined (a32) || defined(COHERENT)
  143. #define bcopy(a,b,s) memmove (b, a, s)
  144. #endif
  145.  
  146. #if    defined(dyn)
  147. #define    strchr    index            /* Dynix doesn't know about strchr */
  148. #define    strrchr    rindex
  149. #endif    /* dyn */
  150.  
  151. extern struct KBSTREE *kpadseqs;
  152. extern int kbseq();
  153.  
  154. #if    TERMCAP
  155. extern struct KBSTREE *kpadseqs;
  156. #endif    /* TERMCAP */
  157.  
  158. #if    defined(bsd) || defined(nxt) || defined(dyn)
  159. #ifdef    ANSI
  160. extern char *getcwd(char *, int);
  161. #else
  162. extern char *getcwd();
  163. #endif
  164. #endif
  165.  
  166. #if    defined(COHERENT)
  167. #define void char
  168. #endif
  169.  
  170. #endif    /* OSDEP_H */
  171.