diff options
Diffstat (limited to 'private/crt32/mbstring/mbsninc.c')
-rw-r--r-- | private/crt32/mbstring/mbsninc.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/private/crt32/mbstring/mbsninc.c b/private/crt32/mbstring/mbsninc.c new file mode 100644 index 000000000..8cb30313c --- /dev/null +++ b/private/crt32/mbstring/mbsninc.c @@ -0,0 +1,50 @@ +/*** +*mbsninc.c - Increment MBCS string pointer by specified char count. +* +* Copyright (c) 1987-1993, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Increment MBCS string pointer by specified char count. +* +*Revision History: +* 11-19-92 KRS Ported from 16-bit sources. +* 08-03-93 KRS Fix return value logic. +* +*******************************************************************************/ + +#ifdef _MBCS +#include <cruntime.h> +#include <mbdata.h> +#include <mbstring.h> +#include <stddef.h> + +/*** +*_mbsninc - Increment MBCS string pointer by specified char count. +* +*Purpose: +* Increment the supplied string pointer by the specified number +* of characters. MBCS characters are handled correctly. +* +*Entry: +* const unsigned char *string = pointer to string +* unsigned int ccnt = number of char to advance the pointer +* +*Exit: +* Returns pointer after advancing it. +* Returns pointer to end of string if string is not ccnt chars long. +* Returns NULL is supplied pointer is NULL. +* +*Exceptions: +* +*******************************************************************************/ + +unsigned char * _CRTAPI1 _mbsninc(string, ccnt) +const unsigned char *string; +size_t ccnt; +{ + if (string == NULL) + return(NULL); + + return((char *)string + (unsigned int)_mbsnbcnt(string, ccnt)); +} +#endif /* _MBCS */ |