Main Page | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

vbuf.h File Reference

#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>

Include dependency graph for vbuf.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  varbuf
struct  varstr

Defines

#define SZ_MAX   4096
#define DELIM   '\\'
#define TOK_EMPTY   0
#define TOK_DELIM   1
#define TOK_PARENT   2
#define TOK_CURRENT   3
#define TOK_ELEMENT   4
#define TOK_ERROR   10
#define TOK_BUF_SMALL   11
#define VBUF_STATIC(x, y)   static vbuf *x = NULL; if(!x) x = vballoc(y);
#define VSTR_STATIC(x, y)   static vstr *x = NULL; if(!x) x = vsalloc(y);

Typedefs

typedef varbuf vbuf
typedef varstr vstr

Functions

varbufvballoc (size_t len)
void vbfree (vbuf *vb)
void vbclear (vbuf *vb)
void vbresize (vbuf *vb, size_t len)
size_t vbavail (vbuf *vb)
void vbdump (vbuf *vb)
void vbgrow (vbuf *vb, size_t len)
void vbset (vbuf *vb, void *data, size_t len)
void vbskipws (vbuf *vb)
void vbappend (vbuf *vb, void *data, size_t length)
void vbskip (vbuf *vb, size_t skip)
void vboverwrite (vbuf *vbdest, vbuf *vbsrc)
vstrvsalloc (size_t len)
char * vsb (vstr *vs)
size_t vslen (vstr *vs)
void vsfree (vstr *vs)
void vsset (vstr *vs, char *s)
void vsnset (vstr *vs, char *s, size_t n)
void vsgrow (vstr *vs, size_t len)
size_t vsavail (vstr *vs)
void vscat (vstr *vs, char *str)
void vsncat (vstr *vs, char *str, size_t len)
void vsnprepend (vstr *vs, char *str, size_t len)
void vsskip (vstr *vs, size_t len)
int vscmp (vstr *vs, char *str)
void vsskipws (vstr *vs)
void vs_printf (vstr *vs, char *fmt,...)
void vs_printfa (vstr *vs, char *fmt,...)
void vshexdump (vstr *vs, char *b, size_t start, size_t stop, int ascii)
int vscatprintf (vstr *vs, char *fmt,...)
void vsvprintf (vstr *vs, char *fmt, va_list ap)
void vstrunc (vstr *vs, size_t off)
int vslast (vstr *vs)
void vscharcat (vstr *vs, int ch)
int vsutf16 (vstr *vs, vbuf *in)
int vs_parse_escaped_string (vstr *vs, char *str, size_t len)
void unicode_init ()
void unicode_close ()
int utf16_write (FILE *stream, const void *buf, size_t count)
int utf16_fprintf (FILE *stream, const char *fmt,...)
int utf16to8 (char *inbuf_o, char *outbuf_o, int length)
int utf8to16 (char *inbuf_o, int iblen, char *outbuf_o, int oblen)
int vb_utf8to16T (vbuf *bout, char *cin, int inlen)
int vb_utf16to8 (vbuf *dest, char *buf, int len)
int iso8859_1to8 (char *inbuf_o, char *outbuf_o, int length)
int utf8toascii (const char *inbuf_o, char *outbuf_o, int length)
void winhex (FILE *stream, unsigned char *hbuf, int start, int stop, int loff)
void winhex8 (FILE *stream, unsigned char *hbuf, int start, int stop, int loff)
void vbwinhex8 (vbuf *vb, unsigned char *hbuf, int start, int stop, int loff)
int find_in_buf (char *buf, char *what, int sz, int len, int start)
int get_int (char *array)
int find_nl (vstr *vs)
int skip_nl (char *s)
int vb_skipline (struct varbuf *vb)
int gethexorstr (char **c, char *wb)
char * esc_index (char *s, int c)
char * esc_rindex (char *s, int c)
char * tok_esc_char (char *s, int *is_esc, int *c)
int vb_path_token (vbuf *tok, char **path)
int gettoken (char *tok, int len, char **path, char delim)


