diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/crt32/mbstring/strspnp.c | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/crt32/mbstring/strspnp.c')
-rw-r--r-- | private/crt32/mbstring/strspnp.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/private/crt32/mbstring/strspnp.c b/private/crt32/mbstring/strspnp.c new file mode 100644 index 000000000..2e6b9232e --- /dev/null +++ b/private/crt32/mbstring/strspnp.c @@ -0,0 +1,65 @@ +/*** +*strspnp.c - Search for init substring of chars from control string (MBCS) +* +* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Search for init substring of chars from control string (MBCS) +* +*Revision History: +* 11-19-92 KRS Ported from 16-bit sources. +* +*******************************************************************************/ + +#ifdef _MBCS +#include <cruntime.h> +#include <mbdata.h> +#include <mbctype.h> +#include <mbstring.h> +#include <stddef.h> + + +/*** +* _strspnp - Find first string char not in charset, return pointer (MBCS) +* +*Purpose: +* Returns maximum leading segment of string consisting solely +* of characters from charset. +* +*Entry: +* unsigned char *string = string to search in +* unsigned char *charset = set of characters to scan over +* +*Exit: +* +* Returns pointer to first character not in charset. +* Returns NULL if string consists entirely of characters from charset. +* +*Exceptions: +* +*******************************************************************************/ + + +unsigned char * _CRTAPI1 _strspnp( string, charset ) +const unsigned char *string; +const unsigned char *charset; +{ + unsigned char *p, *q; + + /* loop through the string to be inspected */ + for (q = (char *)string; *q; q++) { + + /* loop through the charset */ + for (p = (char *)charset; *p; p++) + if (*p == *q) + break; + + if (*p == '\0') /* end of charset? */ + break; /* yes, no match on this char */ + + } + + return((*q) ? q : NULL); /* pointer */ + +} +#endif /* _MBCS */ |