home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 December / CHIP_CD_1996_12_PL.iso / software / trial / megacad.pl / cc / std.h_ / std.h
Encoding:
Text File  |  1996-07-12  |  4.0 KB  |  125 lines

  1. typedef unsigned char  uchar;
  2. typedef unsigned short ushort;
  3. typedef unsigned int   uint;
  4. typedef unsigned long  ulong;
  5. typedef signed   char  schar;
  6.  
  7. #define FALSE          0
  8. #define TRUE           1
  9.  
  10. #define DEF_PI         3.14159265358979323846264338327950
  11.  
  12. #if defined ( MEGATECH_C )
  13.     #define EXT(n)         extmega n
  14.     #define _far
  15.     #define _pascal
  16.     #define NULL           (void*)0L
  17.     #define va_start(ap,v) ap = (char*)((&v) + 1)
  18.  
  19.     typedef struct _hentry
  20.     {
  21.         ulong  size;        // Size of entry (if bit 31 set => free entry)
  22.         char   *ptr;        // Address of entry
  23.     } t_hentry;
  24.  
  25.     #define ML_READ        0x0
  26.     #define ML_WRITE       0x1
  27.     #define ML_PLUS        0x2
  28.     #define ML_BIN         0x0
  29.     #define ML_TEXT        0x4
  30.     #define ML_APPEND      0x8
  31.     #define ML_CHANGE_ATTR 0x10
  32.     #define ML_SET_CHANGE  0x20
  33.     #define ML_DENY_NO     0x0
  34.     #define ML_DENY_RD     0x40
  35.     #define ML_DENY_WR     0x80
  36.     #define ML_DENY_RW     (ML_DENY_RD | ML_DENY_WR)
  37.  
  38.     EXT(1)  void   exit(int retcode);
  39.     EXT(2)  int    abs(int i);
  40.     EXT(3)  double fabs(double val);
  41.     EXT(4)  double acos(double val);
  42.     EXT(5)  double asin(double val);
  43.     EXT(6)  double atan(double val);
  44.     EXT(7)  double cos(double val);
  45.     EXT(8)  double sin(double val);
  46.     EXT(9)  double tan(double val);
  47.     EXT(10) double cosh(double val);
  48.     EXT(11) double sinh(double val);
  49.     EXT(12) double tanh(double val);
  50.     EXT(13) double log(double val);
  51.     EXT(14) double log10(double val);
  52.     EXT(15) double ceil(double val);
  53.     EXT(16) double floor(double val);
  54.     EXT(17) double sqrt(double val);
  55.     EXT(18) double exp(double val);
  56.     EXT(19) double hypot(double dx,double dy);
  57.     EXT(20) double atan2(double dy,double dx);
  58.     EXT(21) double fmod(double val1,double val2);
  59.     EXT(22) double pow(double val1,double val2);
  60.     EXT(23) double atof(char *str);
  61.     EXT(24) int    atoi(char *str);
  62.     EXT(25) char * malloc(uint size);
  63.     EXT(26) void   free(void *ptr);
  64.     EXT(27) ushort heapwalk(t_hentry *entry);
  65.     EXT(28) short  sprintf(char *buf,char *fmt,...);
  66.     EXT(29) short  vsprintf(char *buf,char *fmt,char *args);
  67.     EXT(30) int    rand(void);
  68.     EXT(31) void   srand(uint seed);
  69.     EXT(32) short  strcmp(char *str1,char *str2);
  70.     EXT(33) char * strcpy(char *dst,char *src);
  71.     EXT(34) char * strchr(char *dst,short chr);
  72.     EXT(35) uint   strlen(char *str);
  73.     EXT(36) void   memset(void *ptr,ushort fill,uint size);
  74.     EXT(37) short  ML_Open(char *name,ushort mode);
  75.     EXT(38) short  ML_Close(short fh);
  76.     EXT(39) short  ML_Remove(char *name);
  77.     EXT(40) uint   ML_Read(void *buf,uint size,short fh);
  78.     EXT(41) uint   ML_Write(void *buf,uint size,short fh);
  79.     EXT(42) long   ML_Tell(short fh);
  80.     EXT(43) short  ML_Seek(short fh,long offset,short origin);
  81.     EXT(44) short  ML_Printf(short fh,char *fmt,...);
  82.     EXT(45) long   ML_FileLen(short fh);
  83.     EXT(46) void   ML_Flush(short fh);
  84.     EXT(47) void   ML_Rewind(short fh);
  85.     EXT(48) short  ML_Puts(char *str,short fh);
  86.     EXT(49) char * ML_Gets(char *str,ushort max,short FH);
  87.     EXT(50) short  ML_Putc(short fh,short chr);
  88.     EXT(51) short  ML_Getc(short fh);
  89.     EXT(52) short  set_debug(short flag);
  90.  
  91. #else  // ( MEGATECH_C )
  92.  
  93.     #ifdef _WIN32
  94.         #include <windows.h>
  95.     #endif
  96.  
  97.     #ifdef _WINDOWS
  98.         #include <windows.h>
  99.     #endif
  100.     #define EXT(n)
  101.     #include <stdio.h>
  102.     #include <math.h>
  103.     #include <string.h>
  104.     #include <stdarg.h>
  105.     #include <malloc.h>
  106.     #ifdef _WINDOWS
  107.         #define sprintf  wsprintf
  108.         #define vsprintf wvsprintf
  109.     #endif
  110.  
  111.     #ifdef _WIN32
  112.         #define  _far
  113.         #define __far
  114.         #define  _near
  115.         #define __near
  116.         #define __pascal __stdcall
  117.         #define  _pascal __stdcall
  118.         #define   pascal __stdcall
  119.         #define _export
  120.         #define __export
  121.         #define hypot _hypot
  122.     #endif
  123.  
  124. #endif // ( MEGATECH_C )
  125.