Define Documentation

#define DELIM   '\\'
 

Definition at line 21 of file vbuf.h.

#define SZ_MAX   4096
 

Definition at line 14 of file vbuf.h.

#define TOK_BUF_SMALL   11
 

Definition at line 30 of file vbuf.h.

#define TOK_CURRENT   3
 

Definition at line 26 of file vbuf.h.

#define TOK_DELIM   1
 

Definition at line 24 of file vbuf.h.

#define TOK_ELEMENT   4
 

Definition at line 27 of file vbuf.h.

#define TOK_EMPTY   0
 

Definition at line 23 of file vbuf.h.

#define TOK_ERROR   10
 

Definition at line 29 of file vbuf.h.

#define TOK_PARENT   2
 

Definition at line 25 of file vbuf.h.

#define VBUF_STATIC x,
 )     static vbuf *x = NULL; if(!x) x = vballoc(y);
 

Definition at line 55 of file vbuf.h.

Referenced by vb_utf16to8().

#define VSTR_STATIC x,
 )     static vstr *x = NULL; if(!x) x = vsalloc(y);
 

Definition at line 56 of file vbuf.h.

Referenced by utf16_is_terminated().


Typedef Documentation

typedef struct varbuf vbuf
 

Definition at line 52 of file vbuf.h.

Referenced by pst_parse_block(), vb_utf16to8(), vb_utf8to16T(), vballoc(), vbavail(), vbcheck(), vbfree(), vbset(), vs_printf(), vs_printfa(), vsavail(), vscatprintf(), vscharcat(), vsfree(), vsgrow(), vsncat(), vsnprepend(), vsnset(), vsnset16(), vsskip(), and vsskipws().

typedef struct varstr vstr
 

Definition at line 53 of file vbuf.h.

Referenced by find_nl(), vs_printf(), vs_printfa(), vsalloc(), vsavail(), vscat(), vscatprintf(), vscharcat(), vscmp(), vsfree(), vsgrow(), vshexdump(), vslast(), vslen(), vsncat(), vsnprepend(), vsnset(), vsnset16(), vsset(), vsskip(), vsskipline(), vsskipws(), vsstr(), and vstrunc().


Function Documentation

char* esc_index char *  s,
int  c
 

char* esc_rindex char *  s,
int  c
 

int find_in_buf char *  buf,
char *  what,
int  sz,
int  len,
int  start
 

int find_nl vstr vs  ) 
 

Definition at line 35 of file vbuf.c.

References varstr::b, varstr::dlen, and vstr.

Referenced by vsskipline().

int get_int char *  array  ) 
 

int gethexorstr char **  c,
char *  wb
 

int gettoken char *  tok,
int  len,
char **  path,
char  delim
 

int iso8859_1to8 char *  inbuf_o,
char *  outbuf_o,
int  length
 

int skip_nl char *  s  ) 
 

Definition at line 23 of file vbuf.c.

Referenced by vsskipline().

char* tok_esc_char char *  s,
int *  is_esc,
int *  c
 

void unicode_close  ) 
 

Definition at line 100 of file vbuf.c.

References i16to8, i8859_1to8, i8to16, i8toi8859_1, and unicode_up.

Referenced by unicode_init().

void unicode_init  ) 
 

Definition at line 65 of file vbuf.c.

References ASSERT, i16to8, i8859_1to8, i8to16, i8toi8859_1, unicode_close(), unicode_up, and utf8to16().

Referenced by pst_open(), vb_utf16to8(), and vb_utf8to16T().

Here is the call graph for this function:

int utf16_fprintf FILE *  stream,
const char *  fmt,
  ...
 

int utf16_write FILE *  stream,
const void *  buf,
size_t  count
 

int utf16to8 char *  inbuf_o,
char *  outbuf_o,
int  length
 

int utf8to16 char *  inbuf_o,
int  iblen,
char *  outbuf_o,
int  oblen
 

