libcmime  
A lightweight C mime library
Functions
cmime_base64.h File Reference

Base64 functions. More...

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
Include dependency graph for cmime_base64.h:

Go to the source code of this file.

Functions

void cmime_base64_encode_block (unsigned char in[3], unsigned char out[4], int len)
 Encode 3byte block to base64. More...
 
void cmime_base64_decode_block (unsigned char in[4], unsigned char out[3])
 Decode 4 byte base64 block. More...
 
void cmime_base64_encode_file (FILE *infile, FILE *outfile, int linelen)
 Encode complete file to base64 and write to file pointer. More...
 
void cmime_base64_decode_file (FILE *infile, FILE *outfile)
 Decode complete file from base64 and write to file pointer. More...
 
char * cmime_base64_encode_string (const char *source)
 Encode string to base64. More...
 
char * cmime_base64_decode_string (const char *source)
 Decode base64 string. More...
 

Detailed Description

Base64 functions.

This header is intended for use by any library or application, not only libcmime.

Function Documentation

void cmime_base64_decode_block ( unsigned char  in[4],
unsigned char  out[3] 
)

Decode 4 byte base64 block.

Parameters
in4byte input
out3byte output
void cmime_base64_decode_file ( FILE *  infile,
FILE *  outfile 
)

Decode complete file from base64 and write to file pointer.

Parameters
infileinput file pointer
outfileoutput file pointer
char* cmime_base64_decode_string ( const char *  source)

Decode base64 string.

Parameters
sourcebase64 string to decode
Returns
newly allocated chart pointer with decoded string
void cmime_base64_encode_block ( unsigned char  in[3],
unsigned char  out[4],
int  len 
)

Encode 3byte block to base64.

Parameters
in3byte input
out4byte output
lennumber of charactes in input
void cmime_base64_encode_file ( FILE *  infile,
FILE *  outfile,
int  linelen 
)

Encode complete file to base64 and write to file pointer.

Parameters
infileinput file pointer
outfileoutput file pointer
linelenmaximum line length used when writing base64 to file
char* cmime_base64_encode_string ( const char *  source)

Encode string to base64.

Parameters
sourceString to encode
Returns
newly allocated char pointer with encoded string