⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fns_str.h

📁 用于嵌入式系统的TCP/IP协议栈及若干服务
💻 H
字号:
/**            Copyright (c) 1998-2001 by NETsilicon Inc.**  This software is copyrighted by and is the sole property of*  NETsilicon.  All rights, title, ownership, or other interests*  in the software remain the property of NETsilicon.  This*  software may only be used in accordance with the corresponding*  license agreement.  Any unauthorized use, duplication, transmission,*  distribution, or disclosure of this software is expressly forbidden.**  This Copyright notice may not be removed or modified without prior*  written consent of NETsilicon.**  NETsilicon, reserves the right to modify this software*  without notice.**  NETsilicon*  411 Waverley Oaks Road                  USA 781.647.1234*  Suite 227                               http://www.netsilicon.com*  Waltham, MA 02452                       AmericaSales@netsilicon.com***************************************************************************  $Name: Fusion 6.52 Fusion 6.51 $*  $Date: 2001/09/20 10:58:00 $*  $Source: M:/psisrc/clib/incl/rcs/fns_str.h $*  $Revision: 1.14 $***************************************************************************  File Description:  String manipulation routine declarations and macros**************************************************************************/#ifndef _FNS_STR_#define _FNS_STR_#include <std.h>import  char		* fns_strcat(char * s1, const char * s2),		* fns_strncat(char * s1, const char * s2, int n),		* fns_strcpy(char * s1, const char * s2),		* fns_strncpy(char * s1, const char * s2, int n),		* fns_strchr(const char * s, char c),		* fns_strrchr(const char * s, char c),		* fns_strpbrk(const char * s1, const char * s2),		* fns_strtok(char * s1, const char * s2),        * fns_strdup(const char * s1);import int fns_sprintf (char * string, const char * fmt, ...);import  int fns_strcmp(const char * s1, const char * s2),		    fns_strncmp(const char * s1, const char * s2, int n),            fns_strcmpi(const char *s1, const char *s2),            fns_strncmpi(const char *s1, const char *s2, int n);import unsigned int		fns_strlen(const char * s);  import int 	fns_strspn(const char * s1, const char * s2),		    fns_strcspn(const char * s1, const char * s2);import long fns_strtol(char * str, char ** ptr, int base);import int fns_strfneql(char *, char *, int);#ifdef USE_FUSION_STRINGLIB/* Even if you use the Fusion string library you can still individually   redefine functions.*/#ifndef OS_STRCAT#define OS_STRCAT		fns_strcat#endif#ifndef OS_STRNCAT#define OS_STRNCAT		fns_strncat#endif#ifndef OS_STRCPY#define OS_STRCPY		fns_strcpy#endif#ifndef OS_STRNCPY#define OS_STRNCPY		fns_strncpy#endif#ifndef OS_STRCHR#define OS_STRCHR		fns_strchr#endif#ifndef OS_STRRCHR#define OS_STRRCHR      fns_strrchr#endif#ifndef OS_STRPBRK#define OS_STRPBRK		fns_strpbrk#endif#ifndef OS_STRTOK#define OS_STRTOK		fns_strtok#endif#ifndef OS_STRCMP#define OS_STRCMP		fns_strcmp#endif#ifndef OS_STRNCMP		#define OS_STRNCMP		fns_strncmp#endif#ifndef OS_STRCMPI#define OS_STRCMPI      fns_strcmpi#endif#ifndef OS_STRNCMPI#define OS_STRNCMPI     fns_strncmpi#endif#ifndef OS_STRLEN#define OS_STRLEN		fns_strlen#endif#ifndef OS_STRSPN#define OS_STRSPN		fns_strspn#endif#ifndef OS_STRCSPN#define OS_STRCSPN		fns_strcspn#endif#ifndef OS_STRTOL#define OS_STRTOL		fns_strtol#endif#ifndef OS_SPRINTF#define OS_SPRINTF      fns_sprintf#endif#ifndef OS_STRDUP#define OS_STRDUP       fns_strdup#endif#ifndef OS_STRFNEQL#define OS_STRFNEQL     fns_strfneql#endif/* Macros for character classification etc. *//* isdigit, islower, etc. will eventually be moved to a global Fusion   include file.*/#define	_fns_within(v1,ch,v2)	(((unsigned)(ch) - v1) <= (v2 - v1))#ifndef OS_ISDIGIT#define	OS_ISDIGIT(ch)          _fns_within('0', ch, '9')#endif#ifndef OS_ISASCII#define	OS_ISASCII(ch)	        ((unsigned)(ch) <= 0177)#endif#define __FNS_BLANKCHAR	        (u8)' '	/* space character value 32 */#define __FNS_TABCHAR		    (u8)'\t'#ifndef OS_ISSPACE#define OS_ISSPACE(ch)	        ((ch == __FNS_BLANKCHAR) || (ch == __FNS_TABCHAR))#endif#ifndef OS_ISLOWER#define OS_ISLOWER(ch)          _fns_within('a', ch, 'z')#endif#ifndef OS_ISUPPER#define OS_ISUPPER(ch)          _fns_within('A', ch, 'Z')#endif#ifndef OS_ISALPHA#define OS_ISALPHA(ch)         (OS_ISUPPER(ch) || OS_ISLOWER(ch))#endif#ifndef OS_ISXDIGIT#define OS_ISXDIGIT(ch)         (_fns_within('0', ch, '9') \                                || _fns_within('a',ch,'f') || \                                _fns_within('A',ch,'F'))#endif#ifndef OS_TOLOWER#define OS_TOLOWER(ch)          (OS_ISUPPER(ch) ? ((ch) + ('a' - 'A')) : (ch))#endif#ifndef OS_TOUPPER#define OS_TOUPPER(ch)          (OS_ISLOWER(ch) ? ((ch) - ('a' - 'A')) : (ch))#endif#else /* If not using Fusion string library, then either use the compiler C runtime versions		 or define custom ones.  NOTE: Some do not have ANSI equivalents and so are still		 defined to fns_ versions unless you define your own.  See the corresponding files		 in the Fusion/clib directory.	  */#ifndef OS_STRCAT#define OS_STRCAT		strcat#endif#ifndef OS_STRNCAT#define OS_STRNCAT		strncat#endif#ifndef OS_STRCPY#define OS_STRCPY		strcpy#endif#ifndef OS_STRNCPY#define OS_STRNCPY		strncpy#endif#ifndef OS_STRCHR#define OS_STRCHR		strchr#endif#ifndef OS_STRRCHR#define OS_STRRCHR      strrchr#endif#ifndef OS_STRPBRK#define OS_STRPBRK		strpbrk#endif#ifndef OS_STRTOK#define OS_STRTOK		strtok#endif#ifndef OS_STRCMP#define OS_STRCMP		strcmp#endif#ifndef OS_STRNCMP#define OS_STRNCMP		strncmp#endif#ifndef OS_STRCMPI#define OS_STRCMPI      strcmpi#endif#ifndef OS_STRNCMPI#define OS_STRNCMPI     strncmpi#endif#ifndef OS_STRLEN#define OS_STRLEN		strlen#endif#ifndef OS_STRSPN#define OS_STRSPN		strspn#endif#ifndef OS_STRCSPN#define OS_STRCSPN		strcspn#endif#ifndef OS_STRTOL#define OS_STRTOL		strtol#endif#ifndef OS_SPRINTF#define OS_SPRINTF      sprintf#endif#ifndef OS_STRDUP#define OS_STRDUP       strdup#endif#define OS_ISALPHA		isalpha#define	OS_ISDIGIT      isdigit#define OS_ISXDIGIT     isxdigit#define	OS_ISASCII      isascii#define OS_ISSPACE      isspace#define OS_ISLOWER      islower#define OS_ISUPPER      isupper#define OS_TOLOWER      tolower#define OS_TOUPPER      toupper#endif#endif /* _FNS_STRING_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -