99 buf[decoded_len <= (len - 1) ? decoded_len : len - 1] =
'\0';
109 ast_str_buffer(*str)[decoded_len <= (len - 1) ? decoded_len : len - 1] =
'\0';
134 .
name =
"BASE64_ENCODE",
140 .
name =
"BASE64_DECODE",
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
String manipulation functions.
static int load_module(void)
size_t ast_str_size(const struct ast_str *buf)
Returns the current maximum length (without reallocation) of the current buffer.
#define ast_str_make_space(buf, new_len)
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static int unload_module(void)
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
#define ast_strlen_zero(foo)
int ast_base64decode(unsigned char *dst, const char *src, int max)
Decode data from base64.
Data structure associated with a custom dialplan function.
Core PBX routines and definitions.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
int ast_base64encode(char *dst, const unsigned char *src, int srclen, int max)
Encode data in base64.
static int base64_helper(struct ast_channel *chan, const char *cmd, char *data, char *buf, struct ast_str **str, ssize_t len)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
void ast_str_update(struct ast_str *buf)
Update the length of the buffer, after using ast_str merely as a buffer.
static struct ast_custom_function base64_decode_function
static int base64_buf_helper(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
#define ASTERISK_GPL_KEY
The text the key() function should return.
static int base64_str_helper(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
Asterisk module definitions.
static struct ast_custom_function base64_encode_function
#define ast_custom_function_register(acf)
Register a custom function.