Mercurial > libpst
annotate src/vbuf.h @ 331:c5e7f13d2836
.msg files should use only one of short or long filename fields
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Thu, 25 Jul 2013 11:12:57 -0700 |
parents | b65e8d0a088a |
children |
rev | line source |
---|---|
43 | 1 |
182
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
2 #ifndef __PST_VBUF_H |
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
3 #define __PST_VBUF_H |
132
5e4d6faada34
fix from Fridrich Strba for parallel make
Carl Byington <carl@five-ten-sg.com>
parents:
130
diff
changeset
|
4 |
5e4d6faada34
fix from Fridrich Strba for parallel make
Carl Byington <carl@five-ten-sg.com>
parents:
130
diff
changeset
|
5 #include "common.h" |
5e4d6faada34
fix from Fridrich Strba for parallel make
Carl Byington <carl@five-ten-sg.com>
parents:
130
diff
changeset
|
6 |
43 | 7 |
70
b12f4e50e2e8
Patch from Joachim Metz <joachim.metz@gmail.com> for 64 bit compile.
Carl Byington <carl@five-ten-sg.com>
parents:
43
diff
changeset
|
8 // Variable-length buffers |
182
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
9 struct pst_varbuf { |
43 | 10 size_t dlen; //length of data stored in buffer |
11 size_t blen; //length of buffer | |
70
b12f4e50e2e8
Patch from Joachim Metz <joachim.metz@gmail.com> for 64 bit compile.
Carl Byington <carl@five-ten-sg.com>
parents:
43
diff
changeset
|
12 char *buf; //buffer |
b12f4e50e2e8
Patch from Joachim Metz <joachim.metz@gmail.com> for 64 bit compile.
Carl Byington <carl@five-ten-sg.com>
parents:
43
diff
changeset
|
13 char *b; //start of stored data |
b12f4e50e2e8
Patch from Joachim Metz <joachim.metz@gmail.com> for 64 bit compile.
Carl Byington <carl@five-ten-sg.com>
parents:
43
diff
changeset
|
14 }; |
43 | 15 |
16 | |
182
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
17 typedef struct pst_varbuf pst_vbuf; |
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
18 |
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
19 pst_vbuf *pst_vballoc(size_t len); |
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
20 void pst_vbgrow(pst_vbuf *vb, size_t len); // grow buffer by len bytes, data are preserved |
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
21 void pst_vbset(pst_vbuf *vb, void *data, size_t len); |
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
22 void pst_vbappend(pst_vbuf *vb, void *data, size_t length); |
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
23 void pst_unicode_init(); |
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
24 size_t pst_vb_utf16to8(pst_vbuf *dest, const char *inbuf, int iblen); |
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
25 size_t pst_vb_utf8to8bit(pst_vbuf *dest, const char *inbuf, int iblen, const char* charset); |
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
26 size_t pst_vb_8bit2utf8(pst_vbuf *dest, const char *inbuf, int iblen, const char* charset); |
43 | 27 |
28 | |
182
b65e8d0a088a
more cleanup on external names in the shared object file
Carl Byington <carl@five-ten-sg.com>
parents:
176
diff
changeset
|
29 #endif |