From: uz Date: Sat, 24 Jan 2009 16:26:48 +0000 (+0000) Subject: Added a new SetIndex() function/macro. X-Git-Tag: V2.13.0rc1~345 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dd5e5c43d889d60c4c0f0371cbc85a8b555a69cf;p=cc65 Added a new SetIndex() function/macro. git-svn-id: svn://svn.cc65.org/cc65/trunk@3910 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- 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 */