|
file | afw_memory.h |
| Header file for Adaptive Framework Memory.
|
|
|
#define | afw_memory_copy(to, from) memcpy((to), (from), sizeof(*(to))) |
| Copy to preallocated memory of same type. More...
|
|
#define | afw_memory_clear(to) memset((to), 0, sizeof(*(to))) |
| Clear preallocated memory for sizeof(*(to)). More...
|
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
const afw_memory_writer_t * | afw_memory_create_writer (const afw_pool_t *p, afw_xctx_t *xctx) |
| Create a memory writer. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
Adaptive framework memory support functions.
◆ afw_memory_clear
#define afw_memory_clear |
( |
|
to | ) |
memset((to), 0, sizeof(*(to))) |
Clear preallocated memory for sizeof(*(to)).
- Parameters
-
Definition at line 47 of file afw_memory.h.
◆ afw_memory_copy
#define afw_memory_copy |
( |
|
to, |
|
|
|
from |
|
) |
| memcpy((to), (from), sizeof(*(to))) |
Copy to preallocated memory of same type.
- Parameters
-
The size of the type of the variable pointed to by the to parameter is used for the size used by memcpy().
Definition at line 39 of file afw_memory.h.
◆ afw_memory_create()
Create a afw_memory_t struct for a ptr and size.
- Parameters
-
ptr. | |
size | |
p | to use. |
xctx | of caller. |
- Returns
- Pointer to afw_memory_t.
Definition at line 61 of file afw_memory.h.
◆ afw_memory_create_writer()
Create a memory writer.
- Parameters
-
- Returns
- memory writer instance.
Definition at line 377 of file afw_memory.c.
◆ afw_memory_decode_base64()
Decode memory to a base64 string.
- Parameters
-
memory | is a afw_memory_t that will be updated with result. |
encoded | is a base64 encoded string to decode. |
p | to use. |
xctx | of caller. |
Definition at line 223 of file afw_memory.c.
◆ afw_memory_decode_printable_hex()
Decode memory to a printable hex string.
- Parameters
-
memory | is a afw_memory_t that will be updated with result. |
encoded | is a printable hex encoded string to decode. |
p | to use. |
xctx | of caller. |
Definition at line 337 of file afw_memory.c.
◆ afw_memory_dup()
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.
- Parameters
-
from | From address. |
size | Size of memory to duplicate. |
p | Pool to use. |
xctx | of caller. |
- Returns
- Pointer to memory allocated or NULL is size is 0.
The default pool from xctx will be used.
Definition at line 88 of file afw_memory.h.
◆ afw_memory_encode_base64()
Encode memory to as base64 string.
- Parameters
-
encode | is a afw_utf8_t that will be updated with result. |
memory | to encode. |
p | to use. |
xctx | of caller. |
Definition at line 185 of file afw_memory.c.
◆ afw_memory_encode_printable_hex()
Encode memory to a printable hex string.
- Parameters
-
encode | is a afw_utf8_t that will be updated with result. |
memory | to encode. |
p | to use. |
xctx | of caller. |
Definition at line 310 of file afw_memory.c.
◆ afw_memory_writer_get_current_size()
Retrieve memory as one chunk from memory writer and release writer.
- Parameters
-
writer | instance of memory writer. |
xctx | of caller. |
- Returns
- current total number of octets in buffer.
Definition at line 401 of file afw_memory.c.
◆ afw_memory_writer_retrieve_and_release()
Retrieve memory as one chunk from memory writer and release writer.
- Parameters
-
writer | instance of memory writer. |
xctx | of caller. |
- Returns
- memory in pool specified on afw_memory_create_writer().
Definition at line 441 of file afw_memory.c.
◆ afw_memory_writer_retrieve_using_callback_and_release()
Retrieve memory as using callback.
- Parameters
-
writer | instance of memory writer. |
context | to pass to callback. |
callback | to call. |
xctx | of caller. |
- Returns
- total number of octets written to callback.
Definition at line 418 of file afw_memory.c.