src/Strings/BString/bstrlib.c File Reference

#include <stdio.h>
#include <stddef.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "../../../include/Types/Types.hpp"
#include "../../../include/Strings/BString/bstrlib.h"

Classes

struct  bStream
struct  charField
struct  genBstrList

Defines

#define ascii(c)   ((unsigned char)(c) < 128)
#define bBlockCopy(D, S, L)   { if ((L) > 0) bstr__memmove ((D),(S),(L)); }
#define BLE_SZ   (sizeof (struct bstrList))
#define BS_BUFF_SZ   (1024)
#define BSSSC_BUFF_LEN   (256)
#define bstr__alloc(x)   malloc (x)
#define bstr__free(p)   free (p)
#define bstr__memcpy(d, s, l)   memcpy ((d), (s), (l))
#define bstr__memmove(d, s, l)   memmove ((d), (s), (l))
#define bstr__realloc(p, x)   realloc ((p), (x))
#define downcase(c)   (ascii(c) ? tolower(c) : (c))
#define exvsnprintf(r, b, n, f, a)   {r = vsnprintf (b,n,f,a);}
#define LONG_BITS_QTY   (1 << LONG_LOG_BITS_QTY)
#define LONG_LOG_BITS_QTY   (5)
#define LONG_TYPE   unsigned long
#define START_VSNBUFF   (16)
#define testInCharField(cf, c)   ((cf)->content[(c) >> LONG_LOG_BITS_QTY] & (((long)1) << ((c) & (LONG_BITS_QTY-1))))
#define upcase(c)   (ascii(c) ? toupper(c) : (c))
#define wspace(c)   (ascii(c) && isspace (c))

Typedefs

typedef int(*) instr_fnptr (const bstring s1, int pos, const bstring s2)

Functions

int balloc (bstring b, int len)
int bassign (bstring a, const bstring b)
int bassignformat (bstring b, const char *fmt,...)
int bassigngets (bstring b, bNgetc getcPtr, void *parm, char terminator)
int bassignmidstr (bstring a, const bstring b, int left, int len)
int bcatblk (bstring b, const unsigned char *s, int len)
int bcatcstr (bstring b, const char *s)
int bconcat (bstring b0, const bstring b1)
int bconchar (bstring b, char c)
int bcstrfree (char *s)
int bdelete (bstring b, int pos, int len)
int bdestroy (bstring b)
int bfindreplace (bstring b, const bstring find, const bstring repl, int pos)
int bfindreplacecaseless (bstring b, const bstring find, const bstring repl, int pos)
bstring bformat (const char *fmt,...)
int bformata (bstring b, const char *fmt,...)
bstring bfromcstr (const char *str)
bstring bfromcstralloc (int mlen, const char *str)
bstring bgets (bNgetc getcPtr, void *parm, char terminator)
int bgetsa (bstring b, bNgetc getcPtr, void *parm, char terminator)
int binchr (const bstring b0, int pos, const bstring b1)
static int binchrCF (const unsigned char *data, int len, int pos, const struct charField *cf)
int binchrr (const bstring b0, int pos, const bstring b1)
static int binchrrCF (const unsigned char *data, int pos, const struct charField *cf)
int binsert (bstring b1, int pos, const bstring b2, unsigned char fill)
int binsertch (bstring b, int pos, int len, unsigned char fill)
int binstr (const bstring b1, int pos, const bstring b2)
int binstrcaseless (const bstring b1, int pos, const bstring b2)
int binstrr (const bstring b1, int pos, const bstring b2)
int binstrrcaseless (const bstring b1, int pos, const bstring b2)
int biseq (const bstring b0, const bstring b1)
int biseqcaseless (const bstring b0, const bstring b1)
int biseqcstr (const bstring b, const char *s)
int biseqcstrcaseless (const bstring b, const char *s)
int bisstemeqblk (const bstring b0, const void *blk, int len)
int bisstemeqcaselessblk (const bstring b0, const void *blk, int len)
bstring bjoin (const struct bstrList *bl, const bstring sep)
bstring blk2bstr (const void *blk, int len)
int bltrimws (bstring b)
bstring bmidstr (const bstring b, int left, int len)
int bninchr (const bstring b0, int pos, const bstring b1)
int bninchrr (const bstring b0, int pos, const bstring b1)
int bpattern (bstring b, int len)
bstring bread (bNread readPtr, void *parm)
int breada (bstring b, bNread readPtr, void *parm)
int breplace (bstring b1, int pos, int len, const bstring b2, unsigned char fill)
int brtrimws (bstring b)
int bsbufflength (struct bStream *s, int sz)
static int bscb (void *parm, int ofs, int len)
void * bsclose (struct bStream *s)
int bseof (const struct bStream *s)
int bsetstr (bstring b0, int pos, const bstring b1, unsigned char fill)
bStreambsopen (bNread readPtr, void *parm)
int bspeek (bstring r, const struct bStream *s)
bstrListbsplit (const bstring str, unsigned char splitChar)
int bsplitcb (const bstring str, unsigned char splitChar, int pos, int(*cb)(void *parm, int ofs, int len), void *parm)
bstrListbsplits (const bstring str, const bstring splitStr)
int bsplitscb (const bstring str, const bstring splitStr, int pos, int(*cb)(void *parm, int ofs, int len), void *parm)
int bsread (bstring r, struct bStream *s, int n)
int bsreada (bstring r, struct bStream *s, int n)
int bsreadln (bstring r, struct bStream *s, char terminator)
int bsreadlna (bstring r, struct bStream *s, char terminator)
int bsreadlns (bstring r, struct bStream *s, const bstring term)
int bsreadlnsa (bstring r, struct bStream *s, const bstring term)
int bssplitscb (struct bStream *s, const bstring splitStr, int(*cb)(void *parm, int ofs, const bstring entry), void *parm)
char * bstr2cstr (const bstring b, char z)
int bstrchrp (const bstring b, int c, int pos)
int bstrcmp (const bstring b0, const bstring b1)
bstring bstrcpy (const bstring b)
int bstricmp (const bstring b0, const bstring b1)
int bstrListDestroy (struct bstrList *sl)
int bstrncmp (const bstring b0, const bstring b1, int n)
int bstrnicmp (const bstring b0, const bstring b1, int n)
int bstrrchrp (const bstring b, int c, int pos)
int bsunread (struct bStream *s, const bstring b)
int btolower (bstring b)
int btoupper (bstring b)
int btrimws (bstring b)
int btrunc (bstring b, int n)
static int buildCharField (struct charField *cf, const bstring b1)
static int findreplaceengine (bstring b, const bstring find, const bstring repl, int pos, instr_fnptr instr)
static void invertCharField (struct charField *cf)
static int snapUpSize (int i)


