From: Kidong L. <bri...@us...> - 2004-06-13 00:50:11
|
Update of /cvsroot/syncml-ctoolkit/toolkit/src/sml/lib/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27519/sml/lib/inc Modified Files: libmem.h libstr.h libutil.h Log Message: Attached macro in the end of function prototypes to build on PalmOS/prc-tools Index: libstr.h =================================================================== RCS file: /cvsroot/syncml-ctoolkit/toolkit/src/sml/lib/inc/libstr.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libstr.h 24 May 2004 01:33:36 -0000 1.3 --- libstr.h 13 Jun 2004 00:49:57 -0000 1.4 *************** *** 54,57 **** --- 54,59 ---- *************************************************************************/ + #include <define.h> + #include "smldef.h" #include "libmem.h" *************** *** 70,74 **** #ifdef __PALM_OS__ /* we use #define to reduce heap usage */ ! String_t smlLibStrdup (const char* constStringP); #define smlLibStrcpy(pTarget,pSource) (char*)StrCopy((char*)pTarget,(char*)pSource) #define smlLibStrncpy(pTarget,pSource,count) (char*)StrNCopy((char*)pTarget,(char*)pSource,count) --- 72,76 ---- #ifdef __PALM_OS__ /* we use #define to reduce heap usage */ ! String_t smlLibStrdup (const char* constStringP) LIB_FUNC; #define smlLibStrcpy(pTarget,pSource) (char*)StrCopy((char*)pTarget,(char*)pSource) #define smlLibStrncpy(pTarget,pSource,count) (char*)StrNCopy((char*)pTarget,(char*)pSource,count) *************** *** 79,90 **** #define smlLibStrlen(pString) StrLen((char*)pString) #else /* we use functions, to make the library exportable */ ! SML_API_DEF String_t smlLibStrdup (const char *constStringP); ! SML_API_DEF String_t smlLibStrcpy(const char *pTarget, const char *pSource); ! SML_API_DEF String_t smlLibStrncpy(const char *pTarget, const char *pSource, int count); ! SML_API_DEF String_t smlLibStrcat(const char *pTarget, const char *pSource); ! SML_API_DEF int smlLibStrcmp(const char *pTarget, const char *pSource); ! SML_API_DEF int smlLibStrncmp(const char *pTarget, const char *pSource, int count); ! SML_API_DEF String_t smlLibStrchr(const char *pString, char character); ! SML_API_DEF int smlLibStrlen(const char *pString); #endif --- 81,92 ---- #define smlLibStrlen(pString) StrLen((char*)pString) #else /* we use functions, to make the library exportable */ ! SML_API_DEF String_t smlLibStrdup (const char *constStringP) LIB_FUNC; ! SML_API_DEF String_t smlLibStrcpy(const char *pTarget, const char *pSource) LIB_FUNC; ! SML_API_DEF String_t smlLibStrncpy(const char *pTarget, const char *pSource, int count) LIB_FUNC; ! SML_API_DEF String_t smlLibStrcat(const char *pTarget, const char *pSource) LIB_FUNC; ! SML_API_DEF int smlLibStrcmp(const char *pTarget, const char *pSource) LIB_FUNC; ! SML_API_DEF int smlLibStrncmp(const char *pTarget, const char *pSource, int count) LIB_FUNC; ! SML_API_DEF String_t smlLibStrchr(const char *pString, char character) LIB_FUNC; ! SML_API_DEF int smlLibStrlen(const char *pString) LIB_FUNC; #endif *************** *** 101,106 **** #define smlLibStrstr(pString,pSubstring) (char*)StrStr((char*)pString,(char*)pSubstring) #else /* we use functions, to make the library exportable */ ! SML_API_DEF String_t smlLibStrncat(const char *pTarget, const char *pSource, int count); ! SML_API_DEF String_t smlLibStrstr(const char *pString, const char *pSubString); #endif #endif --- 103,108 ---- #define smlLibStrstr(pString,pSubstring) (char*)StrStr((char*)pString,(char*)pSubstring) #else /* we use functions, to make the library exportable */ ! SML_API_DEF String_t smlLibStrncat(const char *pTarget, const char *pSource, int count) LIB_FUNC; ! SML_API_DEF String_t smlLibStrstr(const char *pString, const char *pSubString) LIB_FUNC; #endif #endif Index: libmem.h =================================================================== RCS file: /cvsroot/syncml-ctoolkit/toolkit/src/sml/lib/inc/libmem.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libmem.h 24 May 2004 01:33:36 -0000 1.3 --- libmem.h 13 Jun 2004 00:49:57 -0000 1.4 *************** *** 57,60 **** --- 57,62 ---- *************************************************************************/ + #include <define.h> + #include <stdlib.h> #include <smldef.h> *************** *** 73,78 **** #ifdef __PALM_OS__ /* we use #define to reduce heap usage */ ! void *smlLibRealloc (VoidPtr_t objectP, MemSize_t constSize); ! void smlLibFree (void* objectP); #define smlLibMemset(pObject,value,count) ((void)MemSet((VoidPtr_t)pObject,(MemSize_t)count,(int)value)) #define smlLibMemcpy(pTarget,pSource,count) (MemMove(pTarget,(VoidPtr_t)pSource,count) ? pTarget : pTarget) --- 75,80 ---- #ifdef __PALM_OS__ /* we use #define to reduce heap usage */ ! void *smlLibRealloc (VoidPtr_t objectP, MemSize_t constSize) LIB_FUNC; ! void smlLibFree (void* objectP) LIB_FUNC; #define smlLibMemset(pObject,value,count) ((void)MemSet((VoidPtr_t)pObject,(MemSize_t)count,(int)value)) #define smlLibMemcpy(pTarget,pSource,count) (MemMove(pTarget,(VoidPtr_t)pSource,count) ? pTarget : pTarget) *************** *** 82,92 **** #define smlLibMemsize(pObject) ((MemSize_t)MemPtrSize((VoidPtr_t)pObject)) #else ! SML_API_DEF void *smlLibRealloc(void *pObject, MemSize_t size); ! SML_API_DEF void smlLibFree(void *pObject); ! SML_API_DEF void *smlLibMemset(void *pObject, int value, MemSize_t count); ! SML_API_DEF void *smlLibMemcpy(void *pTarget, const void *pSource, MemSize_t count); ! SML_API_DEF void *smlLibMemmove(void *pTarget, const void *pSource, MemSize_t count); ! SML_API_DEF int smlLibMemcmp(const void *pTarget, const void *pSource, MemSize_t count); ! SML_API_DEF void *smlLibMalloc(MemSize_t size); #endif --- 84,94 ---- #define smlLibMemsize(pObject) ((MemSize_t)MemPtrSize((VoidPtr_t)pObject)) #else ! SML_API_DEF void *smlLibRealloc(void *pObject, MemSize_t size) LIB_FUNC; ! SML_API_DEF void smlLibFree(void *pObject) LIB_FUNC; ! SML_API_DEF void *smlLibMemset(void *pObject, int value, MemSize_t count) LIB_FUNC; ! SML_API_DEF void *smlLibMemcpy(void *pTarget, const void *pSource, MemSize_t count) LIB_FUNC; ! SML_API_DEF void *smlLibMemmove(void *pTarget, const void *pSource, MemSize_t count) LIB_FUNC; ! SML_API_DEF int smlLibMemcmp(const void *pTarget, const void *pSource, MemSize_t count) LIB_FUNC; ! SML_API_DEF void *smlLibMalloc(MemSize_t size) LIB_FUNC; #endif Index: libutil.h =================================================================== RCS file: /cvsroot/syncml-ctoolkit/toolkit/src/sml/lib/inc/libutil.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libutil.h 24 May 2004 01:33:36 -0000 1.3 --- libutil.h 13 Jun 2004 00:49:57 -0000 1.4 *************** *** 55,58 **** --- 55,59 ---- *************************************************************************/ + #include <define.h> #include <smldef.h> *************** *** 79,84 **** /* IO functions */ ! SML_API_DEF void smlLibPrint(const char *text, ...); ! SML_API_DEF void smlLibVprintf(const char *format, va_list va); --- 80,85 ---- /* IO functions */ ! SML_API_DEF void smlLibPrint(const char *text, ...) LIB_FUNC; ! SML_API_DEF void smlLibVprintf(const char *format, va_list va) LIB_FUNC; |