home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 446.lha / parseargs / useful.h < prev   
C/C++ Source or Header  |  1990-12-05  |  2KB  |  113 lines

  1. /*
  2. **  USEFUL.H -- various definitions of general interest
  3. **
  4. **    $Header: useful.h,v 2.0 89/12/24 00:56:33 eric Exp $
  5. **
  6. **    Author:
  7. **        Eric Allman
  8. **        University of California, Berkeley
  9. */
  10.  
  11. #ifndef _USEFUL_H_
  12. #define _USEFUL_H_
  13.  
  14. #include <stdio.h>
  15.  
  16. /* give a stab at the multiple-language dilemma */
  17. #ifdef __STDC__
  18. #define ARGS(x)        x
  19. #define NOARGS        (void)
  20. #define __ANSI_C__
  21. #else
  22. #if defined(c_plusplus) || defined(__cplusplus)
  23. #define ARGS(x)        x
  24. #define NOARGS        ()
  25. #define __ANSI_C__
  26. #else
  27. #define ARGS(x)        ()
  28. #define NOARGS        ()
  29. #endif
  30. #endif
  31.  
  32. #ifndef VOID
  33. #ifdef __ANSI_C__
  34. #define VOID        void
  35. #else
  36. #define VOID        int
  37. #endif
  38. #endif
  39.  
  40. #ifndef TRUE
  41. #define TRUE        1
  42. #define FALSE        0
  43. #endif
  44.  
  45. #ifndef BOOL
  46. #define BOOL        char
  47. #endif
  48.  
  49. #ifndef STATIC
  50. #ifndef NODEBUG
  51. #define STATIC
  52. #else
  53. #define STATIC        static
  54. #endif
  55. #endif
  56.  
  57. #ifndef EXTERN
  58. #define EXTERN        extern
  59. #endif
  60.  
  61. #ifndef CONST
  62. #ifdef __ANSI_C__
  63. #define CONST        const
  64. #else
  65. #define CONST
  66. #endif
  67. #endif
  68.  
  69. #ifndef NULL
  70. #define NULL        0
  71. #endif
  72.  
  73. #ifndef CHARNULL
  74. #define CHARNULL    ((char *) NULL)
  75. #endif
  76.  
  77. #define FILENULL    ((FILE *) NULL)
  78.  
  79. #ifdef __ANSI_C__
  80. #define ARBPTR        void *
  81. #else
  82. #define ARBPTR        char *
  83. #endif
  84. #define __        (ARBPTR)
  85. #define ARBNULL        (__ NULL)
  86.  
  87. #ifdef lint
  88. #define VERSIONID(v)
  89. #else
  90. #define VERSIONID(v)    static char _Version[] = v;
  91. #endif
  92.  
  93. #define BITSET(b, w)    (((b) & (w)) != 0)
  94.  
  95. #ifdef __STDC__
  96. #include <string.h>
  97. #else
  98. extern char    *strchr ARGS((char *, char));
  99. extern char    *strrchr ARGS((char *, char));
  100. #endif
  101.  
  102. extern ARBPTR    ckalloc ARGS((unsigned int));
  103.  
  104. #define MAXINPUTLINE    200        /* maximum string input line */
  105. #define MAXWORDLEN    100        /* maximum word (token) length */
  106.  
  107. #ifndef BSD
  108. #define bcopy(f,t,l) memcpy(t,f,l)
  109. #define bcmp(s,t,l) memcmp(s,t,l)
  110. #endif
  111.  
  112. #endif /* _USEFUL_H_ */
  113.