home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / mbsninc.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  1KB  |  50 lines

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