home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / unix / pine4.10.tar.gz / pine4.10.tar / pine4.10 / pico / osdep / os-bsd.h < prev    next >
C/C++ Source or Header  |  1998-10-07  |  5KB  |  185 lines

  1. #ifndef _PICO_OS_INCLUDED
  2. #define _PICO_OS_INCLUDED
  3.  
  4.  
  5. /*----------------------------------------------------------------------
  6.  
  7.    OS dependencies, BSD 4.3 version.  See also the os-bsd.c file.
  8.    The following stuff may need to be changed for a new port, but once
  9.    the port is done, it won't change.  At the bottom of the file are a few
  10.    constants that you may want to configure differently than they
  11.    are configured, but probably not.
  12.  
  13.  ----*/
  14.  
  15.  
  16.  
  17. /*----------------- Are we ANSI? ---------------------------------------*/
  18. /* #define ANSI   */     /* this is an ANSI compiler */
  19.  
  20. /*------ If our compiler doesn't understand type void ------------------*/
  21. /* #define void char */  /* no void in compiler */
  22.  
  23.  
  24. char *getenv();
  25. FILE *tmpfile();
  26. extern int stat();
  27. extern int errno;
  28. typedef long fpos_t;
  29.  
  30. #include <string.h>
  31. #include <sys/types.h>
  32. #include <sys/dir.h>
  33.  
  34.  
  35. /*------- Some more includes that should usually be correct ------------*/
  36. #include <pwd.h>
  37. #include <sys/wait.h>
  38. #include <sys/stat.h>
  39. #include <fcntl.h>
  40. #include <netdb.h>
  41.  
  42.  
  43.  
  44. /*----------------- locale.h -------------------------------------------*/
  45. /* #include <locale.h> */ /* To make matching and sorting work right */
  46. #define collator strucmp
  47.  
  48.  
  49.  
  50. /*----------------- time.h ---------------------------------------------*/
  51. /* #include <time.h>
  52. /* plain time.h isn't enough on some systems */
  53. #include <sys/time.h>  /* For struct timeval usually in time.h */ 
  54.  
  55.  
  56.  
  57. /*--------------- signal.h ---------------------------------------------*/
  58. #include <signal.h>      /* sometimes both required, sometimes */
  59. /* #include <sys/signal.h> */ /* only one or the other */
  60.  
  61. /* #define SigType void */  /* value returned by sig handlers is void */
  62. #define SigType int      /* value returned by sig handlers is int */
  63.  
  64. /* #define POSIX_SIGNALS */ /* use POSIX signal semantics (ttyin.c) */
  65. /* #define SYSV_SIGNALS  */ /* use System-V signal semantics (ttyin.c) */
  66.  
  67. #define SIG_PROTO(args) ()
  68.  
  69.  
  70.  
  71. /*-------------- A couple typedef's for integer sizes ------------------*/
  72. typedef unsigned int usign32_t;
  73. typedef unsigned short usign16_t;
  74.  
  75.  
  76.  
  77. /*-------------- qsort argument type -----------------------------------*/
  78. /* #define QSType void */
  79. #define QSType char  /* qsort arg is of type char * */
  80.  
  81.  
  82.  
  83. /*-------------- fcntl flag to set non-blocking IO ---------------------*/
  84. /*#define    NON_BLOCKING_IO    O_NONBLOCK */        /* POSIX style */
  85. #define    NON_BLOCKING_IO    FNDELAY        /* good ol' bsd style  */
  86.  
  87.  
  88.  
  89. /*
  90.  * Choose one of the following three terminal drivers
  91.  */
  92.  
  93. /*--------- Good 'ol BSD -----------------------------------------------*/
  94. #include <sgtty.h>      /* BSD-based systems */
  95.  
  96. /*--------- System V terminal driver -----------------------------------*/
  97. /* #define HAVE_TERMIO  */ /* this is for pure System V */
  98. /* #include <termio.h>  */ /* Sys V */
  99.  
  100. /*--------- POSIX terminal driver --------------------------------------*/
  101. /* #define HAVE_TERMIOS */ /* this is an alternative */
  102. /* #include <termios.h> */ /* POSIX */
  103.  
  104.  
  105.  
  106. /* Don't need to define this but do need to use either read.sel or read.pol
  107.  * in osdep. */
  108. /*-------- Use poll system call instead of select ----------------------*/
  109. /* #define USE_POLL  */    /* use the poll() system call instead of select() */
  110.  
  111.  
  112.  
  113. /*-------- Use terminfo database instead of termcap --------------------*/
  114. /* #define USE_TERMINFO */ /* use terminfo instead of termcap */
  115. #define USE_TERMCAP    /* use termcap */
  116.  
  117.  
  118.  
  119. /*-- What argument does wait(2) take? Define this if it is a union -----*/
  120. #define HAVE_WAIT_UNION  /* the arg to wait is a union wait * */
  121.  
  122.  
  123.  
  124. /*-------- Is window resizing available? -------------------------------*/
  125. #if defined(TIOCGWINSZ) && defined(SIGWINCH)
  126. #define RESIZING  /* SIGWINCH and friends */
  127. #endif
  128.  
  129.  
  130.  
  131. /*-------- If no vfork, use regular fork -------------------------------*/
  132. /* #define vfork fork */ /* vfork is just a lightweight fork, so can use fork */
  133.  
  134.  
  135.  
  136. /*---- When no screen size can be discovered this is the size used -----*/
  137. #define DEFAULT_LINES_ON_TERMINAL    (24)
  138. #define DEFAULT_COLUMNS_ON_TERMINAL    (80)
  139. #define NROW    DEFAULT_LINES_ON_TERMINAL
  140. #define NCOL    DEFAULT_COLUMNS_ON_TERMINAL
  141.  
  142.  
  143. /*----------------------------------------------------------------------
  144.  
  145.    Pico OS dependencies.
  146.  
  147.  ----*/
  148.  
  149.  
  150. /*
  151.  * File name separator, as a char and string
  152.  */
  153. #define C_FILESEP    '/'
  154. #define S_FILESEP    "/"
  155.  
  156. /*
  157.  * Place where mail gets delivered (for pico's new mail checking)
  158.  */
  159. #define MAILDIR        "/usr/spool/mail"
  160.  
  161. /*
  162.  * What and where the tool that checks spelling is located.  If this is
  163.  * undefined, then the spelling checker is not compiled into pico.
  164.  */
  165. #define SPELLER        "/usr/bin/spell"
  166.  
  167. #ifdef    MOUSE
  168. #define    XTERM_MOUSE_ON    "\033[?1000h"    /* DECSET with parm 1000 */
  169. #define    XTERM_MOUSE_OFF    "\033[?1000l"    /* DECRST with parm 1000  */
  170. #endif
  171.  
  172. /*
  173.  * Mode passed chmod() to make tmp files exclusively user read/write-able
  174.  */
  175. #define    MODE_READONLY    (0600)
  176.  
  177. /*
  178.  * Make sys_errlist visible
  179.  */
  180. extern char *sys_errlist[];
  181. extern int   sys_nerr;
  182.  
  183.  
  184. #endif /* _PICO_OS_INCLUDED */
  185.