#include <io_ctx.h> #include <io_ctx_memio.h> int create_memio_ctx(ctxp, initial_size) io_ctx *ctxp; UINT4 initial_size; int create_bound_static_memio_ctx(ctxp, buffer, size) io_ctx *ctxp; UCHAR *buffer; UINT4 size;
io_ctx_memio
maps the io_ctx
abstraction onto memory-handling routines. An io_ctx
created by create_memio_ctx()
allocates its own memory, and grows to
accommodate arbitrarily large writes. initial_size
is a hint, suggesting the maximum amount of
data that will be written to the io_ctx
.
An io_ctx
created by create_bound_static_memio_ctx()
uses caller-supplied memory that
will not grow. size
must be no larger than the length of buffer
. Attempts to write past the end of
this static memory will result in an end-of-file (EOF) error.
See io_ctx for information on using the io_ctx
abstraction.
create_memio_ctx()
and create_bound_static_memio_ctx()
return NO_ERROR
.
On failure, they return IO_CTX_ERR_BAD_PARAMETER
or IO_CTX_ERR_MEMORY
. See Return Values for descriptions of individual error codes. For documentation on displaying or logging return values, see error_ctx.
Copyright © 1996, 1997, Visa International Service Association and MasterCard International Incorporated
All Rights Reserved.