/Users/maurits/Documents/studie/afstuderen/biosphere/common/io.c File Reference

#include "io.h"
#include <apr_file_io.h>
#include <apr_strings.h>
#include <string.h>

Include dependency graph for io.c:

Go to the source code of this file.

Functions

bs_status read_file_into_buf (const char *fname, char **buf, bs_uint64 *len, apr_pool_t *mp)
bs_status write_buf_into_file (const char *fname, const char *buf, apr_pool_t *mp)


Function Documentation

bs_status read_file_into_buf ( const char *  fname,
char **  buf,
bs_uint64 len,
apr_pool_t *  mp 
)

Read the file given by the path into the given buffer. This function will allocate the buffer from the given pool.

Parameters:
The file (including path) to read.
buf A result pointer to the buffer with the file's contents.
len The length of the buffers contents.
mp Memory pool to allocate from
Returns:
Status code.

Definition at line 42 of file io.c.

References BS_ERROR, BS_OK, and runtestsuite::rv.

Referenced by bsmod_password_init(), init_service(), make_answer(), and set_definitions().

bs_status write_buf_into_file ( const char *  fname,
const char *  buf,
apr_pool_t *  mp 
)

Write the contents of the given buffer into the named file. The file's previous contents will be overwritten.

Parameters:
fname The name of the file (or path)
buf The buffer to write
mp The memory pool to use
Returns:
Status code

Definition at line 73 of file io.c.

References BS_ERROR, BS_OK, and runtestsuite::rv.

Referenced by bsmod_password_cleanup().


Generated on Tue Jul 17 09:50:57 2007 for Bio-SPHERE by  doxygen 1.5.1