|
Qsmtp
0.30dev
|
headers of Base64 encode and decode functions More...
#include "sstring.h"Go to the source code of this file.
Functions | |
| int | b64decode (const char *in, size_t l, string *out) |
| int | b64encode (const string *in, string *out, const unsigned int wraplimit) |
headers of Base64 encode and decode functions
| int b64decode | ( | const char * | in, |
| size_t | l, | ||
| string * | out | ||
| ) |
decode base64 string to plain text
| in | base64 text |
| l | length of in |
| out | string to store decoded string (memory will be malloced) |
| <0 | negative error code |
| 0 | on success |
| 1 | on parse error |
The contents of out are undefined as long as something else than 0 is returned, i.e. the memory is freed but the freed pointer may still be recorded in out.
A final 0-byte will always be added to out->s, which is not counted in out->len.
encode plain text string to Base64
| in | plain text string |
| out | string to store Base64 string (memory will be malloced) |
| wraplimit | the number of characters after which a CRLF pair should be inserted |
| 0 | on success |
| <0 | negative error code |
1.8.10