home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre3.z / postgre3 / src / lib / H / tmp / unix.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  2.3 KB  |  143 lines

  1. /*
  2.  * unix.h --
  3.  *    UNIX operating system definitions.
  4.  *
  5.  * Note:
  6.  *    This file is for the Sun UNIX OPERATING SYSTEM 3.4 or 3.5 or 3.6!!!
  7.  *
  8.  * Identification:
  9.  *    $Header: /private/postgres/src/lib/H/tmp/RCS/unix.h,v 1.7 1990/11/14 08:34:11 kemnitz Exp $
  10.  */
  11.  
  12. #ifndef    UNIXIncluded        /* Include this file only once */
  13. #define UNIXIncluded    1
  14.  
  15. #include <sys/types.h>
  16.  
  17. #include "tmp/c.h"
  18.  
  19. /*
  20.  * HostSystemPort --
  21.  *    Unbuffered system I/O port.
  22.  */
  23. typedef int    HostSystemPort;
  24.  
  25. /*
  26.  * HostSystemFileMode --
  27.  *    File mode.
  28.  */
  29. typedef int    HostSystemFileMode;
  30.  
  31. /*
  32.  * HostSystemByteCount --
  33.  *    Number of bytes--used in calls to read, write, etc.
  34.  */
  35. typedef int    HostSystemByteCount;
  36.  
  37. /*
  38.  * HostSystemFilePosition --
  39.  *    Number of bytes from beginning of file.
  40.  */
  41. typedef long    HostSystemFilePosition;
  42.  
  43. /*
  44.  * HostSystemFileOffset --
  45.  *    Number of offset bytes for lseek.
  46.  */
  47. typedef long    HostSystemFileOffset;
  48.  
  49. /*
  50.  * HostSystemTime --
  51.  *    Time in seconds from the UNIX epoch.
  52.  */
  53. typedef time_t    HostSystemTime;
  54.  
  55. /*
  56.  * open --
  57.  *    open(2)
  58.  */
  59. extern
  60. HostSystemPort
  61. open ARGS((
  62.     const String            path,
  63.     const int            flags,
  64.     const HostSystemFileMode    mode
  65. ));
  66.  
  67. /*
  68.  * close --
  69.  *    close(2)
  70.  */
  71. extern
  72. void
  73. close ARGS((
  74.     const HostSystemPort    port
  75. ));
  76.  
  77. /*
  78.  * read --
  79.  *    read(2)
  80.  *
  81.  * Note:
  82.  *    String may not be proper usage here.
  83.  */
  84. extern
  85. HostSystemByteCount
  86. read ARGS((
  87.     const HostSystemPort        port,
  88.     const String            buffer,
  89.     const HostSystemByteCount    numberBytes
  90. ));
  91.  
  92. /*
  93.  * write --
  94.  *    write(2)
  95.  *
  96.  * Note:
  97.  *    String may not be proper usage here.
  98.  */
  99. extern
  100. HostSystemByteCount
  101. write ARGS((
  102.     const HostSystemPort        port,
  103.     const String            buffer,
  104.     const HostSystemByteCount    numberBytes
  105. ));
  106.  
  107. /*
  108.  * lseek --
  109.  *    lseek(2)
  110.  */
  111. extern
  112. HostSystemFilePosition
  113. lseek ARGS((
  114.     const HostSystemPort        port,
  115.     const HostSystemFileOffset    offset,
  116.     const int            whence
  117. ));
  118.  
  119. /*
  120.  * time --
  121.  *    time(3)
  122.  */
  123. extern
  124. HostSystemTime
  125. time ARGS((
  126.     HostSystemTime    *tloc
  127. ));
  128.  
  129. /*
  130.  * These tests can be made more strict given a particular compiler.
  131.  *
  132.  * XXX Someday, this should go into the compiler port directory.
  133.  */
  134. #ifndef    __SABER__
  135. #define PointerIsToDynamicData(pointer)    ((bool)((char *)(pointer) >= end))
  136. #define PointerIsToStaticData(pointer)    ((bool)((char *)(pointer) < end))
  137. #else
  138. #define PointerIsToDynamicData(pointer)    (true)
  139. #define PointerIsToStaticData(pointer)    (true)
  140. #endif
  141.  
  142. #endif    /* !defined(UNIXIncluded) */
  143.