Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.3 KiB

  1. /***
  2. *mbsninc.c - Increment MBCS string pointer by specified char count.
  3. *
  4. * Copyright (c) 1987-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Increment MBCS string pointer by specified char count.
  8. *
  9. *Revision History:
  10. * 11-19-92 KRS Ported from 16-bit sources.
  11. * 08-03-93 KRS Fix return value logic.
  12. * 10-05-93 GJF Replaced _CRTAPI1 with __cdecl.
  13. *
  14. *******************************************************************************/
  15. #ifdef _MBCS
  16. #include <cruntime.h>
  17. #include <mbdata.h>
  18. #include <mbstring.h>
  19. #include <stddef.h>
  20. /***
  21. *_mbsninc - Increment MBCS string pointer by specified char count.
  22. *
  23. *Purpose:
  24. * Increment the supplied string pointer by the specified number
  25. * of characters. MBCS characters are handled correctly.
  26. *
  27. *Entry:
  28. * const unsigned char *string = pointer to string
  29. * unsigned int ccnt = number of char to advance the pointer
  30. *
  31. *Exit:
  32. * Returns pointer after advancing it.
  33. * Returns pointer to end of string if string is not ccnt chars long.
  34. * Returns NULL is supplied pointer is NULL.
  35. *
  36. *Exceptions:
  37. *
  38. *******************************************************************************/
  39. unsigned char * __cdecl _mbsninc(
  40. const unsigned char *string,
  41. size_t ccnt
  42. )
  43. {
  44. if (string == NULL)
  45. return(NULL);
  46. return((char *)string + (unsigned int)_mbsnbcnt(string, ccnt));
  47. }
  48. #endif /* _MBCS */