home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p024 / 12.img / ADS1.LIB / ADSLIB.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-27  |  4.1 KB  |  154 lines

  1. /*    ADSLIB.H
  2.       (C) Copyright 1988-1992 by Autodesk, Inc.
  3.  
  4.       This program is copyrighted by Autodesk, Inc. and is  licensed
  5.       to you under the following conditions.  You may not distribute
  6.       or  publish the source code of this program in any form.   You
  7.       may  incorporate this code in object form in derivative  works
  8.       provided  such  derivative  works  are  (i.) are  designed and
  9.       intended  to  work  solely  with  Autodesk, Inc. products, and
  10.       (ii.)  contain  Autodesk's  copyright  notice  "(C)  Copyright
  11.       1988-1992 by Autodesk, Inc."
  12.  
  13.       AUTODESK  PROVIDES THIS PROGRAM "AS IS" AND WITH  ALL  FAULTS.
  14.       AUTODESK  SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF  MER-
  15.       CHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK,  INC.
  16.       DOES  NOT  WARRANT THAT THE OPERATION OF THE PROGRAM  WILL  BE
  17.       UNINTERRUPTED OR ERROR FREE.
  18.  
  19.       ADS definitions and system dependent controls.
  20.  
  21.       This also contains a substitute for stdlib.h on some systems.
  22.       If we know the system has stdlib.h, just include it.
  23.  
  24. */
  25.  
  26. #ifndef _adslib_h
  27. #define _adslib_h
  28.  
  29. #ifdef _MAXSTRING
  30. #undef    _MAXSTRING
  31. #define   _MAXSTRING  (~0)
  32. #endif
  33.  
  34.   
  35. /* Note: As of this writing, Sun ANSI C defines __STDC__, but
  36.    sets it to a non-numeric value.  This is contrary to the
  37.    ANSI standard, but we'll live with it for now.  Hence the
  38.    unusual handling of __STDC__. */
  39.  
  40. #ifdef __STDC__
  41. #define STDC_DEFINED 1
  42. #else
  43. #define STDC_DEFINED 0
  44. #endif
  45.  
  46. #ifdef _WINDOWS
  47. #define WIN 1
  48. #endif
  49.  
  50. #ifdef WINVER
  51. #define WIN 1
  52. #endif
  53.  
  54. #ifdef _MSC_VER
  55. #define MICROSOFT 1
  56. #endif
  57.  
  58. #ifdef __TURBOC__
  59. #define TURBOC 1
  60. #endif
  61.  
  62. #ifdef OS2
  63. #define PROTOTYPES 1
  64. #endif
  65.  
  66. #ifdef WIN
  67. #define main(a,b) ads_main(a,b)
  68. #define PROTOTYPES 1
  69. #endif  /* WIN */
  70.  
  71. #ifndef PROTOTYPES
  72. #if STDC_DEFINED || __cplusplus           /* "Standard C" or C++ */
  73. #define PROTOTYPES 1
  74. #endif  /* STDC_DEFINED || __cplusplus */
  75. #endif  /* !PROTOTYPES */
  76.  
  77.  
  78. /* useful definitions */
  79. #define TRUE    1
  80. #define FALSE   0
  81. #define EOS     '\0'
  82.  
  83. /*  Tricky macro for declaration of function types with optional
  84.     prototype (i.e., declaration of argument types).  The way the
  85.     macro "_()" is defined, the following declaration:
  86.  
  87.        int fcn _((int i, char c));
  88.  
  89.     will expand into either
  90.  
  91.        int fcn (int i, char c);
  92.        or
  93.        int fcn ();
  94.  
  95.     depending on whether the symbol PROTOTYPES is defined.  Thanks to
  96.     Bob Elman for this idea.  */
  97.  
  98. #ifdef PROTOTYPES
  99. #define   _(x)  x
  100. #else
  101. #define   _(x)  ()
  102. #endif /* PROTOTYPES */
  103.  
  104.  
  105.  
  106. /* Substitute for STDLIB.H on systems that do NOT have it.
  107.    Also enable use of const in adsxxx.h declarations.  */
  108.  
  109. #if       STDC_DEFINED || __cplusplus || WIN
  110. #include  <stdlib.h>
  111. #else
  112.  
  113. /* Declaration for ?alloc() was set to char * because that caused us fewer
  114.    compiler warnings in some substandard systems.  Now we declare it as ANSI
  115.    standard by default.  The Sparc compiler works fine with this, though the
  116.    obsolete lint on Unix screams its ancient head off.  (Serious programmers
  117.    use Gimpel's PC-Lint.)
  118.  
  119.    Any exceptions to the proper ANSI-style declaration must be explicitly
  120.    machine by machine. */
  121.  
  122. void *malloc _((size_t size));
  123. void *calloc _((unsigned int nelem, size_t elsize));
  124. void free _((void *ptr));
  125. #ifndef TURBOC
  126. #ifndef RMADS /* RMADS */
  127. double atof _((char *nptr));
  128. #else
  129. double atof _((const char *nptr));
  130. #endif        /* RMADS */
  131. #endif
  132. int atoi _((char *nptr));
  133. void exit _((int status));
  134. double fmod _((double x, double y));
  135.  
  136. /* Enable the use of const on machines that support it (by making it disappear
  137.    on these non-standard machines). */
  138. #ifndef const
  139. #define const                         /* Make const invisible for adsxxx.h */
  140. #define _adslib_h_const               /* Flag for later */
  141. #endif  /* !const */
  142. #endif  /*STDC_DEFINED || __cplusplus || WIN */
  143.  
  144. #include "ads.h"
  145. #include "adscodes.h"
  146.  
  147. #ifdef _adslib_h_const                /* Clean up after yourself */
  148. #undef const
  149. #undef _adslib_h_const
  150. #endif  /* !_adslib_h_const */
  151.  
  152.  
  153. #endif  /* !_adslib_h */
  154.