Define Documentation

#define ascii (  )     ((unsigned char)(c) < 128)

#define bBlockCopy ( D,
S,
 )     { if ((L) > 0) bstr__memmove ((D),(S),(L)); }

#define BLE_SZ   (sizeof (struct bstrList))

#define BS_BUFF_SZ   (1024)

#define BSSSC_BUFF_LEN   (256)

#define bstr__alloc (  )     malloc (x)

#define bstr__free (  )     free (p)

#define bstr__memcpy ( d,
s,
 )     memcpy ((d), (s), (l))

#define bstr__memmove ( d,
s,
 )     memmove ((d), (s), (l))

#define bstr__realloc ( p,
 )     realloc ((p), (x))

#define downcase (  )     (ascii(c) ? tolower(c) : (c))

#define exvsnprintf ( r,
b,
n,
f,
 )     {r = vsnprintf (b,n,f,a);}

#define LONG_BITS_QTY   (1 << LONG_LOG_BITS_QTY)

#define LONG_LOG_BITS_QTY   (5)

#define LONG_TYPE   unsigned long

#define START_VSNBUFF   (16)

#define testInCharField ( cf,
 )     ((cf)->content[(c) >> LONG_LOG_BITS_QTY] & (((long)1) << ((c) & (LONG_BITS_QTY-1))))

#define upcase (  )     (ascii(c) ? toupper(c) : (c))

#define wspace (  )     (ascii(c) && isspace (c))


Typedef Documentation

typedef int(*) instr_fnptr(const bstring s1, int pos, const bstring s2)


Function Documentation

int balloc ( bstring  b,
int  len 
)

int bassign ( bstring  a,
const bstring  b 
)

int bassignformat ( bstring  b,
const char *  fmt,
  ... 
)

int bassigngets ( bstring  b,
bNgetc  getcPtr,
void *  parm,
char  terminator 
)

int bassignmidstr ( bstring  a,
const bstring  b,
int  left,
int  len 
)

int bcatblk ( bstring  b,
const unsigned char *  s,
int  len 
)

int bcatcstr ( bstring  b,
const char *  s 
)

int bconcat ( bstring  b0,
const bstring  b1 
)

int bconchar ( bstring  b,
char  c 
)

int bcstrfree ( char *  s  ) 

int bdelete ( bstring  b,
int  pos,
int  len 
)

int bdestroy ( bstring  b  ) 

int bfindreplace ( bstring  b,
const bstring  find,
const bstring  repl,
int  pos 
)

int bfindreplacecaseless ( bstring  b,
const bstring  find,
const bstring  repl,
int  pos 
)

bstring bformat ( const char *  fmt,
  ... 
)

int bformata ( bstring  b,
const char *  fmt,
  ... 
)

bstring bfromcstr ( const char *  str  ) 

bstring bfromcstralloc ( int  mlen,
const char *  str 
)

bstring bgets ( bNgetc  getcPtr,
void *  parm,
char  terminator 
)

int bgetsa ( bstring  b,
bNgetc  getcPtr,
void *  parm,
char  terminator 
)

int binchr ( const bstring  b0,
int  pos,
const bstring  b1 
)

static int binchrCF ( const unsigned char *  data,
int  len,
int  pos,
const struct charField cf 
) [static]

