CUBRID Engine
latest
|
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <stdlib.h>
#include <stddef.h>
#include <assert.h>
#include "porting.h"
#include "error_code.h"
#include "memory_alloc.h"
#include "base64.h"
Go to the source code of this file.
Classes | |
struct | base64_chunk |
Macros | |
#define | MAX_BASE64_LINE_LENGTH 76 |
#define | CH_INVALID -1 |
#define | CH_SPACE -2 |
Typedefs | |
typedef struct base64_chunk | BASE64_CHUNK |
Functions | |
static bool | char_is_invalid (unsigned char ch) |
static bool | char_is_padding (unsigned char ch) |
static int | get_base64_encode_len (int src_len) |
static int | base64_encode_local (const unsigned char *src, int src_len, unsigned char *dest) |
static int | base64_remove_space (const unsigned char *src, int src_len, unsigned char *dest, int *dst_len) |
static int | base64_partition_into_chunk (const unsigned char *src, int src_len, int *chunk_num, int *dst_len, BASE64_CHUNK ***pppchunk) |
static int | base64_decode_chunk (unsigned char *dest, int chunk_num, BASE64_CHUNK **ppchunk) |
static void | free_base64_chunk (BASE64_CHUNK **ppchunk, int chunk_num) |
static int | find_base64 (unsigned char ch) |
int | base64_decode (const unsigned char *src, int src_len, unsigned char **dest, int *dest_len) |
int | base64_encode (const unsigned char *src, int src_len, unsigned char **dest, int *dest_len) |
Variables | |
const char * | base64_map = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/" |
const char | from_base64_table [] |
#define CH_INVALID -1 |
Definition at line 42 of file base64.c.
Referenced by char_is_invalid().
#define CH_SPACE -2 |
Definition at line 43 of file base64.c.
Referenced by base64_remove_space().
#define MAX_BASE64_LINE_LENGTH 76 |
Definition at line 41 of file base64.c.
Referenced by base64_encode_local(), and get_base64_encode_len().
typedef struct base64_chunk BASE64_CHUNK |
int base64_decode | ( | const unsigned char * | src, |
int | src_len, | ||
unsigned char ** | dest, | ||
int * | dest_len | ||
) |
Definition at line 387 of file base64.c.
References assert, base64_decode_chunk(), BASE64_EMPTY_INPUT, base64_partition_into_chunk(), base64_remove_space(), db_private_alloc, db_private_free_and_init, ER_OUT_OF_VIRTUAL_MEMORY, free_base64_chunk(), NO_ERROR, and NULL.
Referenced by db_string_from_base64().
|
static |
Definition at line 337 of file base64.c.
References assert, base64_chunk::base64_bytes, i, NO_ERROR, NULL, and base64_chunk::padding_len.
Referenced by base64_decode().
int base64_encode | ( | const unsigned char * | src, |
int | src_len, | ||
unsigned char ** | dest, | ||
int * | dest_len | ||
) |
Definition at line 502 of file base64.c.
References assert, base64_encode_local(), db_private_alloc, db_private_free_and_init, ER_OUT_OF_VIRTUAL_MEMORY, get_base64_encode_len(), NO_ERROR, and NULL.
Referenced by db_string_to_base64().
|
static |
Definition at line 556 of file base64.c.
References assert, base64_map, i, MAX_BASE64_LINE_LENGTH, NO_ERROR, NULL, and p.
Referenced by base64_encode().
|
static |
Definition at line 152 of file base64.c.
References assert, base64_chunk::base64_bytes, BASE64_INVALID_INPUT, char_is_invalid(), char_is_padding(), d1, db_private_alloc, ER_OUT_OF_VIRTUAL_MEMORY, err, find_base64(), free_base64_chunk(), i, NO_ERROR, NULL, and base64_chunk::padding_len.
Referenced by base64_decode().
|
static |
Definition at line 293 of file base64.c.
References assert, CH_SPACE, from_base64_table, i, NO_ERROR, and NULL.
Referenced by base64_decode().
|
static |
Definition at line 104 of file base64.c.
References CH_INVALID, and from_base64_table.
Referenced by base64_partition_into_chunk().
|
static |
Definition at line 115 of file base64.c.
Referenced by base64_partition_into_chunk().
|
static |
Definition at line 126 of file base64.c.
References assert, base64_map, CAST_STRLEN, and NULL.
Referenced by base64_partition_into_chunk().
|
static |
Definition at line 613 of file base64.c.
References db_private_free, i, and NULL.
Referenced by base64_decode(), and base64_partition_into_chunk().
|
static |
Definition at line 472 of file base64.c.
References assert, and MAX_BASE64_LINE_LENGTH.
Referenced by base64_encode().
const char* base64_map = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/" |
Definition at line 56 of file base64.c.
Referenced by base64_encode_local(), and find_base64().
const char from_base64_table[] |
Definition at line 64 of file base64.c.
Referenced by base64_remove_space(), and char_is_invalid().