Make the swap buffer content function publically available.
authorWilfried Goesgens <willi@arangodb.com>
Tue, 17 Nov 2015 22:09:21 +0000 (23:09 +0100)
committerWilfried Goesgens <willi@arangodb.com>
Tue, 17 Nov 2015 22:09:21 +0000 (23:09 +0100)
libcitadel/lib/libcitadel.h
libcitadel/lib/stringbuf.c

index d8f246da43f9214dadb9b6a77de5bb7c6463bc6c..0dd4c763cb3a3e0fc2d1f70211bc4553c0e621c7 100644 (file)
@@ -192,6 +192,7 @@ typedef struct _ConstStr {
 StrBuf* NewStrBuf(void);
 StrBuf* NewStrBufDup(const StrBuf *CopyMe);
 StrBuf* NewStrBufPlain(const char* ptr, int nChars);
+void SwapBuffers(StrBuf *A, StrBuf *B);
 long StrBufShrinkToFit(StrBuf *Buf, int Force);
 void ReAdjustEmptyBuf(StrBuf *Buf, long ThreshHold, long NewSize);
 void NewStrBufDupAppendFlush(StrBuf **CreateRelpaceMe, StrBuf *CopyFlushMe, const char *NoMe, int KeepOriginal);
index 0340ce4d44fb51e6edd50578e5d31c3a90eef890..cf786ab5f10956a3dc94de6265f120fcaf41eac1 100644 (file)
@@ -256,7 +256,7 @@ void dbg_Init(StrBuf *Buf)
  * @param A First one
  * @param B second one
  */
-static inline void SwapBuffers(StrBuf *A, StrBuf *B)
+static inline void iSwapBuffers(StrBuf *A, StrBuf *B)
 {
        StrBuf C;
 
@@ -266,6 +266,12 @@ static inline void SwapBuffers(StrBuf *A, StrBuf *B)
 
 }
 
+void SwapBuffers(StrBuf *A, StrBuf *B)
+{
+       iSwapBuffers(A, B);
+}
+
+
 /** 
  * @ingroup StrBuf_Cast
  * @brief Cast operator to Plain String 
@@ -510,7 +516,7 @@ void NewStrBufDupAppendFlush(StrBuf **CreateRelpaceMe, StrBuf *CopyFlushMe, cons
                }
                else 
                        NewBuf = *CreateRelpaceMe;
-               SwapBuffers (NewBuf, CopyFlushMe);
+               iSwapBuffers (NewBuf, CopyFlushMe);
        }
        if (!KeepOriginal)
                FlushStrBuf(CopyFlushMe);
@@ -3047,7 +3053,7 @@ int StrBufStreamTranscode(eStreamType type, IOBuffer *Target, IOBuffer *In, cons
                     (stream->OutBuf.BufUsed != org_outbuf_len)
                            ))
                {
-                       SwapBuffers(Target->Buf, &stream->OutBuf);
+                       iSwapBuffers(Target->Buf, &stream->OutBuf);
                }
 
                if (stream->zstream.avail_in == 0)
@@ -3118,7 +3124,7 @@ int StrBufStreamTranscode(eStreamType type, IOBuffer *Target, IOBuffer *In, cons
 
                stream->OutBuf.BufUsed += stream->zstream.total_out + org_outbuf_len;
 
-               if (Target) SwapBuffers(Target->Buf, &stream->OutBuf);
+               if (Target) iSwapBuffers(Target->Buf, &stream->OutBuf);
 
                if (stream->zstream.avail_in == 0)
                {
@@ -3767,7 +3773,7 @@ TRYAGAIN:
                TmpBuf->buf[TmpBuf->BufUsed] = '\0';
                
                /* little card game: wheres the red lady? */
-               SwapBuffers(ConvertBuf, TmpBuf);
+               iSwapBuffers(ConvertBuf, TmpBuf);
                FlushStrBuf(TmpBuf);
        }
 #endif