home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / FUNK108A.ZIP / DOS32V30.ZIP / PAL / PAL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-10  |  8.1 KB  |  198 lines

  1. /*             Power Assembly Library  C header file            */
  2.  
  3. typedef unsigned char uchar;
  4. typedef unsigned short ushort;
  5. typedef unsigned long ulong;
  6. typedef void *pvoid;
  7. typedef char *pchar;
  8.  
  9.  
  10. #define  PAL_H
  11.  
  12. #ifndef FASTCALLS
  13. #define _fastcall
  14. #endif
  15.  
  16.  
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20.  
  21. /****************************************************************************
  22.  *       STARTUP
  23.  ***************************************************************************/
  24. extern ulong dos32version;       /* version of DOS32.                      */
  25. extern char  dos32system;        /* system type-RAW,XMS,VCPI or DPMI       */
  26. extern ulong exesize;            /* size in bytes                          */
  27. extern char * exename;           /* PSZ to executable name                 */
  28. extern pvoid _psp;               /* program segment prefix pointer         */
  29. extern char *_environ;           /* environment pointer                    */
  30. extern char **environ;           /* pointer of environment pointer table   */
  31. extern ulong envsize;            /* environment table size                 */
  32. extern pvoid _zero;              /* zero pointer                           */
  33. extern ulong _zero_sel;          /* selector of zero based semgnet         */
  34.  
  35. extern pvoid DMA_addr;            /* DMA near pointer address         */
  36. extern ulong DMA_size;            /* DMA buffer size                  */
  37. extern pvoid DMA_phys;            /* DMA physical address             */
  38.  
  39.  
  40. /****************************************************************************
  41.  * FILEIO - file I/O
  42.  ***************************************************************************/
  43. extern long _fastcall chdir(pchar path);
  44. extern long _fastcall close(long handle);
  45. extern long _fastcall filelength(long handle);
  46. extern long fprint(long handle,pchar fmtstr,...);
  47. extern long _fastcall lseek(long handle,long filepos,long whence);
  48. extern long _fastcall mkdir(pchar path);
  49. extern long _fastcall open(pchar filename,ulong filemode);
  50. extern long _fastcall read(long handle,pvoid buf,ulong len);
  51. extern long _fastcall rename(pchar oldname,pchar newname);
  52. extern long _fastcall rmdir(pchar path);
  53. extern long _fastcall unlink(pchar filename);
  54. extern long _fastcall write(long handle,pvoid buf,ulong len);
  55. extern long _fastcall creat(pchar filename, long filemode);
  56.  
  57. extern long fprintf(long handle, pchar fmtstr,...);
  58.  
  59. #define O_BINARY   0          /* Binary mode                                 */
  60. #define O_RDONLY   0          /* Read only                                   */
  61. #define O_WRONLY   1          /* Write only                                  */
  62. #define O_RDWR     2          /* Read and write                              */
  63. #define O_APPEND   4          /* File pointer will be set to the end of file */
  64. #define O_CREAT    8          /* Creates the file if it doesn't exist        */
  65. #define O_TRUNC    16          /* Truncate the file when open                 */
  66. #define O_EXCL     32         /* Returns an error if file exists (O_CREAT)   */
  67.  
  68. #define SEEK_SET   0          /* Seek from file beginning                    */
  69. #define SEEK_CUR   1          /* Seek from current file position             */
  70. #define SEEK_END   2          /* Seek from end of file                       */
  71.  
  72.  
  73. /*****************************************************************************
  74.  * MALLOC - memory allocation
  75.  ****************************************************************************/
  76. extern pvoid _fastcall malloc(ulong blocksize);
  77. extern pvoid _fastcall calloc(ulong blocksize);
  78. extern void _fastcall free(pvoid blockptr);
  79. extern ulong maxavail(void);
  80. extern ulong memavail(void);
  81. extern pvoid _fastcall realloc(pvoid blockptr,ulong size);
  82. extern pvoid _fastcall resize(pvoid blockptr,ulong size);
  83.  
  84.  
  85. /*****************************************************************************
  86.  *   MATH - math functions
  87.  ****************************************************************************/
  88. extern ulong _fastcall max(ulong a,ulong b);
  89. extern ulong _fastcall max3(ulong a,ulong b,ulong c);
  90. extern ulong _fastcall min(ulong a,ulong b);
  91. extern ulong _fastcall max3(ulong a,ulong b,ulong c);
  92. extern ulong _fastcall atoi(pchar string);
  93.  
  94.  
  95. /*****************************************************************************
  96.  * STRINGS - various string I/O
  97.  ****************************************************************************/
  98. extern ulong _fastcall isdigit(char chr);
  99. extern ulong _fastcall isxdigit(char chr);
  100. extern ulong _fastcall isalpha(char chr);
  101. extern ulong _fastcall islower(char chr);
  102. extern ulong _fastcall isupper(char chr);
  103. extern ulong _fastcall isalnum(char chr);
  104. extern ulong _fastcall iscntrl(char chr);
  105. extern ulong _fastcall isspace(char chr);
  106. extern ulong _fastcall ispunct(char chr);
  107. extern ulong _fastcall isascii(char chr);
  108. extern ulong _fastcall isprint(char chr);
  109. extern ulong _fastcall toupper(char chr);
  110. extern ulong _fastcall tolowwer(char chr);
  111.  
  112. extern pchar _fastcall btoa(ulong value,pchar string);
  113. extern pchar _fastcall ltoa(long value,pchar string,int radix);
  114. extern pchar _fastcall ultoa(ulong value,pchar string,int radix);
  115. extern pchar _fastcall otoa(ulong value,pchar string);
  116. extern pchar _fastcall xtoa(ulong value,pchar string);
  117. extern pchar _fastcall ptos(pvoid pascalstr);
  118. extern ulong sprintf(pchar dest,pchar fmtstr,...);
  119. extern pchar _fastcall stpcpy(pchar dest,pchar source);
  120. extern pchar _fastcall strcat(pchar dest,pchar source);
  121. extern pchar _fastcall strchr(pchar string,char chr);
  122. extern pchar _fastcall strchrn(char string,char chr);
  123. extern pchar _fastcall strcpy(pchar destptr,pchar srcptr);
  124. extern pchar _fastcall strdup(pchar string);
  125. extern long _fastcall strcmp(pchar srcptr,pchar destptr);
  126. extern long _fastcall stricmp(pchar srcptr,pchar destptr);
  127. extern ulong _fastcall strlen(pchar string);
  128. extern pchar _fastcall strlwr(pchar string);
  129. extern pchar _fastcall strupr(pchar string);
  130. extern pchar _fastcall strncpy(pchar dest,pchar source,ulong length);
  131. extern pchar _fastcall strpbrk(pchar s1,pchar s2);
  132.  
  133.  
  134. /**************************************************************************
  135.  * CONIO - console I/O
  136.  *************************************************************************/
  137.  
  138. extern long printf(pchar fmtstr,...);
  139. extern long kbhit(void);
  140.  
  141.  
  142. /*****************************************************************************
  143.  * SYSTEM - system specific
  144.  ****************************************************************************/
  145. extern void abort(void);
  146. extern ulong _fastcall atexit(pvoid exitfunc);
  147. extern void _fastcall exit(int errorlevel);
  148. extern pvoid _fastcall getvect(ulong interrupt);
  149. extern pvoid _fastcall setvect(ulong interrupt,pvoid vector);
  150. extern ulong _fastcall MK_FP(pvoid address);
  151. extern pvoid _fastcall MK_FAR(ulong);
  152. extern void _fastcall memset(pvoid buf,char value,ulong length);
  153. extern pvoid _fastcall memcpy(void * dest,void * source,int length);
  154. extern pvoid _fastcall memmove(void * dest, void * source, ulong count);
  155. extern void _fastcall _exit(ulong errorlevel);
  156. extern void _fastcall _cexit(void);
  157. extern pvoid _fastcall getenv(char * name);
  158. extern int _fastcall inp(unsigned portid);
  159. extern unsigned _fastcall inpw(unsigned portid);
  160. extern int _fastcall outp(unsigned portid, int value);
  161. extern unsigned _fastcall outpw(unsigned portid, unsigned value);
  162.  
  163. extern long errno;                      /* System error code */
  164.  
  165.  
  166. #ifdef __cplusplus
  167. }
  168. #endif
  169.  
  170.  
  171. /******************************************************************************
  172.   *  Standed macros
  173. ******************************************************************************/
  174. #define  EOF  -1
  175. #define  NULL  0
  176. #define  EXIT_SUCCESS 0
  177. #define  EXIT_FAILURE 1
  178.  
  179.  
  180.  
  181. /* extern long _fastcall fopen(pchar filename,pchar filemode);
  182.  
  183.  
  184. #define  stdin   0                    /* Standard input file ptr */
  185. #define  stdout  1                    /* Standard output file ptr */
  186. #define  stderr  2                    /* Standard error file ptr */
  187.  
  188. #define  fgetc  getc
  189. #define  fputc  putc
  190. #define  getchar() getc(stdin)
  191. #define  putchar(c) putc((c),stdout)
  192.  
  193. extern long _fastcall putc(char chr,long handle);
  194. extern long _fastcall getc(long handle);
  195.  
  196. */
  197.  
  198.