libpst.so.4
vbuf.h
Go to the documentation of this file.
1 
2 #ifndef __PST_VBUF_H
3 #define __PST_VBUF_H
4 
5 #include "common.h"
6 
7 
8 // Variable-length buffers
9 struct pst_varbuf {
10  size_t dlen; //length of data stored in buffer
11  size_t blen; //length of buffer
12  char *buf; //buffer
13  char *b; //start of stored data
14 };
15 
16 
17 typedef struct pst_varbuf pst_vbuf;
18 
19 pst_vbuf *pst_vballoc(size_t len);
20 void pst_vbgrow(pst_vbuf *vb, size_t len); // grow buffer by len bytes, data are preserved
21 void pst_vbset(pst_vbuf *vb, void *data, size_t len);
22 void pst_vbappend(pst_vbuf *vb, void *data, size_t length);
23 void pst_unicode_init();
24 size_t pst_vb_utf16to8(pst_vbuf *dest, const char *inbuf, int iblen);
25 size_t pst_vb_utf8to8bit(pst_vbuf *dest, const char *inbuf, int iblen, const char* charset);
26 size_t pst_vb_8bit2utf8(pst_vbuf *dest, const char *inbuf, int iblen, const char* charset);
27 
28 
29 #endif
size_t pst_vb_utf8to8bit(pst_vbuf *dest, const char *inbuf, int iblen, const char *charset)
size_t pst_vb_utf16to8(pst_vbuf *dest, const char *inbuf, int iblen)
void pst_vbset(pst_vbuf *vb, void *data, size_t len)
size_t pst_vb_8bit2utf8(pst_vbuf *dest, const char *inbuf, int iblen, const char *charset)
size_t dlen
Definition: vbuf.h:10
Definition: vbuf.h:9
void pst_vbappend(pst_vbuf *vb, void *data, size_t length)
void pst_unicode_init()
pst_vbuf * pst_vballoc(size_t len)
char * b
Definition: vbuf.h:13
char * buf
Definition: vbuf.h:12
size_t blen
Definition: vbuf.h:11
void pst_vbgrow(pst_vbuf *vb, size_t len)