1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-04 13:29:35 +00:00

New function SB_Skip

git-svn-id: svn://svn.cc65.org/cc65/trunk@1412 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2002-09-29 19:55:38 +00:00
parent 0e4493f075
commit 092f10862e

View File

@ -191,7 +191,7 @@ INLINE char SB_Get (StrBuf* B)
#if defined(HAVE_INLINE)
INLINE char SB_Peek (StrBuf* B)
/* Look at the next character from the string without incrementing Index.
/* Look at the next character from the string without incrementing Index.
* Returns NUL if the end of the string is reached.
*/
{
@ -201,6 +201,18 @@ INLINE char SB_Peek (StrBuf* B)
# define SB_Peek(B) (((B)->Index < (B)->Len)? (B)->Buf[(B)->Index] : '\0')
#endif
#if defined(HAVE_INLINE)
INLINE void SB_Skip (StrBuf* B)
/* Skip the next character in the string buffer if this is possible. */
{
if (B->Index < B->Len) {
++B->Index;
}
}
#else
# define SB_Skip(B) do { if ((B)->Index < (B)->Len) ++(B)->Index; } while (0)
#endif
void SB_Terminate (StrBuf* B);
/* Zero terminate the given string buffer. NOTE: The terminating zero is not
* accounted for in B->Len, if you want that, you have to use AppendChar!