33 #include "asterisk/module.h"
101 buf[decoded_len <= (len - 1) ? decoded_len : len - 1] =
'\0';
111 ast_str_buffer(*str)[decoded_len <= (len - 1) ? decoded_len : len - 1] =
'\0';
124 char *buf,
size_t len)
136 .
name =
"BASE64_ENCODE",
142 .
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.
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.
int ast_base64decode(unsigned char *dst, const char *src, int max)
Decode data from base64.
int ast_str_make_space(struct ast_str **buf, size_t new_len)
static force_inline int attribute_pure ast_strlen_zero(const char *s)
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)
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
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)
static struct ast_custom_function base64_encode_function
#define ast_custom_function_register(acf)
Register a custom function.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.