📄 strspn.c
字号:
/*************************************************************************** Copyright Mentor Graphics Corporation 2002* All Rights Reserved.** THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS* THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS* SUBJECT TO LICENSE TERMS.**************************************************************************//************************************************************************** FILE NAME VERSION** strspn.c Nucleus Common Library 1.1** DESCRIPTION** This file contains the implementation of NCL_strspn.** DATA STRUCTURES** None.** FUNCTIONS** NCL_strspn** DEPENDENCIES** ncl.h* string.h* nucleus.h*************************************************************************/#define NU_NCL_SOURCE_FILE#include "ncl\inc\ncl.h"#include "ncl\inc\string.h"#include "plus\nucleus.h" /* MMU Support *//*************************************************************************** FUNCTION** NCL_strspn** DESCRIPTION** It looks for an initial set of characters from s1 that match ANY* character in s2.** INPUTS** s1 String to search within* s2 Characters to search for** OUTPUTS** *size_t**************************************************************************/size_t NCL_strspn(register const char *s1, register const char *s2){ register size_t n; register char c; register const char *p; for (n = 0; (c = *s1++) != 0; ++n) { p = s2; do { if (*p == c) goto eol; /* leave loop is char is found */ } while (*p++); break; /* return n if char not found */eol: ; } return n;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -