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

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