57#define bstrDeclare(b) \
62 if ((b) != NULL && (b)->slen >= 0 && (b)->mlen >= (b)->slen) { \
69#if !defined(BSTRLIB_REDUCE_NAMESPACE_POLLUTION)
70#define bAssign(a, b) \
73#define bSubs(b, pos, len, a, c) \
74 ((breplace)((b),(pos),(len),(a),(unsigned char)(c)))
76#define bStrchr(b, c) \
79#define bStrchrFast(b, c) \
82#define bCatCstr(b, s) \
83 ((bcatcstr)((b), (s)))
85#define bCatBlk(b, s, len) \
86 ((bcatblk)((b), (s), (len)))
88#define bCatStatic(b, s) \
94#define bReplaceAll(b, find, repl, pos) \
95 ((bfindreplace)((b),(find),(repl),(pos)))
97#define bUppercase(b) \
100#define bLowercase(b) \
103#define bCaselessCmp(a, b) \
104 ((bstricmp)((a), (b)))
106#define bCaselessNCmp(a, b, n) \
107 ((bstrnicmp)((a), (b), (n)))
109#define bBase64Decode(b) \
110 (bBase64DecodeEx((b), NULL))
112#define bUuDecode(b) \
113 (bUuDecodeEx((b), NULL))
123BSTR_PUBLIC
struct bStream *
182bInsertChrs(bstring b,
int pos,
int len,
unsigned char c,
unsigned char fill);
195#define bAscTime(t) (bStrfTime ("%c\n", (t)))
197#define bCTime(t) ((t) ? bAscTime (localtime (t)) : NULL)
283BSTR_PUBLIC
struct bStream *
337(*bNwrite)(
const void *buf,
size_t elsize,
size_t nelem,
void *parm);
344BSTR_PUBLIC
struct bwriteStream *
398#define bSecureDestroy(b) \
400 if ((b) && (b)->mlen > 0 && (b)->data) { \
401 (void)memset((b)->data, 0, (size_t)(b)->mlen); \
403 (void)bdestroy((b)); \
406#define bSecureWriteProtect(t) \
408 if ((t).mlen >= 0) { \
409 if ((t).mlen > (t).slen)) { \
410 (void)memset((t).data + (t).slen, 0, \
411 (size_t)(t).mlen - (t).slen); \
BSTR_PUBLIC void * bwsClose(struct bwriteStream *stream)
BSTR_PUBLIC int bwsWriteFlush(struct bwriteStream *stream)
BSTR_PUBLIC int bReplicate(bstring b, int n)
BSTR_PUBLIC bstring bYEncode(const bstring src)
BSTR_PUBLIC bstring bBase64DecodeEx(const bstring b, int *boolTruncError)
BSTR_PUBLIC bstring bHead(bstring b, int n)
BSTR_PUBLIC int bReverse(bstring b)
BSTR_PUBLIC struct bwriteStream * bwsOpen(bNwrite writeFn, void *parm)
BSTR_PUBLIC bstring bYDecode(const bstring src)
BSTR_PUBLIC int bSetChar(bstring b, int pos, char c)
BSTR_PUBLIC int bSetCstrChar(bstring a, int pos, char c)
BSTR_PUBLIC char * bStr2NetStr(const bstring b)
BSTR_PUBLIC int bwsWriteBstr(struct bwriteStream *stream, const bstring b)
BSTR_PUBLIC bstring bStrfTime(const char *fmt, const struct tm *timeptr)
BSTR_PUBLIC int bFill(bstring a, char c, int len)
BSTR_PUBLIC int bJustifyRight(bstring b, int width, int space)
BSTR_PUBLIC bstring bUuDecodeEx(const bstring src, int *badlines)
BSTR_PUBLIC int bJustifyCenter(bstring b, int width, int space)
BSTR_PUBLIC struct bStream * bsUuDecode(struct bStream *sInp, int *badlines)
BSTR_PUBLIC int bJustifyMargin(bstring b, int width, int space)
BSTR_PUBLIC int bwsWriteBlk(struct bwriteStream *stream, void *blk, int len)
BSTR_PUBLIC int bwsBuffLength(struct bwriteStream *stream, int sz)
BSTR_PUBLIC int bSGMLEncode(bstring b)
BSTR_PUBLIC struct bStream * bsFromBstr(const bstring b)
BSTR_PUBLIC bstring bBase64Encode(const bstring b)
BSTR_PUBLIC int bInsertChrs(bstring b, int pos, int len, unsigned char c, unsigned char fill)
BSTR_PUBLIC bstring bSecureInput(int maxlen, int termchar, bNgetc vgetchar, void *vgcCtx)
BSTR_PUBLIC bstring bTail(bstring b, int n)
BSTR_PUBLIC int bwsIsEOF(const struct bwriteStream *stream)
BSTR_PUBLIC bstring bNetStr2Bstr(const char *buf)
BSTR_PUBLIC int bJustifyLeft(bstring b, int space)
BSTR_PUBLIC bstring bUuEncode(const bstring src)
C implementaion of bstring functions.