#ifndef SDI_ASM_STD_PROTOS_H
#define SDI_ASM_STD_PROTOS_H

/* Includeheader

	Name:		SDI_ASM_STD_protos
	Versionstring:	$VER: SDI_ASM_STD_protos.h 1.9 (18.11.96)
	Author:		SDI
	Distribution:	PD
	Description:	my replacement for standard ANSI functions

 1.9   18.11.96 : converted text into english language, changed C++ comments
 	to C ones
*/

/* These are mainly the normal ANSI C functions, but with an ASM interface.
You can replace them by their normal functions supplied with your compiler,
but do not mix them up (one object file standard, the other one SDI).

differences:
 toupper and tolower: chars (0x41 to 0x5A) and (0xC0 to 0xDD) are upper
  chars (0x61 to 0x79) and (0xDE to 0xFF) are lower (some more than in ANSI)
 isprint: chars (0x20 to 0x7F) and (0xA0 to 0xFF) are printable
 sprintf: only supports exec/RawDoFmt format strings
 and some I do not remember.
*/

#include <exec/types.h>

#ifdef __MAXON__
  #define __asm
#endif

#ifdef __cplusplus
extern "C" {
#endif

BYTE __asm SDI_strnicmp(register __a0 STRPTR,	/* string 1			*/
			register __a1 STRPTR,	/* string 2			*/
			register __d1 ULONG);	/* highest testlength		*/
BYTE __asm SDI_strncmp(	register __a0 STRPTR,	/* string 1			*/
			register __a1 STRPTR,	/* string 2			*/
			register __d1 ULONG);	/* highest testlength		*/
UBYTE __asm SDI_tolower(register __d0 UBYTE);	/* character to convert		*/
UBYTE __asm SDI_toupper(register __d0 UBYTE);	/* character to convert		*/
ULONG __asm SDI_strlen( register __a0 STRPTR);	/* string			*/
ULONG __asm SDI_isprint(register __d0 UBYTE);	/* character to convert		*/
ULONG __asm SDI_isdigit(register __d0 UBYTE);	/* character to convert		*/
ULONG __asm SDI_isxdigit(register __d0 UBYTE);	/* character to convert		*/
ULONG __asm SDI_isalnum(register __d0 UBYTE);	/* character to convert		*/
ULONG __asm SDI_isupper(register __d0 UBYTE);	/* character to convert		*/
ULONG __asm SDI_strtoul(register __a1 STRPTR,	/* buffer			*/
			register __a0 UBYTE **,	/* UBYTE var for error position	*/
			register __d2 UBYTE); 	/* base				*/
ULONG __asm SDI_strtol(	register __a1 STRPTR,	/* buffer			*/
			register __a0 UBYTE **,	/* UBYTE var for error position */
			register __d2 UBYTE); 	/* base				*/
void  __asm SDI_strncpy(register __a1 STRPTR,	/* string 1			*/
			register __a0 STRPTR,	/* string 2			*/
			register __d1 ULONG);	/* highest copy number		*/
void __asm SDI_memset(	register __a1 APTR,	/* buffer			*/
			register __d0 UBYTE,	/* fill character		*/
			register __d1 ULONG);	/* number of bytes		*/
STRPTR __asm SDI_strchr(register __a1 STRPTR,	/* buffer			*/
			register __d0 UBYTE);	/* character to scan for	*/
void SDI_sprintf(STRPTR, STRPTR, ...);		/* buffer, formatdata, data	*/

#ifdef __cplusplus
}
#endif

#define SDI_stricmp(a,b)	SDI_strnicmp(a,b,~0)
#define SDI_strcmp(a,b)		SDI_strncmp(a,b,~0)
#define SDI_strcpy(a,b)		SDI_strncpy(a,b,~0)

/* Set SDI_TO_ANSI if you want to use normal ansi names. Do not include
the ANSI files stdio.h / stdlib.h ... , because this may result in an error */

#ifdef SDI_TO_ANSI
  #define strnicmp	SDI_strnicmp
  #define strncmp	SDI_strncmp
  #define stricmp	SDI_stricmp
  #define strcmp	SDI_strcmp
  #define tolower	SDI_tolower
  #define toupper	SDI_toupper
  #define strlen	SDI_strlen
  #define isprint	SDI_isprint
  #define isdigit	SDI_isdigit
  #define isxdigit	SDI_isxdigit
  #define isalnum	SDI_isalnum
  #define strtoul	SDI_strtoul
  #define strtol	SDI_strtol
  #define strncpy	SDI_strncpy
  #define strcpy	SDI_strcpy
  #define strchr	SDI_strchr
  #define memset	SDI_memset
  #define sprintf	SDI_sprintf
/*#define memcpy(a,b,c)	CopyMem(b,a,c) */
#endif

#endif /* SDI_ASM_STD_PROTOS_H */
