From dd5e5c43d889d60c4c0f0371cbc85a8b555a69cf Mon Sep 17 00:00:00 2001 From: uz Date: Sat, 24 Jan 2009 16:26:48 +0000 Subject: [PATCH] Added a new SetIndex() function/macro. git-svn-id: svn://svn.cc65.org/cc65/trunk@3910 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/common/strbuf.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/common/strbuf.h b/src/common/strbuf.h index 8709b647e..f1493240d 100644 --- a/src/common/strbuf.h +++ b/src/common/strbuf.h @@ -134,6 +134,16 @@ INLINE unsigned SB_GetIndex (const StrBuf* B) # define SB_GetIndex(B) (B)->Index #endif +#if defined(HAVE_INLINE) +INLINE void SB_SetIndex (StrBuf* B, unsigned Index) +/* Set the user index of the string buffer */ +{ + B->Index = Index; +} +#else +# define SB_SetIndex(B) ((B)->Index = (Index)) +#endif + #if defined(HAVE_INLINE) INLINE const char* SB_GetConstBuf (const StrBuf* B) /* Return a buffer pointer */