home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 195_01 / stdio.h < prev    next >
Text File  |  1987-10-05  |  2KB  |  78 lines

  1. /* [STDIO.H of JUGPDS Vol.17]
  2. *****************************************************************
  3. *                                *
  4. *    Written by  Hakuo Katayose (JUG-CP/M No.179)        *
  5. *            49-114 Kawauchi-Sanjuunin-machi        *
  6. *            Sendai, Miyagi 980                          *
  7. *            Phone: 0222-61-3219                *
  8. *                                *
  9. *    Edited & tested by Y. Monma (JUG-C/M Disk Editor)       * 
  10. *                                *
  11. *****************************************************************
  12. */
  13.  
  14. /* stdio.h - Standard I/O Header for Software Tools */
  15.  
  16. #include <bdscio.h>
  17.  
  18. /*
  19.  *    Definitions for CP/M 
  20.  */
  21.  
  22.  
  23. #define STDIN      0
  24. #define STDOUT     1
  25. #define STDLST     2
  26. #define DEVRDR     3
  27. #define DEVPUN     3
  28. #define STDERR     4
  29.  
  30. #define LETTER     'a'
  31. #define DIGIT      '0'
  32. #define QUOTE      '"'
  33.  
  34. #define NUMBER       '0'
  35. #define ALPHA      'A'
  36. #define LPAREN       '('
  37. #define RPAREN     ')'
  38. #define LBRACKET   '['
  39. #define RBRACKET   ']'
  40.  
  41. #define YES        1
  42. #define NO         0
  43.  
  44. #define EOS       '\0'
  45. #define CPMBREAK   0x003
  46. #define BELL       0x007
  47. #define BACKSPACE  0x008
  48. #define TAB       '\t'
  49. #define CRETURN       '\r'
  50. #define VT       0x00b
  51. #define FORMFEED   0x00c
  52. #define NEWLINE       '\n'
  53. #define ESC       0x01b
  54. #define SPACE       ' '
  55. #define BLANK       ' '
  56.  
  57.  
  58. /*
  59.  *    macros
  60.  */
  61.  
  62. /*
  63. #define abs(x)        ((x) < 0 ? -(x) : (x))
  64. #define isalpha(c)    (islower(c) || isupper(c))
  65. #define isdigit(c)    ('0' <= (c) && (c) <= '9')
  66. #define islower(c)    ('a' <= (c) && (c) <= 'z')
  67. #define isupper(c)    ('A' <= (c) && (c) <= 'Z')
  68. #define iswhite(c)    ((c) <= ' ' || 0177 <= (c)) /* ASCII only */
  69. #define isspace(c)    ((c) == ' ' || (c) == '\t' || (c) == '\n')
  70. #define tolower(c)    (isupper(c) ? ((c) + ('a' - 'A')) : (c))
  71. #define toupper(c)    (islower(c) ? ((c) - ('a' - 'A')) : (c))
  72. */
  73.  
  74. #define max(x, y)    (((x) < (y)) ? (y) : (x))
  75. #define min(x, y)    (((x) < (y)) ? (x) : (y))
  76.  
  77. #define remark(str)    (fprintf(STDERR,"%s\n",(str)))
  78.