Definition at line 190 of file vbuf.c.

References ASSERT, DIE, and i8to16.

Referenced by unicode_init().

int utf8toascii const char *  inbuf_o,
char *  outbuf_o,
int  length
 

int vb_path_token vbuf tok,
char **  path
 

int vb_skipline struct varbuf vb  ) 
 

int vb_utf16to8 vbuf dest,
char *  buf,
int  len
 

Definition at line 130 of file vbuf.c.

References ASSERT, varbuf::b, varbuf::blen, DIE, varbuf::dlen, i16to8, unicode_init(), unicode_up, utf16_is_terminated(), vb_utf8to16T(), vbgrow(), vbresize(), vbuf, and VBUF_STATIC.

Referenced by pst_parse_block().

Here is the call graph for this function:

int vb_utf8to16T vbuf bout,
char *  cin,
int  inlen
 

Definition at line 216 of file vbuf.c.

References varbuf::b, varbuf::blen, varbuf::dlen, i8to16, unicode_init(), vbgrow(), vbresize(), vbuf, and WARN.

Referenced by vb_utf16to8().

Here is the call graph for this function:

struct varbuf* vballoc size_t  len  ) 
 

Definition at line 274 of file vbuf.c.

References varbuf::blen, varbuf::buf, DIE, varbuf::dlen, vbresize(), and vbuf.

Referenced by pst_parse_block(), and vsalloc().

Here is the call graph for this function:

void vbappend vbuf vb,
void *  data,
size_t  length
 

Referenced by pst_parse_block().

size_t vbavail vbuf vb  ) 
 

Definition at line 325 of file vbuf.c.

References varbuf::b, varbuf::blen, varbuf::buf, varbuf::dlen, and vbuf.

Referenced by vbgrow(), and vsavail().

void vbclear vbuf vb  ) 
 

void vbdump vbuf vb  ) 
 

void vbfree vbuf vb  ) 
 

Definition at line 297 of file vbuf.c.

References varbuf::buf, and vbuf.

Referenced by vsfree().

void vbgrow vbuf vb,
size_t  len
 

Referenced by vb_utf16to8(), vb_utf8to16T(), vbappend(), vs_printfa(), vscatprintf(), vscharcat(), vsgrow(), vsncat(), and vsnprepend().

void vboverwrite vbuf vbdest,
vbuf vbsrc
 

void vbresize vbuf vb,
size_t  len
 

Referenced by vb_utf16to8(), vb_utf8to16T(), vballoc(), vbclear(), vbgrow(), vboverwrite(), vbset(), vs_printf(), vsnset(), and vsnset16().

void vbset vbuf vb,
void *  data,
size_t  len
 

Definition at line 377 of file vbuf.c.

References varbuf::b, varbuf::dlen, vbresize(), and vbuf.

Referenced by pst_parse_block(), and vbappend().

Here is the call graph for this function:

void vbskip vbuf vb,
size_t  skip
 

Referenced by vsskip(), and vsskipws().

void vbskipws vbuf vb  ) 
 

void vbwinhex8 vbuf vb,
unsigned char *  hbuf,
int  start,
int  stop,
int  loff
 

int vs_parse_escaped_string vstr vs,
char *  str,
size_t  len
 

void vs_printf vstr vs,
char *  fmt,
  ...
 

Definition at line 555 of file vbuf.c.

References varbuf::b, varbuf::blen, varbuf::dlen, vbresize(), vbuf, and vstr.

Here is the call graph for this function:

void vs_printfa vstr vs,
char *  fmt,
  ...
 

Definition at line 584 of file vbuf.c.

References varbuf::b, varbuf::blen, varstr::blen, varbuf::dlen, varstr::dlen, vbgrow(), vbuf, and vstr.

Referenced by vshexdump().

Here is the call graph for this function:

vstr* vsalloc size_t  len  ) 
 

Definition at line 428 of file vbuf.c.

References vballoc(), vsset(), and vstr.

Here is the call graph for this function:

