* have a clear EndOfBuffer indicator in StrBufExtract_NextToken so we can do while(haveanothertoken)
* add StrBufHaveNextToken() to have a way to find out the end in case of using the integer versions
-libcitadel (7.60-73) unstable; urgency=low
+libcitadel (7.63-83) unstable; urgency=low
- -- Wilfried Goesgens <w.goesgens@outgesourced.org> Tue, 17 Mar 2009 00:00:00 +0002
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Tue, 1 Sep 2009 8:00:00 +0002
+
+libcitadel (7.61-82) unstable; urgency=low
+
+ * tiny bugfix
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Mon, 17 Aug 2009 23:00:00 +0002
+
+libcitadel (7.61-81) unstable; urgency=low
+
+ * new release
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Tue, 6 Aug 2009 10:00:00 +0002
+
+libcitadel (7.60-80) unstable; urgency=low
+
+ * new release
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Tue, 28 Jul 2009 00:00:00 +0002
libcitadel (7.50-73) unstable; urgency=low
libcitadel (7.50-73) unstable; urgency=low
int StrBufNum_tokens(const StrBuf *source, char tok);
int StrBufRemove_token(StrBuf *Source, int parmnum, char separator);
int StrBufNum_tokens(const StrBuf *source, char tok);
int StrBufRemove_token(StrBuf *Source, int parmnum, char separator);
+int StrBufHaveNextToken(const StrBuf *Source, const char **pStart);
int StrBufExtract_NextToken(StrBuf *dest, const StrBuf *Source, const char **pStart, char separator);
int StrBufSkip_NTokenS(const StrBuf *Source, const char **pStart, char separator, int nTokens);
unsigned long StrBufExtractNext_unsigned_long(const StrBuf* Source, const char **pStart, char separator);
int StrBufExtract_NextToken(StrBuf *dest, const StrBuf *Source, const char **pStart, char separator);
int StrBufSkip_NTokenS(const StrBuf *Source, const char **pStart, char separator, int nTokens);
unsigned long StrBufExtractNext_unsigned_long(const StrBuf* Source, const char **pStart, char separator);
/* Hack and slash */
if (*s) {
/* Hack and slash */
if (*s) {
- memmove(d, s, Source->BufUsed - (s - Source->buf) + 1);
- Source->BufUsed -= (ReducedBy + 1);
+ memmove(d, s, Source->BufUsed - (s - Source->buf));
+ Source->BufUsed += ReducedBy;
}
else if (d == Source->buf) {
*d = 0;
}
else if (d == Source->buf) {
*d = 0;
- Source->BufUsed -= (ReducedBy + 1);
+ Source->BufUsed += ReducedBy;
+
+/**
+ * \briefa string tokenizer; Bounds checker
+ * function to make shure whether StrBufExtract_NextToken and friends have reached the end of the string.
+ * \param Source our tokenbuffer
+ * \param pStart the token iterator pointer to inspect
+ * \returns whether the revolving pointer is inside of the search range
+ */
+int StrBufHaveNextToken(const StrBuf *Source, const char **pStart)
+{
+
+ if (*pStart == NULL)
+ return 1;
+ else if (*pStart >= Source->buf + Source->BufUsed)
+ return 0;
+ else if (*pStart <= Source->buf)
+ return 0;
+ return 1;
+}
+
/**
* \brief a string tokenizer
* \param dest Destination StringBuffer
/**
* \brief a string tokenizer
* \param dest Destination StringBuffer
}
if (*pStart == NULL)
*pStart = Source->buf;
}
if (*pStart == NULL)
*pStart = Source->buf;
+ else if (*pStart >= Source->buf + Source->BufUsed)
+ return -1;
EndBuffer = Source->buf + Source->BufUsed;
EndBuffer = Source->buf + Source->BufUsed;