BRL-CAD
#include "common.h"
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "bu/cv.h"
#include "bu/malloc.h"
Include dependency graph for b64.c:

Go to the source code of this file.

Data Structures

struct  bu_b64_encodestate
 
struct  bu_b64_decodestate
 

Enumerations

enum  bu_b64_encodestep { step_A, step_B, step_C }
 
enum  bu_b64_decodestep { step_a, step_b, step_c, step_d }
 

Functions

HIDDEN void bu_b64_init_encodestate (bu_b64_encodestate *state_in)
 
HIDDEN signed char bu_b64_encode_value (signed char value_in)
 
HIDDEN int bu_b64_encode_block_internal (const signed char *plaintext_in, size_t length_in, signed char *code_out, bu_b64_encodestate *state_in)
 
HIDDEN int bu_b64_encode_blockend (signed char *code_out, bu_b64_encodestate *state_in)
 
HIDDEN int bu_b64_decode_value (signed char value_in)
 
HIDDEN void bu_b64_init_decodestate (bu_b64_decodestate *state_in)
 
HIDDEN int bu_b64_decode_block_internal (const signed char *code_in, const size_t length_in, signed char *plaintext_out, bu_b64_decodestate *state_in)
 
signed char * bu_b64_encode_block (const signed char *input, size_t len)
 
signed char * bu_b64_encode (const signed char *input)
 
int bu_b64_decode_block (signed char **output, const signed char *input, size_t len)
 
int bu_b64_decode (signed char **output, const signed char *input)
 

Variables

const int CHARS_PER_LINE = 72
 

Detailed Description

A base64 encoding algorithm For details, see http://sourceforge.net/projects/libb64

Caller is responsible for freeing memory allocated to hold output buffer.

Definition in file b64.c.

Enumeration Type Documentation

Enumerator
step_A 
step_B 
step_C 

Definition at line 18 of file b64.c.

Enumerator
step_a 
step_b 
step_c 
step_d 

Definition at line 22 of file b64.c.

Function Documentation

HIDDEN void bu_b64_init_encodestate ( bu_b64_encodestate state_in)
HIDDEN signed char bu_b64_encode_value ( signed char  value_in)

Definition at line 49 of file b64.c.

Referenced by bu_b64_encode_block_internal(), and bu_b64_encode_blockend().

HIDDEN int bu_b64_encode_block_internal ( const signed char *  plaintext_in,
size_t  length_in,
signed char *  code_out,
bu_b64_encodestate state_in 
)

Definition at line 57 of file b64.c.

References bu_b64_encode_value(), CHARS_PER_LINE, bu_b64_encodestate::result, bu_b64_encodestate::step, step_A, step_B, step_C, and bu_b64_encodestate::stepcount.

Referenced by bu_b64_encode_block().

Here is the call graph for this function:

HIDDEN int bu_b64_encode_blockend ( signed char *  code_out,
bu_b64_encodestate state_in 
)

Definition at line 113 of file b64.c.

References bu_b64_encode_value(), bu_b64_encodestate::result, bu_b64_encodestate::step, step_A, step_B, and step_C.

Referenced by bu_b64_encode_block().

Here is the call graph for this function:

HIDDEN int bu_b64_decode_value ( signed char  value_in)

Definition at line 136 of file b64.c.

Referenced by bu_b64_decode_block_internal().

HIDDEN void bu_b64_init_decodestate ( bu_b64_decodestate state_in)

Definition at line 146 of file b64.c.

References bu_b64_decodestate::plainchar, bu_b64_decodestate::step, and step_a.

Referenced by bu_b64_decode_block().

HIDDEN int bu_b64_decode_block_internal ( const signed char *  code_in,
const size_t  length_in,
signed char *  plaintext_out,
bu_b64_decodestate state_in 
)

Definition at line 153 of file b64.c.

References bu_b64_decode_value(), bu_b64_decodestate::plainchar, bu_b64_decodestate::step, step_a, step_b, step_c, and step_d.

Referenced by bu_b64_decode_block().

Here is the call graph for this function:

Variable Documentation

const int CHARS_PER_LINE = 72

Definition at line 38 of file b64.c.

Referenced by bu_b64_encode_block_internal().