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

  1. /***
  2. *mbsinc.c - Move MBCS string pointer ahead one charcter.
  3. *
  4. *       Copyright (c) 1991-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       Move MBCS string pointer ahead one character.
  8. *
  9. *******************************************************************************/
  10.  
  11. #ifdef _MBCS
  12.  
  13. #include <cruntime.h>
  14. #include <mbdata.h>
  15. #include <mbstring.h>
  16. #include <mbctype.h>
  17. #include <stddef.h>
  18.  
  19. /***
  20. *_mbsinc - Move MBCS string pointer ahead one charcter.
  21. *
  22. *Purpose:
  23. *       Move the supplied string pointer ahead by one
  24. *       character.  MBCS characters are handled correctly.
  25. *
  26. *Entry:
  27. *       const unsigned char *current = current char pointer (legal MBCS boundary)
  28. *
  29. *Exit:
  30. *       Returns pointer after moving it.
  31. *
  32. *Exceptions:
  33. *
  34. *******************************************************************************/
  35.  
  36. unsigned char * __cdecl _mbsinc(
  37.     const unsigned char *current
  38.     )
  39. {
  40.     if (_ISLEADBYTE(*(current++)))
  41.         current++;
  42.     return (unsigned char *)current;
  43. }
  44.  
  45. #endif  /* _MBCS */
  46.