Mercurial > libpst
diff src/vbuf.h @ 172:6954d315aaa8
move version-info into main configure.in, and set it properly.
prefix all external symbols in the shared library with pst_ to avoid symbol clashes with other shared libraries.
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sat, 04 Apr 2009 16:00:48 -0700 |
parents | cda7c812ec01 |
children | ac6e22c8a9cf |
line wrap: on
line diff
--- a/src/vbuf.h Sun Mar 29 08:51:13 2009 -0700 +++ b/src/vbuf.h Sat Apr 04 16:00:48 2009 -0700 @@ -39,58 +39,58 @@ typedef struct varbuf vbuf; typedef struct varstr vstr; -#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); +#define VBUF_STATIC(x,y) static vbuf *x = NULL; if(!x) x = pst_vballoc(y); +#define VSTR_STATIC(x,y) static vstr *x = NULL; if(!x) x = pst_vsalloc(y); -int skip_nl( char *s ); // returns the width of the newline at s[0] -int find_nl( vstr *vs ); // find newline of type type in b +int pst_skip_nl( char *s ); // returns the width of the newline at s[0] +int pst_find_nl( vstr *vs ); // find newline of type type in b // vbuf functions -struct varbuf *vballoc( size_t len ); -void vbfree( vbuf *vb ); -void vbclear( vbuf *vb ); //ditch the data, keep the buffer -void vbresize( vbuf *vb, size_t len ); -size_t vbavail( vbuf *vb ); -void vbdump( vbuf *vb ); -void vbgrow( vbuf *vb, size_t len ); // grow buffer by len bytes, data are preserved -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 ); +vbuf *pst_vballoc( size_t len ); +void pst_vbfree( vbuf *vb ); +void pst_vbclear( vbuf *vb ); //ditch the data, keep the buffer +void pst_vbresize( vbuf *vb, size_t len ); +size_t pst_vbavail( vbuf *vb ); +void pst_vbdump( vbuf *vb ); +void pst_vbgrow( vbuf *vb, size_t len ); // grow buffer by len bytes, data are preserved +void pst_vbset( vbuf *vb, void *data, size_t len ); +void pst_vbskipws( vbuf *vb ); +void pst_vbappend( vbuf *vb, void *data, size_t length ); +void pst_vbskip( vbuf *vb, size_t skip ); +void pst_vboverwrite( vbuf *vbdest, vbuf *vbsrc ); // vstr functions -vstr *vsalloc( size_t len ); -char *vsb( vstr *vs ); -size_t vslen( vstr *vs ); //strlen -void vsfree( vstr *vs ); -void vsset( vstr *vs, char *s ); // Store string s in vb -void vsnset( vstr *vs, char *s, size_t n ); // Store string s in vb -void vsgrow( vstr *vs, size_t len ); // grow buffer by len bytes, data are preserved -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, const 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 ); // Drop chars [off..dlen] -int vslast( vstr *vs ); // returns the last character stored in a vstr string -void vscharcat( vstr *vs, int ch ); +vstr *pst_vsalloc( size_t len ); +char *pst_vsb( vstr *vs ); +size_t pst_vslen( vstr *vs ); //strlen +void pst_vsfree( vstr *vs ); +void pst_vsset( vstr *vs, char *s ); // Store string s in vb +void pst_vsnset( vstr *vs, char *s, size_t n ); // Store string s in vb +void pst_vsgrow( vstr *vs, size_t len ); // grow buffer by len bytes, data are preserved +size_t pst_vsavail( vstr *vs ); +void pst_vscat( vstr *vs, char *str ); +void pst_vsncat( vstr *vs, char *str, size_t len ); +void pst_vsnprepend( vstr *vs, char *str, size_t len ) ; +void pst_vsskip( vstr *vs, size_t len ); +int pst_vscmp( vstr *vs, char *str ); +void pst_vsskipws( vstr *vs ); +void pst_vs_printf( vstr *vs, char *fmt, ... ); +void pst_vs_printfa( vstr *vs, char *fmt, ... ); +void pst_vshexdump( vstr *vs, const char *b, size_t start, size_t stop, int ascii ); +int pst_vscatprintf( vstr *vs, char *fmt, ... ); +void pst_vsvprintf( vstr *vs, char *fmt, va_list ap ); +void pst_vstrunc( vstr *vs, size_t off ); // Drop chars [off..dlen] +int pst_vslast( vstr *vs ); // returns the last character stored in a vstr string +void pst_vscharcat( vstr *vs, int ch ); -void unicode_init(); -void unicode_close(); -size_t vb_utf16to8(vbuf *dest, const char *inbuf, int iblen); -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); +void pst_unicode_init(); +void pst_unicode_close(); +size_t pst_vb_utf16to8(vbuf *dest, const char *inbuf, int iblen); +size_t pst_vb_utf8to8bit(vbuf *dest, const char *inbuf, int iblen, const char* charset); +size_t pst_vb_8bit2utf8(vbuf *dest, const char *inbuf, int iblen, const char* charset); -int vb_skipline( struct varbuf *vb ); // in: vb->b == "stuff\nmore_stuff"; out: vb->b == "more_stuff" +int pst_vb_skipline( struct varbuf *vb ); // in: vb->b == "stuff\nmore_stuff"; out: vb->b == "more_stuff" #endif // VBUF_H