comparison src/libstrfunc.c @ 257:c947b8812120

rfc2047 and rfc2231 encoding for non-ascii headers and attachment filenames
author Carl Byington <carl@five-ten-sg.com>
date Fri, 24 Dec 2010 19:26:05 -0800
parents 6954d315aaa8
children
comparison
equal deleted inserted replaced
256:a863de65e5b8 257:c947b8812120
12 if (*line_count == 76) { 12 if (*line_count == 76) {
13 *(*ou)++ = '\n'; 13 *(*ou)++ = '\n';
14 *line_count = 0; 14 *line_count = 0;
15 } 15 }
16 *(*ou)++ = data; 16 *(*ou)++ = data;
17 (*line_count)++; 17 if (*line_count >= 0) (*line_count)++;
18 } 18 }
19 19
20 20
21 char *pst_base64_encode(void *data, size_t size) 21 char *pst_base64_encode(void *data, size_t size)
22 { 22 {
23 int line_count = 0; 23 int line_count = 0;
24 return pst_base64_encode_multiple(data, size, &line_count);
25 }
26
27
28 char *pst_base64_encode_single(void *data, size_t size)
29 {
30 int line_count = -1;
24 return pst_base64_encode_multiple(data, size, &line_count); 31 return pst_base64_encode_multiple(data, size, &line_count);
25 } 32 }
26 33
27 34
28 char *pst_base64_encode_multiple(void *data, size_t size, int *line_count) 35 char *pst_base64_encode_multiple(void *data, size_t size, int *line_count)