Conversion to/from base64 encoding. More...
#include <stdio.h>
Include dependency graph for base64.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | base64val(ch) Index64[(unsigned int) (ch)] |
Functions | |
| int | mutt_b64_decode (const char *in, char *out, size_t olen) |
| Convert NUL-terminated base64 string to raw bytes. | |
| size_t | mutt_b64_encode (const char *in, size_t inlen, char *out, size_t outlen) |
| Convert raw bytes to NUL-terminated base64 string. | |
| int | mutt_b64_buffer_decode (struct Buffer *buf, const char *in) |
| Convert NUL-terminated base64 string to raw bytes. | |
| size_t | mutt_b64_buffer_encode (struct Buffer *buf, const char *in, size_t len) |
| Convert raw bytes to NUL-terminated base64 string. | |
Variables | |
| const int | Index64 [] |
| Lookup table for Base64 encoding characters. | |
Conversion to/from base64 encoding.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file base64.h.
| int mutt_b64_decode | ( | const char * | in, |
| char * | out, | ||
| size_t | olen | ||
| ) |
Convert NUL-terminated base64 string to raw bytes.
| in | Input buffer for the NUL-terminated base64-encoded string |
| out | Output buffer for the raw bytes |
| olen | Length of the output buffer |
| num | Success, bytes written |
| -1 | Error |
This function performs base64 decoding. The resulting buffer is NOT NUL-terminated. If the input buffer contains invalid base64 characters, this function returns -1.
Definition at line 135 of file base64.c.
Here is the caller graph for this function:| size_t mutt_b64_encode | ( | const char * | in, |
| size_t | inlen, | ||
| char * | out, | ||
| size_t | outlen | ||
| ) |
Convert raw bytes to NUL-terminated base64 string.
| in | Input buffer for the raw bytes |
| inlen | Length of the input buffer |
| out | Output buffer for the base64 encoded string |
| outlen | Length of the output buffer |
| num | Length of the string written to the output buffer |
This function performs base64 encoding. The resulting string is guaranteed to be NUL-terminated. The number of characters up to the terminating NUL-byte is returned (equivalent to calling strlen() on the output buffer after this function returns).
Definition at line 87 of file base64.c.
Here is the caller graph for this function:| int mutt_b64_buffer_decode | ( | struct Buffer * | buf, |
| const char * | in | ||
| ) |
Convert NUL-terminated base64 string to raw bytes.
| buf | Buffer for the result |
| in | Input buffer for the NUL-terminated base64-encoded string |
| num | Success, bytes written |
| -1 | Error |
Definition at line 216 of file base64.c.
Here is the call graph for this function:
Here is the caller graph for this function:| size_t mutt_b64_buffer_encode | ( | struct Buffer * | buf, |
| const char * | in, | ||
| size_t | len | ||
| ) |
Convert raw bytes to NUL-terminated base64 string.
| buf | Buffer for the result |
| in | Input buffer for the raw bytes |
| len | Length of the input buffer |
| num | Length of the string written to the output buffer |
Definition at line 198 of file base64.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
extern |
Lookup table for Base64 encoding characters.
Encoding chars: