11#if defined( MAUG_OS_PALM )
14# pragma message( "warning: not implemented!" )
16#elif defined( MAUG_OS_DOS_REAL )
18typedef void* MAUG_MHANDLE;
21# define maug_malloc( nmemb, sz ) (void*)malloc( sz * nmemb )
27# define maug_mrealloc( handle, nmemb, sz ) \
28 (void*)realloc( handle, (sz) * (nmemb) )
30# define maug_mzero( ptr, sz ) memset( ptr, '\0', sz )
32# define maug_mcpy( ptr_dest, ptr_src, sz ) memcpy( ptr_dest, ptr_src, sz )
34# define maug_mfree( handle ) free( handle ); handle = NULL;
36# define maug_mlock( handle, ptr ) ptr = handle; handle = NULL;
38# define maug_munlock( handle, ptr ) handle = ptr; ptr = NULL;
40# define maug_strncpy( dest, src, len ) strncpy( dest, src, len )
42# define maug_strlen( str ) strlen( str )
46typedef void* MAUG_MHANDLE;
48# define maug_malloc( nmemb, sz ) (void*)malloc( sz * nmemb )
54# define maug_mrealloc( handle, nmemb, sz ) \
55 (void*)realloc( handle, (sz) * (nmemb) )
62# define maug_mzero( ptr, sz ) memset( ptr, '\0', sz )
64# define maug_mcpy( ptr_dest, ptr_src, sz ) memcpy( ptr_dest, ptr_src, sz )
66# define maug_mfree( handle ) free( handle ); handle = NULL;
68# define maug_mlock( handle, ptr ) ptr = handle; handle = NULL;
70# define maug_munlock( handle, ptr ) handle = ptr; ptr = NULL;
72# define maug_strncpy( dest, src, len ) strncpy( dest, src, len )
74# define maug_strlen( str ) strlen( str )
78#define maug_mrealloc_test( new_handle, handle, nmemb, sz ) \
79 maug_cleanup_if_lt_overflow( (sz) * (nmemb), sz ); \
80 new_handle = maug_mrealloc( handle, nmemb, sz ); \
81 maug_cleanup_if_null_alloc( MAUG_MHANDLE, new_handle ); \
84char* maug_strchr(
const char* str,
char c );
86char* maug_strrchr(
const char* str,
char c );
92char* maug_strchr(
const char* str,
char c ) {
96 str_sz = maug_strlen( str );
98 for( i = 0 ; str_sz > i ; i++ ) {
100 return (
char*)&(str[i]);
107char* maug_strrchr(
const char* str,
char c ) {
111 str_sz = maug_strlen( str );
113 for( i = str_sz ; 0 <= i ; i-- ) {
115 return (
char*)&(str[i]);