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

vbuf.c File Reference

#include "define.h"

Include dependency graph for vbuf.c:

Include dependency graph

Go to the source code of this file.

Defines

#define ASSERT(x,)   { if( !(x) ) DIE(( __VA_ARGS__)); }

Functions

int skip_nl (char *s)
int find_nl (vstr *vs)
void unicode_init ()
void unicode_close ()
int utf16_is_terminated (const char *str, int length)
size_t vb_utf16to8 (vbuf *dest, const char *inbuf, int iblen)
void open_targets (const char *charset)
size_t sbcs_conversion (vbuf *dest, const char *inbuf, int iblen, iconv_t conversion)
size_t vb_utf8to8bit (vbuf *dest, const char *inbuf, int iblen, const char *charset)
size_t vb_8bit2utf8 (vbuf *dest, const char *inbuf, int iblen, const char *charset)
vbufvballoc (size_t len)
void vbcheck (vbuf *vb)
void vbfree (vbuf *vb)
void vbclear (struct varbuf *vb)
void vbresize (struct varbuf *vb, size_t len)
size_t vbavail (vbuf *vb)
void vbgrow (struct varbuf *vb, size_t len)
void vbset (vbuf *vb, void *b, size_t len)
void vsskipws (vstr *vs)
void vbappend (struct varbuf *vb, void *b, size_t len)
void vbskip (struct varbuf *vb, size_t skip)
void vboverwrite (struct varbuf *vbdest, struct varbuf *vbsrc)
vstrvsalloc (size_t len)
char * vsstr (vstr *vs)
size_t vslen (vstr *vs)
void vsfree (vstr *vs)
void vscharcat (vstr *vb, int ch)
void vsnprepend (vstr *vb, char *str, size_t len)
void vsskip (vstr *vs, size_t len)
int vsskipline (vstr *vs)
int vscatprintf (vstr *vs, char *fmt,...)
int vslast (vstr *vs)
void vs_printf (vstr *vs, char *fmt,...)
void vs_printfa (vstr *vs, char *fmt,...)
void vshexdump (vstr *vs, const char *b, size_t start, size_t stop, int ascii)
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 vsnset16 (vstr *vs, char *s, size_t len)
void vscat (vstr *vs, char *str)
int vscmp (vstr *vs, char *str)
void vsncat (vstr *vs, char *str, size_t len)
void vstrunc (vstr *v, size_t off)

Variables

int unicode_up = 0
iconv_t i16to8
const char * target_charset = NULL
int target_open_from = 0
int target_open_to = 0
iconv_t i8totarget = (iconv_t)-1
iconv_t target2i8 = (iconv_t)-1


Define Documentation

#define ASSERT  )     { if( !(x) ) DIE(( __VA_ARGS__)); }
 

Definition at line 5 of file vbuf.c.


Function Documentation

int find_nl vstr vs  ) 
 

Definition at line 20 of file vbuf.c.

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

Referenced by vsskipline().

void open_targets const char *  charset  )  [static]
 

Definition at line 131 of file vbuf.c.

References i8totarget, target2i8, target_charset, target_open_from, target_open_to, and WARN.

Referenced by vb_8bit2utf8(), and vb_utf8to8bit().

size_t sbcs_conversion vbuf dest,
const char *  inbuf,
int  iblen,
iconv_t  conversion
[static]
 

Definition at line 155 of file vbuf.c.

References varbuf::b, varbuf::blen, conversion, DEBUG_WARN, varbuf::dlen, ICONV_CONST, unicode_init(), vbgrow(), vbresize(), and vbuf.

Referenced by vb_8bit2utf8(), and vb_utf8to8bit().

Here is the call graph for this function:

int skip_nl char *  s  ) 
 

Definition at line 8 of file vbuf.c.

Referenced by vsskipline().

void unicode_close  ) 
 

Definition at line 64 of file vbuf.c.

References i16to8, i8totarget, target2i8, target_charset, target_open_from, target_open_to, and unicode_up.

Referenced by unicode_init().

void unicode_init  ) 
 

Definition at line 52 of file vbuf.c.

References i16to8, unicode_close(), unicode_up, and WARN.

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

Here is the call graph for this function:

int utf16_is_terminated const char *  str,
int  length
 

Definition at line 77 of file vbuf.c.

References DEBUG_WARN, vshexdump(), and VSTR_STATIC.

Referenced by vb_utf16to8().

Here is the call graph for this function:

size_t vb_8bit2utf8 vbuf dest,
const char *  inbuf,
int  iblen,
const char *  charset
 

Definition at line 191 of file vbuf.c.

References open_targets(), sbcs_conversion(), target2i8, and vbuf.

Referenced by pst_convert_utf8().

Here is the call graph for this function:

size_t vb_utf16to8 vbuf dest,
const char *  inbuf,
int  iblen
 

Definition at line 97 of file vbuf.c.

References ASSERT, varbuf::b, varbuf::blen, DEBUG_WARN, varbuf::dlen, i16to8, ICONV_CONST, unicode_init(), unicode_up, utf16_is_terminated(), vbgrow(), vbresize(), and vbuf.

Referenced by pst_parse_block().

Here is the call graph for this function:

size_t vb_utf8to8bit vbuf dest,
const char *  inbuf,
int  iblen,
const char *  charset
 

