NAME
io_ctx_memio - io_ctx for in-core memory
SYNOPSIS
#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;
DESCRIPTION
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.

RETURN VALUES
On success, 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.

SEE ALSO
io_ctx, io_ctx_stdio
BUGS
This document describes a beta implementation. The information contained in this document may be incomplete and is subject to change.

Copyright © 1996, 1997, Visa International Service Association and MasterCard International Incorporated
All Rights Reserved.