Use the base64 as functions.
Definition in file func_base64.c.
| static int base64_helper |
( |
struct ast_channel * |
chan, |
|
|
const char * |
cmd, |
|
|
char * |
data, |
|
|
char * |
buf, |
|
|
struct ast_str ** |
str, |
|
|
ssize_t |
len |
|
) |
| |
|
static |
Definition at line 81 of file func_base64.c.
83{
86 return -1;
87 }
88
89 if (cmd[7] == 'E') {
92 } else {
94
95
96 size_t bytes_needed_to_encode_data = ((strlen(data) * 4 / 3 + 3) & ~3) + 1;
98 }
101 }
102 } else {
103 int decoded_len;
106
107
108 buf[decoded_len <= (
len - 1) ? decoded_len :
len - 1] =
'\0';
109 } else {
112 }
115
116
117
119 else
120
122
124 }
125 }
126
127 return 0;
128}
size_t attribute_pure ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_make_space(buf, new_len)
void ast_str_update(struct ast_str *buf)
Update the length of the buffer, after using ast_str merely as a buffer.
char *attribute_pure ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
size_t attribute_pure ast_str_size(const struct ast_str *buf)
Returns the current maximum length (without reallocation) of the current buffer.
int ast_base64decode(unsigned char *dst, const char *src, int max)
Decode data from base64.
int ast_base64encode(char *dst, const unsigned char *src, int srclen, int max)
Encode data in base64.
References ast_base64decode(), ast_base64encode(), ast_log, ast_str_buffer(), ast_str_make_space, ast_str_size(), ast_str_strlen(), ast_str_update(), ast_strlen_zero(), buf, len(), LOG_WARNING, and str.
Referenced by base64_buf_helper(), and base64_str_helper().