home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / misc / FD2Pragma.lha / Source / SDI_ASM_STD_protos.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  3.8 KB  |  108 lines

  1. #ifndef SDI_ASM_STD_PROTOS_H
  2. #define SDI_ASM_STD_PROTOS_H
  3.  
  4. /* Includeheader
  5.  
  6.     Name:        SDI_ASM_STD_protos
  7.     Versionstring:    $VER: SDI_ASM_STD_protos.h 1.11 (06.02.97)
  8.     Author:        SDI
  9.     Distribution:    PD
  10.     Description:    my replacement for standard ANSI functions
  11.  
  12.  1.9   18.11.96 : converted text into english language, changed C++ comments
  13.      to C ones
  14.  1.10  29.11.96 : added printf
  15.  1.11  06.02.97 : added exit prototype
  16. */
  17.  
  18. /* These are mainly the normal ANSI C functions, but with an ASM interface.
  19. You can replace them by their normal functions supplied with your compiler,
  20. but do not mix them up (one object file standard, the other one SDI).
  21.  
  22. differences:
  23.  toupper and tolower: chars (0x41 to 0x5A) and (0xC0 to 0xDE) are upper
  24.   chars (0x61 to 0x79) and (0xE0 to 0xFE) are lower (some more than in ANSI)
  25.  isprint: chars (0x20 to 0x7F) and (0xA0 to 0xFF) are printable
  26.  sprintf and printf: only support exec/RawDoFmt format strings
  27.  and some I do not remember.
  28. */
  29.  
  30. #include <exec/types.h>
  31.  
  32. #ifdef __MAXON__
  33.   #define __asm
  34. #endif
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. BYTE __asm SDI_strnicmp(register __a0 STRPTR,    /* string 1            */
  41.             register __a1 STRPTR,    /* string 2            */
  42.             register __d1 ULONG);    /* highest testlength        */
  43. BYTE __asm SDI_strncmp(    register __a0 STRPTR,    /* string 1            */
  44.             register __a1 STRPTR,    /* string 2            */
  45.             register __d1 ULONG);    /* highest testlength        */
  46. UBYTE __asm SDI_tolower(register __d0 UBYTE);    /* character to convert        */
  47. UBYTE __asm SDI_toupper(register __d0 UBYTE);    /* character to convert        */
  48. ULONG __asm SDI_strlen( register __a0 STRPTR);    /* string            */
  49. ULONG __asm SDI_isprint(register __d0 UBYTE);    /* character to convert        */
  50. ULONG __asm SDI_isdigit(register __d0 UBYTE);    /* character to convert        */
  51. ULONG __asm SDI_isxdigit(register __d0 UBYTE);    /* character to convert        */
  52. ULONG __asm SDI_isalnum(register __d0 UBYTE);    /* character to convert        */
  53. ULONG __asm SDI_isupper(register __d0 UBYTE);    /* character to convert        */
  54. ULONG __asm SDI_strtoul(register __a1 STRPTR,    /* buffer            */
  55.             register __a0 UBYTE **,    /* UBYTE var for error position    */
  56.             register __d2 UBYTE);     /* base                */
  57. ULONG __asm SDI_strtol(    register __a1 STRPTR,    /* buffer            */
  58.             register __a0 UBYTE **,    /* UBYTE var for error position */
  59.             register __d2 UBYTE);     /* base                */
  60. STRPTR __asm SDI_strncpy(register __a1 STRPTR,    /* string 1            */
  61.             register __a0 STRPTR,    /* string 2            */
  62.             register __d1 ULONG);    /* highest copy number        */
  63. void __asm SDI_memset(    register __a1 APTR,    /* buffer            */
  64.             register __d0 UBYTE,    /* fill character        */
  65.             register __d1 ULONG);    /* number of bytes        */
  66. STRPTR __asm SDI_strchr(register __a1 STRPTR,    /* buffer            */
  67.             register __d0 UBYTE);    /* character to scan for    */
  68. void SDI_sprintf(STRPTR, STRPTR, ...);        /* buffer, formatdata, data    */
  69. void SDI_printf(STRPTR, ...);            /* formatdata, data        */
  70.  
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74.  
  75. #define SDI_stricmp(a,b)    SDI_strnicmp(a,b,~0)
  76. #define SDI_strcmp(a,b)        SDI_strncmp(a,b,~0)
  77. #define SDI_strcpy(a,b)        SDI_strncpy(a,b,~0)
  78.  
  79. /* Set SDI_TO_ANSI if you want to use normal ansi names. Do not include
  80. the ANSI files stdio.h / stdlib.h ... , because this may result in an error */
  81.  
  82. #ifdef SDI_TO_ANSI
  83.   #define strnicmp    SDI_strnicmp
  84.   #define strncmp    SDI_strncmp
  85.   #define stricmp    SDI_stricmp
  86.   #define strcmp    SDI_strcmp
  87.   #define tolower    SDI_tolower
  88.   #define toupper    SDI_toupper
  89.   #define strlen    SDI_strlen
  90.   #define isprint    SDI_isprint
  91.   #define isdigit    SDI_isdigit
  92.   #define isxdigit    SDI_isxdigit
  93.   #define isalnum    SDI_isalnum
  94.   #define strtoul    SDI_strtoul
  95.   #define strtol    SDI_strtol
  96.   #define strncpy    SDI_strncpy
  97.   #define strcpy    SDI_strcpy
  98.   #define strchr    SDI_strchr
  99.   #define memset    SDI_memset
  100.   #define sprintf    SDI_sprintf
  101.   #define printf    SDI_printf
  102. /*#define memcpy(a,b,c)    CopyMem(b,a,c) */
  103.  
  104.   extern void exit(int);
  105. #endif
  106.  
  107. #endif /* SDI_ASM_STD_PROTOS_H */
  108.