original files of m241
This commit is contained in:
@@ -0,0 +1,252 @@
|
||||
/*
|
||||
******************************************************************************
|
||||
* HEADER FILE
|
||||
*
|
||||
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: string.h,v $ $Revision: 1.3 $
|
||||
* $Source: /home/interpeak/CVSRoot/ipxinc/include/string.h,v $
|
||||
* $Author: lob $ $Date: 2006-04-10 11:03:29 $
|
||||
* $State: Exp $ $Locker: $
|
||||
*
|
||||
* INTERPEAK_COPYRIGHT_STRING
|
||||
* Design and implementation by Lennart Bang <lob@interpeak.se>
|
||||
******************************************************************************
|
||||
*/
|
||||
#ifndef IP_STRING_H
|
||||
#define IP_STRING_H
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 1 DESCRIPTION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 2 CONFIGURATION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#include "ipcom_config.h"
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 3 INCLUDE FILES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#define IPCOM_USE_CLIB_PROTO
|
||||
#include "ipcom_clib.h"
|
||||
|
||||
#include "strings.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 4 DEFINES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 5 TYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 6 FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef bzero
|
||||
#define bzero(s,n) ipcom_memset(s,0,n)
|
||||
#endif
|
||||
|
||||
#ifndef bcopy
|
||||
#define bcopy(s,d,n) ipcom_memcpy(d,s,n)
|
||||
#endif
|
||||
|
||||
#ifndef bcmp
|
||||
#define bcmp(s1,s2,n) ipcom_memcmp(s1,s2,n)
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(IPBOUNDS) || defined(__BOUNDS_CHECKING_ON)
|
||||
extern char *strdup(const char *s1);
|
||||
#elif defined(IPCOM_USE_DMALLOC) && !defined(IPCOM_DMALLOC_C)
|
||||
#define strdup(s) ipcom_dstrdup(s, __FILE__, __FUNCTION__, __LINE__)
|
||||
#elif (defined(IPCOM_STRDUP) && IPCOM_STRDUP == 1) || defined(IPCOM_PORT_STRDUP)
|
||||
#define strdup(s) ipcom_strdup(s)
|
||||
#elif defined(IPCOM_STRDUP)
|
||||
#define strdup(s) IPCOM_STRDUP(s)
|
||||
#endif
|
||||
|
||||
|
||||
#if (defined(IPCOM_STRLEN) && IPCOM_STRLEN == 1) || defined(IPCOM_PORT_STRLEN)
|
||||
#define strlen(s) ipcom_strlen(s)
|
||||
#elif defined(IPCOM_STRLEN)
|
||||
#define strlen(s) IPCOM_STRLEN(s)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRCPY) && IPCOM_STRCPY == 1) || defined(IPCOM_PORT_STRCPY)
|
||||
#define strcpy(s1,s2) ipcom_strcpy(s1,s2)
|
||||
#elif defined(IPCOM_STRCPY)
|
||||
#define strcpy(s1,s2) IPCOM_STRCPY(s1,s2)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRNCPY) && IPCOM_STRNCPY == 1) || defined(IPCOM_PORT_STRNCPY)
|
||||
#define strncpy(s1,s2,n) ipcom_strncpy(s1,s2,n)
|
||||
#elif defined(IPCOM_STRNCPY)
|
||||
#define strncpy(s1,s2,n) IPCOM_STRNCPY(s1,s2,n)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRCMP) && IPCOM_STRCMP == 1) || defined(IPCOM_PORT_STRCMP)
|
||||
#define strcmp(s1,s2) ipcom_strcmp(s1,s2)
|
||||
#elif defined(IPCOM_STRCMP)
|
||||
#define strcmp(s1,s2) IPCOM_STRCMP(s1,s2)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRNCMP) && IPCOM_STRNCMP == 1) || defined(IPCOM_PORT_STRNCMP)
|
||||
#define strncmp(s1,s2,n) ipcom_strncmp(s1,s2,n)
|
||||
#elif defined(IPCOM_STRNCMP)
|
||||
#define strncmp(s1,s2,n) IPCOM_STRNCMP(s1,s2,n)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRSTR) && IPCOM_STRSTR == 1) || defined(IPCOM_PORT_STRSTR)
|
||||
#define strstr(h,n) ipcom_strstr(h,n)
|
||||
#elif defined(IPCOM_STRSTR)
|
||||
#define strstr(h,n) IPCOM_STRSTR(h,n)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRCASESTR) && IPCOM_STRCASESTR == 1) || defined(IPCOM_PORT_STRCASESTR)
|
||||
#define strcasestr(h,n) ipcom_strcasestr(h,n)
|
||||
#elif defined(IPCOM_STRCASESTR)
|
||||
#define strcasestr(h,n) IPCOM_STRCASESTR(h,n)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRTOK) && IPCOM_STRTOK == 1) || defined(IPCOM_PORT_STRTOK)
|
||||
#define strtok(s,st) ipcom_strtok(s,st)
|
||||
#elif defined(IPCOM_STRTOK)
|
||||
#define strtok(s,st) IPCOM_STRTOK(s,st)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRTOK_R) && IPCOM_STRTOK_R == 1) || defined(IPCOM_PORT_STRTOK_R)
|
||||
#define strtok_r(s,st,last) ipcom_strtok_r(s,st,last)
|
||||
#elif defined(IPCOM_STRTOK_R)
|
||||
#define strtok_r(s,st,last) IPCOM_STRTOK_R(s,st,last)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRSEP) && IPCOM_STRSEP == 1) || defined(IPCOM_PORT_STRSEP)
|
||||
#define strsep(cp,d) ipcom_strsep(cp,d)
|
||||
#elif defined(IPCOM_STRSEP)
|
||||
#define strsep(cp,d) IPCOM_STRSEP(cp,d)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRSPN) && IPCOM_STRSPN == 1) || defined(IPCOM_PORT_STRSPN)
|
||||
#define strspn(s1,s2) ipcom_strspn(s1,s2)
|
||||
#elif defined(IPCOM_STRSPN)
|
||||
#define strspn(s1,s2) IPCOM_STRSPN(s1,s2)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRCSPN) && IPCOM_STRCSPN == 1) || defined(IPCOM_PORT_STRCSPN)
|
||||
#define strcspn(s1,s2) ipcom_strcspn(s1,s2)
|
||||
#elif defined(IPCOM_STRCSPN)
|
||||
#define strcspn(s1,s2) IPCOM_STRCSPN(s1,s2)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRPBRK) && IPCOM_STRPBRK == 1) || defined(IPCOM_PORT_STRPBRK)
|
||||
#define strpbrk(s,c) ipcom_strpbrk(s,c)
|
||||
#elif defined(IPCOM_STRPBRK)
|
||||
#define strpbrk(s,c) IPCOM_STRPBRK(s,c)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRCAT) && IPCOM_STRCAT == 1) || defined(IPCOM_PORT_STRCAT)
|
||||
#define strcat(d,s) ipcom_strcat(d,s)
|
||||
#elif defined(IPCOM_STRCAT)
|
||||
#define strcat(d,s) IPCOM_STRCAT(d,s)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRNCAT) && IPCOM_STRNCAT == 1) || defined(IPCOM_PORT_STRNCAT)
|
||||
#define strncat(d,s,n) ipcom_strncat(d,s,n)
|
||||
#elif defined(IPCOM_STRNCAT)
|
||||
#define strncat(d,s,n) IPCOM_STRNCAT(d,s,n)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRLCAT) && IPCOM_STRLCAT == 1) || defined(IPCOM_PORT_STRLCAT)
|
||||
#define strlcat(d,s,n) ipcom_strlcat(d,s,n)
|
||||
#elif defined(IPCOM_STRLCAT)
|
||||
#define strlcat(d,s,n) IPCOM_STRLCAT(d,s,n)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRLCPY) && IPCOM_STRLCPY == 1) || defined(IPCOM_PORT_STRLCPY)
|
||||
#define strlcpy(d,s,n) ipcom_strlcpy(d,s,n)
|
||||
#elif defined(IPCOM_STRLCPY)
|
||||
#define strlcpy(d,s,n) IPCOM_STRLCPY(d,s,n)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRCHR) && IPCOM_STRCHR == 1) || defined(IPCOM_PORT_STRCHR)
|
||||
#define strchr(s,c) ipcom_strchr(s,c)
|
||||
#elif defined(IPCOM_STRCHR)
|
||||
#define strchr(s,c) IPCOM_STRCHR(s,c)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRRCHR) && IPCOM_STRRCHR == 1) || defined(IPCOM_PORT_STRRCHR)
|
||||
#define strrchr(s,c) ipcom_strrchr(s,c)
|
||||
#elif defined(IPCOM_STRRCHR)
|
||||
#define strrchr(s,c) IPCOM_STRRCHR(s,c)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_STRERROR) && IPCOM_STRERROR == 1) || defined(IPCOM_PORT_STRERROR)
|
||||
#define strerror(e) ipcom_strerror(e)
|
||||
#elif defined(IPCOM_STRERROR)
|
||||
#define strerror(e) IPCOM_STRERROR(e)
|
||||
#endif
|
||||
|
||||
|
||||
#if (defined(IPCOM_MEMCPY) && IPCOM_MEMCPY == 1) || defined(IPCOM_PORT_MEMCPY)
|
||||
#define memcpy(d,s,n) ipcom_memcpy(d,s,n)
|
||||
#elif defined(IPCOM_MEMCPY)
|
||||
#define memcpy(d,s,n) IPCOM_MEMCPY(d,s,n)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_MEMSET) && IPCOM_MEMSET == 1) || defined(IPCOM_PORT_MEMSET)
|
||||
#define memset(s,c,n) ipcom_memset(s,c,n)
|
||||
#elif defined(IPCOM_MEMSET)
|
||||
#define memset(s,c,n) IPCOM_MEMSET(s,c,n)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_MEMCMP) && IPCOM_MEMCMP == 1) || defined(IPCOM_PORT_MEMCMP)
|
||||
#define memcmp(s1,s2,n) ipcom_memcmp(s1,s2,n)
|
||||
#elif defined(IPCOM_MEMCMP)
|
||||
#define memcmp(s1,s2,n) IPCOM_MEMCMP(s1,s2,n)
|
||||
#endif
|
||||
|
||||
#if (defined(IPCOM_MEMMOVE) && IPCOM_MEMMOVE == 1) || defined(IPCOM_PORT_MEMMOVE)
|
||||
#define memmove(s1,s2,n) ipcom_memmove(s1,s2,n)
|
||||
#elif defined(IPCOM_MEMMOVE)
|
||||
#define memmove(s1,s2,n) IPCOM_MEMMOVE(s1,s2,n)
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_INTERPEAK
|
||||
#ifdef strcasestr
|
||||
#undef strcasestr
|
||||
#endif
|
||||
#define strcasestr ipnetsnmp_strcasestr
|
||||
IP_PUBLIC char *ipnetsnmp_strcasestr(const char *s1, const char *s2);
|
||||
#endif /* #ifdef NETSNMP_INTERPEAK */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* END OF FILE
|
||||
****************************************************************************
|
||||
*/
|
||||
Reference in New Issue
Block a user