57#define bstrDeclare(b) \
62 if ((b) != NULL && (b)->slen >= 0 && (b)->mlen >= (b)->slen) { \
69#define bAssign(a, b) \
72#define bSubs(b, pos, len, a, c) \
73 ((breplace)((b),(pos),(len),(a),(unsigned char)(c)))
75#define bStrchr(b, c) \
78#define bStrchrFast(b, c) \
81#define bCatCstr(b, s) \
82 ((bcatcstr)((b), (s)))
84#define bCatBlk(b, s, len) \
85 ((bcatblk)((b), (s), (len)))
87#define bCatStatic(b, s) \
88 bCatBlk((b), ("" s ""), sizeof (s) - 1)
93#define bReplaceAll(b, find, repl, pos) \
94 ((bfindreplace)((b),(find),(repl),(pos)))
96#define bUppercase(b) \
99#define bLowercase(b) \
102#define bCaselessCmp(a, b) \
103 ((bstricmp)((a), (b)))
105#define bCaselessNCmp(a, b, n) \
106 ((bstrnicmp)((a), (b), (n)))
108#define bBase64Decode(b) \
109 (bBase64DecodeEx((b), NULL))
111#define bUuDecode(b) \
112 (bUuDecodeEx((b), NULL))
191bStrfTime(
const char * fmt,
const struct tm * timeptr);
193#define bAscTime(t) (bStrfTime ("%c\n", (t)))
195#define bCTime(t) ((t) ? bAscTime (localtime (t)) : NULL)
325(*
bNwrite)(
const void *
buf,
size_t elsize,
size_t nelem,
void *
parm);
386#define bSecureDestroy(b) \
388 if ((b) && (b)->mlen > 0 && (b)->data) { \
389 (void)memset((b)->data, 0, (size_t)(b)->mlen); \
391 (void)bdestroy((b)); \
394#define bSecureWriteProtect(t) \
396 if ((t).mlen >= 0) { \
397 if ((t).mlen > (t).slen)) { \
398 (void)memset((t).data + (t).slen, 0, \
399 (size_t)(t).mlen - (t).slen); \
static char buf[MAXPATHLEN+1]
Definition afppasswd.c:75
BSTR_PUBLIC void * bwsClose(struct bwriteStream *stream)
Definition bstraux.c:1178
BSTR_PUBLIC int bwsWriteFlush(struct bwriteStream *stream)
Definition bstraux.c:1084
BSTR_PUBLIC int bReplicate(bstring b, int n)
Definition bstraux.c:84
BSTR_PUBLIC bstring bYEncode(const bstring src)
Definition bstraux.c:832
BSTR_PUBLIC bstring bBase64DecodeEx(const bstring b, int *boolTruncError)
Definition bstraux.c:430
BSTR_PUBLIC bstring bHead(bstring b, int n)
Definition bstraux.c:62
BSTR_PUBLIC int bReverse(bstring b)
Definition bstraux.c:90
BSTR_PUBLIC struct bwriteStream * bwsOpen(bNwrite writeFn, void *parm)
Definition bstraux.c:1053
BSTR_PUBLIC bstring bYDecode(const bstring src)
Definition bstraux.c:863
BSTR_PUBLIC int bSetChar(bstring b, int pos, char c)
Definition bstraux.c:972
BSTR_PUBLIC int bSetCstrChar(bstring a, int pos, char c)
Definition bstraux.c:952
BSTR_PUBLIC char * bStr2NetStr(const bstring b)
Definition bstraux.c:285
BSTR_PUBLIC int bwsWriteBstr(struct bwriteStream *stream, const bstring b)
Definition bstraux.c:1099
BSTR_PUBLIC bstring bStrfTime(const char *fmt, const struct tm *timeptr)
Definition bstraux.c:913
BSTR_PUBLIC int bFill(bstring a, char c, int len)
Definition bstraux.c:74
BSTR_PUBLIC int bJustifyRight(bstring b, int width, int space)
Definition bstraux.c:161
BSTR_PUBLIC bstring bUuDecodeEx(const bstring src, int *badlines)
Definition bstraux.c:652
BSTR_PUBLIC int bJustifyCenter(bstring b, int width, int space)
Definition bstraux.c:177
BSTR_PUBLIC struct bStream * bsUuDecode(struct bStream *sInp, int *badlines)
Definition bstraux.c:757
BSTR_PUBLIC int bJustifyMargin(bstring b, int width, int space)
Definition bstraux.c:194
BSTR_PUBLIC int bwsWriteBlk(struct bwriteStream *stream, void *blk, int len)
Definition bstraux.c:1141
BSTR_PUBLIC int bwsBuffLength(struct bwriteStream *stream, int sz)
Definition bstraux.c:1164
int(* bNwrite)(const void *buf, size_t elsize, size_t nelem, void *parm)
Definition bstraux.h:325
BSTR_PUBLIC struct bStream * bsFromBstr(const bstring b)
Definition bstraux.c:243
BSTR_PUBLIC bstring bBase64Encode(const bstring b)
Definition bstraux.c:343
BSTR_PUBLIC int bInsertChrs(bstring b, int pos, int len, unsigned char c, unsigned char fill)
Definition bstraux.c:111
BSTR_PUBLIC bstring bSecureInput(int maxlen, int termchar, bNgetc vgetchar, void *vgcCtx)
Definition bstraux.c:990
BSTR_PUBLIC bstring bTail(bstring b, int n)
Definition bstraux.c:50
BSTR_PUBLIC int bwsIsEOF(const struct bwriteStream *stream)
Definition bstraux.c:1152
BSTR_PUBLIC bstring bNetStr2Bstr(const char *buf)
Definition bstraux.c:306
BSTR_PUBLIC int bJustifyLeft(bstring b, int space)
Definition bstraux.c:137
BSTR_PUBLIC bstring bUuEncode(const bstring src)
Definition bstraux.c:790
C implementaion of bstring functions.
#define BSTR_PUBLIC
Definition bstrlib.h:51
struct tagbstring * bstring
Definition bstrlib.h:82
int(* bNgetc)(void *parm)
Definition bstrlib.h:1116
Definition bstrlib.c:1964
void * parm
Definition bstrlib.c:1966
Definition bstraux.c:1044
void * parm
Definition bstraux.c:1046
bNwrite writeFn
Definition bstraux.c:1047