1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-28 19:29:53 +00:00

New function SB_SkipMultiple().

git-svn-id: svn://svn.cc65.org/cc65/trunk@4358 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2009-10-10 20:51:52 +00:00
parent 30586e95e8
commit e623c87d63

View File

@ -286,6 +286,18 @@ INLINE void SB_Skip (StrBuf* B)
# define SB_Skip(B) do { if ((B)->Index < (B)->Len) ++(B)->Index; } while (0)
#endif
#if defined(HAVE_INLINE)
INLINE void SB_SkipMultiple (StrBuf* B, unsigned Count)
/* Skip a number of characters in the string buffer if this is possible. */
{
if ((B->Index += Count) > B->Len) {
B->Index = B->Len;
}
}
#else
# define SB_SkipMultiple(B) do { if (((B)->Index += (Count)) > (B)->Len) (B)->Index = (B)->Len; } while (0)
#endif
void SB_Drop (StrBuf* B, unsigned Count);
/* Drop characters from the end of the string. */