vbuf.h
Go to the documentation of this file.
#ifndef __PST_VBUF_H
#define __PST_VBUF_H
#include "common.h"
// Variable-length buffers
struct pst_varbuf {
size_t dlen; //length of data stored in buffer
size_t blen; //length of buffer
char *buf; //buffer
char *b; //start of stored data
};
typedef struct pst_varbuf pst_vbuf;
pst_vbuf *pst_vballoc(size_t len);
void pst_vbgrow(pst_vbuf *vb, size_t len); // grow buffer by len bytes, data are preserved
void pst_vbset(pst_vbuf *vb, void *data, size_t len);
void pst_vbappend(pst_vbuf *vb, void *data, size_t length);
void pst_unicode_init();
size_t pst_vb_utf16to8(pst_vbuf *dest, const char *inbuf, int iblen);
size_t pst_vb_utf8to8bit(pst_vbuf *dest, const char *inbuf, int iblen, const char* charset);
size_t pst_vb_8bit2utf8(pst_vbuf *dest, const char *inbuf, int iblen, const char* charset);
#endif
pst_vb_utf8to8bit
size_t pst_vb_utf8to8bit(pst_vbuf *dest, const char *inbuf, int iblen, const char *charset)
pst_vb_utf16to8
size_t pst_vb_utf16to8(pst_vbuf *dest, const char *inbuf, int iblen)
pst_vbset
void pst_vbset(pst_vbuf *vb, void *data, size_t len)
pst_vb_8bit2utf8
size_t pst_vb_8bit2utf8(pst_vbuf *dest, const char *inbuf, int iblen, const char *charset)
pst_varbuf::dlen
size_t dlen
Definition: vbuf.h:10
pst_varbuf
Definition: vbuf.h:9
pst_vbappend
void pst_vbappend(pst_vbuf *vb, void *data, size_t length)
pst_unicode_init
void pst_unicode_init()
pst_vballoc
pst_vbuf * pst_vballoc(size_t len)
pst_varbuf::b
char * b
Definition: vbuf.h:13
pst_varbuf::buf
char * buf
Definition: vbuf.h:12
pst_varbuf::blen
size_t blen
Definition: vbuf.h:11
common.h
pst_vbgrow
void pst_vbgrow(pst_vbuf *vb, size_t len)