Definition at line 183 of file vbuf.c.

References i8totarget, open_targets(), sbcs_conversion(), and vbuf.

Referenced by write_body_part().

Here is the call graph for this function:

vbuf* vballoc size_t  len  ) 
 

Definition at line 199 of file vbuf.c.

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

Referenced by pst_convert_utf8(), pst_parse_block(), vsalloc(), and write_body_part().

Here is the call graph for this function:

void vbappend struct varbuf vb,
void *  b,
size_t  len
 

Definition at line 307 of file vbuf.c.

References varbuf::b, varbuf::dlen, vbgrow(), and vbset().

Here is the call graph for this function:

size_t vbavail vbuf vb  ) 
 

Definition at line 250 of file vbuf.c.

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

Referenced by vbgrow(), and vsavail().

void vbcheck vbuf vb  ) 
 

Definition at line 213 of file vbuf.c.

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

void vbclear struct varbuf vb  ) 
 

Definition at line 229 of file vbuf.c.

References vbresize().

Here is the call graph for this function:

void vbfree vbuf vb  ) 
 

Definition at line 222 of file vbuf.c.

References varbuf::buf, and vbuf.

Referenced by vsfree().

void vbgrow struct varbuf vb,
size_t  len
 

Definition at line 256 of file vbuf.c.

References ASSERT, varbuf::b, varbuf::blen, varbuf::buf, DIE, varbuf::dlen, vbavail(), and vbresize().

Here is the call graph for this function:

void vboverwrite struct varbuf vbdest,
struct varbuf vbsrc
 

Definition at line 329 of file vbuf.c.

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

Here is the call graph for this function:

void vbresize struct varbuf vb,
size_t  len
 

Definition at line 235 of file vbuf.c.

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

void vbset vbuf vb,
void *  b,
size_t  len
 

Definition at line 288 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 struct varbuf vb,
size_t  skip
 

Definition at line 320 of file vbuf.c.

References ASSERT, varbuf::b, and varbuf::dlen.

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

Definition at line 465 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 494 of file vbuf.c.

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

Referenced by vshexdump().

Here is the call graph for this function:

vstr* vsalloc size_t  len  ) 
 

Definition at line 338 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 574 of file vbuf.c.

References vbavail(), vbuf, and vstr.

Here is the call graph for this function:

void vscat vstr vs,
char *  str
 

Definition at line 591 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 420 of file vbuf.c.

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

Here is the call graph for this function:

void vscharcat vstr vb,
int  ch
 

Definition at line 364 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 597 of file vbuf.c.

References varstr::b, and vstr.

void vsfree vstr vs  ) 
 

Definition at line 358 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 568 of file vbuf.c.

References vbgrow(), vbuf, and vstr.

Here is the call graph for this function:

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

Definition at line 522 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 452 of file vbuf.c.

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

size_t vslen vstr vs  ) 
 

Definition at line 352 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 603 of file vbuf.c.

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

Referenced by vscat().

Here is the call graph for this function:

void vsnprepend vstr vb,
char *  str,
size_t  len
 

Definition at line 374 of file vbuf.c.

References ASSERT, varstr::b, varbuf::b, varstr::dlen, varbuf::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 559 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 vsnset16 vstr vs,
char *  s,
size_t  len
 

Definition at line 580 of file vbuf.c.

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

Here is the call graph for this function:

void vsset vstr vs,
char *  s
 

Definition at line 553 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 388 of file vbuf.c.

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

Here is the call graph for this function:

int vsskipline vstr vs  ) 
 

Definition at line 396 of file vbuf.c.

References varstr::b, varstr::dlen, find_nl(), skip_nl(), and vstr.

Here is the call graph for this function:

void vsskipws vstr vs  ) 
 

Definition at line 296 of file vbuf.c.

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

Here is the call graph for this function:

char* vsstr vstr vs  ) 
 

Definition at line 346 of file vbuf.c.

References varstr::b, and vstr.

Referenced by vslen().

void vstrunc vstr v,
size_t  off
 

Definition at line 616 of file vbuf.c.

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


Variable Documentation

iconv_t i16to8 [static]
 

Definition at line 44 of file vbuf.c.

Referenced by unicode_close(), unicode_init(), and vb_utf16to8().

iconv_t i8totarget = (iconv_t)-1 [static]
 

Definition at line 48 of file vbuf.c.

Referenced by open_targets(), unicode_close(), and vb_utf8to8bit().

iconv_t target2i8 = (iconv_t)-1 [static]
 

Definition at line 49 of file vbuf.c.

Referenced by open_targets(), unicode_close(), and vb_8bit2utf8().

const char* target_charset = NULL [static]
 

Definition at line 45 of file vbuf.c.

Referenced by open_targets(), and unicode_close().

int target_open_from = 0 [static]
 

Definition at line 46 of file vbuf.c.

Referenced by open_targets(), and unicode_close().

int target_open_to = 0 [static]
 

Definition at line 47 of file vbuf.c.

Referenced by open_targets(), and unicode_close().

int unicode_up = 0 [static]
 

Definition at line 43 of file vbuf.c.

Referenced by unicode_close(), unicode_init(), and vb_utf16to8().


Generated on Thu Mar 19 16:39:56 2009 for 'LibPst' by  doxygen 1.3.9.1