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-gen.h < prev    next >
C/C++ Source or Header  |  1998-10-07  |  5KB  |  180 lines

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