home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / perkinelmeridris / pe7std.h < prev    next >
C/C++ Source or Header  |  2020-01-01  |  2KB  |  76 lines

  1. /*    THE STANDARD HEADER
  2.  *    copyright (c) 1978 by Whitesmiths, Ltd.
  3.  */
  4.  
  5. /* the pseudo storage classes
  6.  */
  7. #define FAST    register
  8. #define GLOBAL    extern
  9. #define IMPORT    extern
  10. #define INTERN    static
  11. #define LOCAL    static
  12.  
  13. /* the pseudo types
  14.  */
  15. #ifdef UTEXT
  16. typedef unsigned char TEXT;
  17. #else
  18. typedef char TEXT;
  19. #endif
  20. typedef TEXT TBOOL;
  21. typedef char TINY;
  22. typedef double DOUBLE;
  23. typedef float FLOAT;
  24. typedef int ARGINT, BOOL, VOID;
  25. typedef long LONG;
  26. typedef short COUNT, FILE, METACH;
  27. typedef unsigned BYTES;
  28. typedef unsigned char UTINY;
  29. typedef unsigned long ULONG;
  30. typedef unsigned short BITS, UCOUNT;
  31.  
  32. /* system parameters
  33.  */
  34. #define STDIN    0
  35. #define STDOUT    1
  36. #define STDERR    2
  37. #define YES        1
  38. #define NO        0
  39. #define NULL    0
  40. #define FOREVER    for (;;)
  41. #define BUFSIZE    512
  42. #define BWRITE    -1
  43. #define READ    0
  44. #define WRITE    1
  45. #define UPDATE    2
  46. #define EOF        -1
  47. #define BYTMASK    0377
  48.  
  49. /*    macros
  50.  */
  51. #define abs(x)        ((x) < 0 ? -(x) : (x))
  52. #define gtc(pf)    (0 < (pf)->_nleft ? (--(pf)->_nleft, \
  53.         *(pf)->_pnext++ & BYTMASK) : getc(pf))
  54. #define isalpha(c)    (islower(c) || isupper(c))
  55. #define isdigit(c)    ('0' <= (c) && (c) <= '9')
  56. #define islower(c)    ('a' <= (c) && (c) <= 'z')
  57. #define isupper(c)    ('A' <= (c) && (c) <= 'Z')
  58. #define iswhite(c)    ((c) <= ' ' || 0177 <= (c))
  59. #define max(x, y)    (((x) < (y)) ? (y) : (x))
  60. #define min(x, y)    (((x) < (y)) ? (x) : (y))
  61. #define ptc(pf, c)    (((pf)->_nleft < 512) ? (pf)->_buf[(pf)->_nleft++] = (c) :\
  62.     putc(pf, c))
  63. #define tolower(c)    (isupper(c) ? ((c) + ('a' - 'A')) : (c))
  64. #define toupper(c)    (islower(c) ? ((c) - ('a' - 'A')) : (c))
  65.  
  66. /* the file IO structure
  67.  */
  68. typedef struct fio
  69.     {
  70.     FILE _fd;
  71.     COUNT _nleft;
  72.     COUNT _fmode;
  73.     TEXT *_pnext;
  74.     TEXT _buf[BUFSIZE];
  75.     } FIO;
  76.