9 #ifndef __AFW_MEMORY_H__
10 #define __AFW_MEMORY_H__
39 #define afw_memory_copy(to, from) \
40 memcpy((to), (from), sizeof(*(to)))
47 #define afw_memory_clear(to) \
48 memset((to), 0, sizeof(*(to)))
87 AFW_DEFINE_STATIC_INLINE(
void *)
93 if (size == 0)
return NULL;
95 memcpy(result, from, size);
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Adaptive Framework Minimal Header.
unsigned char afw_byte_t
A byte of memory (unsigned).
apr_size_t afw_size_t
size_t.
afw_size_t(* afw_write_cb_t)(void *context, const void *buffer, afw_size_t size, const afw_pool_t *p, afw_xctx_t *xctx)
Typedef for write callback function.
void afw_memory_decode_base64(afw_memory_t *memory, const afw_utf8_t *encoded, const afw_pool_t *p, afw_xctx_t *xctx)
Decode memory to a base64 string.
afw_size_t afw_memory_writer_retrieve_using_callback_and_release(const afw_memory_writer_t *writer, void *context, afw_write_cb_t callback, afw_xctx_t *xctx)
Retrieve memory as using callback.
void afw_memory_encode_printable_hex(afw_utf8_t *encoded, const afw_memory_t *memory, const afw_pool_t *p, afw_xctx_t *xctx)
Encode memory to a printable hex string.
afw_size_t afw_memory_writer_get_current_size(const afw_memory_writer_t *writer, afw_xctx_t *xctx)
Retrieve memory as one chunk from memory writer and release writer.
const afw_memory_t * afw_memory_writer_retrieve_and_release(const afw_memory_writer_t *writer, afw_xctx_t *xctx)
Retrieve memory as one chunk from memory writer and release writer.
void afw_memory_encode_base64(afw_utf8_t *encoded, const afw_memory_t *memory, const afw_pool_t *p, afw_xctx_t *xctx)
Encode memory to as base64 string.
const afw_memory_writer_t * afw_memory_create_writer(const afw_pool_t *p, afw_xctx_t *xctx)
Create a memory writer.
const afw_memory_t * afw_memory_create(const afw_byte_t *ptr, afw_size_t size, const afw_pool_t *p, afw_xctx_t *xctx)
Create a afw_memory_t struct for a ptr and size.
void afw_memory_decode_printable_hex(afw_memory_t *memory, const afw_utf8_t *encoded, const afw_pool_t *p, afw_xctx_t *xctx)
Decode memory to a printable hex string.
void * afw_memory_dup(const void *from, apr_size_t size, const afw_pool_t *p, afw_xctx_t *xctx)
Duplicate a block of memory into specified pool.
#define afw_pool_malloc(instance, size, xctx)
Call method malloc of interface afw_pool.
#define afw_pool_malloc_type(instance, type, xctx)
Macro to allocate uncleared memory to hold type in pool.
Struct for memory pointer and size.
Return value from afw_memory_create_writer().
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Interface afw_xctx public struct.