size_t vsavail vstr vs  ) 
 

Definition at line 664 of file vbuf.c.

References vbavail(), vbuf, and vstr.

Here is the call graph for this function:

char* vsb vstr vs  ) 
 

void vscat vstr vs,
char *  str
 

Definition at line 681 of file vbuf.c.

References vsncat(), and vstr.

Here is the call graph for this function:

int vscatprintf vstr vs,
char *  fmt,
  ...
 

Definition at line 510 of file vbuf.c.

References varstr::b, varbuf::blen, varstr::blen, varstr::dlen, vbgrow(), vbuf, vsset(), and vstr.

Here is the call graph for this function:

void vscharcat vstr vs,
int  ch
 

Definition at line 454 of file vbuf.c.

References varbuf::b, varbuf::dlen, vbgrow(), vbuf, and vstr.

Here is the call graph for this function:

int vscmp vstr vs,
char *  str
 

Definition at line 687 of file vbuf.c.

References varstr::b, and vstr.

void vsfree vstr vs  ) 
 

Definition at line 448 of file vbuf.c.

References vbfree(), vbuf, and vstr.

Here is the call graph for this function:

void vsgrow vstr vs,
size_t  len
 

Definition at line 658 of file vbuf.c.

References vbgrow(), vbuf, and vstr.

Here is the call graph for this function:

void vshexdump vstr vs,
char *  b,
size_t  start,
size_t  stop,
int  ascii
 

Definition at line 612 of file vbuf.c.

References vs_printfa(), and vstr.

Referenced by utf16_is_terminated().

Here is the call graph for this function:

int vslast vstr vs  ) 
 

Definition at line 542 of file vbuf.c.

References varstr::b, varstr::dlen, and vstr.

size_t vslen vstr vs  ) 
 

Definition at line 442 of file vbuf.c.

References vsstr(), and vstr.

Here is the call graph for this function:

void vsncat vstr vs,
char *  str,
size_t  len
 

Definition at line 693 of file vbuf.c.

References ASSERT, varbuf::b, varstr::b, varbuf::dlen, varstr::dlen, vbgrow(), vbuf, and vstr.

Referenced by vscat().

Here is the call graph for this function:

void vsnprepend vstr vs,
char *  str,
size_t  len
 

Definition at line 464 of file vbuf.c.

References ASSERT, varbuf::b, varstr::b, varbuf::dlen, varstr::dlen, vbgrow(), vbuf, and vstr.

Here is the call graph for this function:

void vsnset vstr vs,
char *  s,
size_t  n
 

Definition at line 649 of file vbuf.c.

References varbuf::b, varbuf::dlen, vbresize(), vbuf, and vstr.

Referenced by vsset().

Here is the call graph for this function:

void vsset vstr vs,
char *  s
 

Definition at line 643 of file vbuf.c.

References vsnset(), and vstr.

Referenced by vsalloc(), and vscatprintf().

Here is the call graph for this function:

void vsskip vstr vs,
size_t  len
 

Definition at line 478 of file vbuf.c.

References ASSERT, vbskip(), vbuf, and vstr.

Here is the call graph for this function:

void vsskipws vstr vs  ) 
 

Definition at line 386 of file vbuf.c.

References varbuf::b, varstr::b, varstr::dlen, vbskip(), vbuf, and vstr.

Here is the call graph for this function:

void vstrunc vstr vs,
size_t  off
 

Definition at line 706 of file vbuf.c.

References varstr::b, varstr::dlen, and vstr.

int vsutf16 vstr vs,
vbuf in
 

void vsvprintf vstr vs,
char *  fmt,
va_list  ap
 

void winhex FILE *  stream,
unsigned char *  hbuf,
int  start,
int  stop,
int  loff
 

void winhex8 FILE *  stream,
unsigned char *  hbuf,
int  start,
int  stop,
int  loff
 


Generated on Thu Dec 11 11:59:16 2008 for 'LibPst' by  doxygen 1.3.9.1