int binchrr ( const bstring  b0,
int  pos,
const bstring  b1 
)

static int binchrrCF ( const unsigned char *  data,
int  pos,
const struct charField cf 
) [static]

int binsert ( bstring  b1,
int  pos,
const bstring  b2,
unsigned char  fill 
)

int binsertch ( bstring  b,
int  pos,
int  len,
unsigned char  fill 
)

int binstr ( const bstring  b1,
int  pos,
const bstring  b2 
)

int binstrcaseless ( const bstring  b1,
int  pos,
const bstring  b2 
)

int binstrr ( const bstring  b1,
int  pos,
const bstring  b2 
)

int binstrrcaseless ( const bstring  b1,
int  pos,
const bstring  b2 
)

int biseq ( const bstring  b0,
const bstring  b1 
)

int biseqcaseless ( const bstring  b0,
const bstring  b1 
)

int biseqcstr ( const bstring  b,
const char *  s 
)

int biseqcstrcaseless ( const bstring  b,
const char *  s 
)

int bisstemeqblk ( const bstring  b0,
const void *  blk,
int  len 
)

int bisstemeqcaselessblk ( const bstring  b0,
const void *  blk,
int  len 
)

bstring bjoin ( const struct bstrList bl,
const bstring  sep 
)

bstring blk2bstr ( const void *  blk,
int  len 
)

int bltrimws ( bstring  b  ) 

bstring bmidstr ( const bstring  b,
int  left,
int  len 
)

int bninchr ( const bstring  b0,
int  pos,
const bstring  b1 
)

int bninchrr ( const bstring  b0,
int  pos,
const bstring  b1 
)

int bpattern ( bstring  b,
int  len 
)

bstring bread ( bNread  readPtr,
void *  parm 
)

int breada ( bstring  b,
bNread  readPtr,
void *  parm 
)

int breplace ( bstring  b1,
int  pos,
int  len,
const bstring  b2,
unsigned char  fill 
)

int brtrimws ( bstring  b  ) 

int bsbufflength ( struct bStream s,
int  sz 
)

static int bscb ( void *  parm,
int  ofs,
int  len 
) [static]

void* bsclose ( struct bStream s  ) 

int bseof ( const struct bStream s  ) 

int bsetstr ( bstring  b0,
int  pos,
const bstring  b1,
unsigned char  fill 
)

struct bStream* bsopen ( bNread  readPtr,
void *  parm 
)

int bspeek ( bstring  r,
const struct bStream s 
)

struct bstrList* bsplit ( const bstring  str,
unsigned char  splitChar 
)

int bsplitcb ( const bstring  str,
unsigned char  splitChar,
int  pos,
int(*)(void *parm, int ofs, int len)  cb,
void *  parm 
)

struct bstrList* bsplits ( const bstring  str,
const bstring  splitStr 
)

int bsplitscb ( const bstring  str,
const bstring  splitStr,
int  pos,
int(*)(void *parm, int ofs, int len)  cb,
void *  parm 
)

int bsread ( bstring  r,
struct bStream s,
int  n 
)

int bsreada ( bstring  r,
struct bStream s,
int  n 
)

int bsreadln ( bstring  r,
struct bStream s,
char  terminator 
)

int bsreadlna ( bstring  r,
struct bStream s,
char  terminator 
)

int bsreadlns ( bstring  r,
struct bStream s,
const bstring  term 
)

int bsreadlnsa ( bstring  r,
struct bStream s,
const bstring  term 
)

int bssplitscb ( struct bStream s,
const bstring  splitStr,
int(*)(void *parm, int ofs, const bstring entry)  cb,
void *  parm 
)

char* bstr2cstr ( const bstring  b,
char  z 
)

int bstrchrp ( const bstring  b,
int  c,
int  pos 
)

int bstrcmp ( const bstring  b0,
const bstring  b1 
)

bstring bstrcpy ( const bstring  b  ) 

int bstricmp ( const bstring  b0,
const bstring  b1 
)

int bstrListDestroy ( struct bstrList sl  ) 

int bstrncmp ( const bstring  b0,
const bstring  b1,
int  n 
)

int bstrnicmp ( const bstring  b0,
const bstring  b1,
int  n 
)

int bstrrchrp ( const bstring  b,
int  c,
int  pos 
)

int bsunread ( struct bStream s,
const bstring  b 
)

int btolower ( bstring  b  ) 

int btoupper ( bstring  b  ) 

int btrimws ( bstring  b  ) 

int btrunc ( bstring  b,
int  n 
)

static int buildCharField ( struct charField cf,
const bstring  b1 
) [static]

static int findreplaceengine ( bstring  b,
const bstring  find,
const bstring  repl,
int  pos,
instr_fnptr  instr 
) [static]

static void invertCharField ( struct charField cf  )  [static]

static int snapUpSize ( int  i  )  [static]


(C) An X-Ryl669 project 2007

This document describes Unlimited Zooming Interface source code. UZI stands for Unlimited Zooming Interface, and source code license is