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#ifdef __cplusplus
8extern "C" {
9#endif
10
11// Variable-length buffers
12struct pst_varbuf {
13 size_t dlen; //length of data stored in buffer
14 size_t blen; //length of buffer
15 char *buf; //buffer
16 char *b; //start of stored data
17};
18
19
20typedef struct pst_varbuf pst_vbuf;
21
22pst_vbuf *pst_vballoc(size_t len);
23void pst_vbgrow(pst_vbuf *vb, size_t len); // grow buffer by len bytes, data are preserved
24void pst_vbset(pst_vbuf *vb, void *data, size_t len);
25void pst_vbappend(pst_vbuf *vb, void *data, size_t length);
28size_t pst_vb_utf16to8(pst_vbuf *dest, const char *inbuf, int iblen);
29size_t pst_vb_utf8to8bit(pst_vbuf *dest, const char *inbuf, int iblen, const char* charset);
30size_t pst_vb_8bit2utf8(pst_vbuf *dest, const char *inbuf, int iblen, const char* charset);
31
32#ifdef __cplusplus
33}
34#endif
35
36#endif
char * b
Definition vbuf.h:16
size_t dlen
Definition vbuf.h:13
char * buf
Definition vbuf.h:15
size_t blen
Definition vbuf.h:14
size_t pst_vb_8bit2utf8(pst_vbuf *dest, const char *inbuf, int iblen, const char *charset)
void pst_vbappend(pst_vbuf *vb, void *data, size_t length)
void pst_vbset(pst_vbuf *vb, void *data, size_t len)
void pst_unicode_close()
size_t pst_vb_utf16to8(pst_vbuf *dest, const char *inbuf, int iblen)
void pst_vbgrow(pst_vbuf *vb, size_t len)
void pst_unicode_init()
size_t pst_vb_utf8to8bit(pst_vbuf *dest, const char *inbuf, int iblen, const char *charset)
pst_vbuf * pst_vballoc(size_t len)