summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMichael Brown2005-05-19 20:32:04 +0200
committerMichael Brown2005-05-19 20:32:04 +0200
commit2ddbac101e82e1ca1601abd623840c9628074523 (patch)
treef286f4e9317bf356927d21b38419722c99d08b70 /src/core
parentSync from 5.4 branch (diff)
downloadipxe-2ddbac101e82e1ca1601abd623840c9628074523.tar.gz
ipxe-2ddbac101e82e1ca1601abd623840c9628074523.tar.xz
ipxe-2ddbac101e82e1ca1601abd623840c9628074523.zip
Move API docs to buffer.h, implementation to buffer.c.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/buffer.c56
1 files changed, 2 insertions, 54 deletions
diff --git a/src/core/buffer.c b/src/core/buffer.c
index 6e05b0882..f99fba280 100644
--- a/src/core/buffer.c
+++ b/src/core/buffer.c
@@ -1,59 +1,7 @@
+
/** @file
*
- * Buffers for loading files.
- *
- * This file provides routines for filling a buffer with data received
- * piecemeal, where the size of the data is not necessarily known in
- * advance.
- *
- * Some protocols do not provide a mechanism for us to know the size
- * of the file before we happen to receive a particular block
- * (e.g. the final block in an MTFTP transfer). In addition, some
- * protocols (all the multicast protocols plus any TCP-based protocol)
- * can, in theory, provide the data in any order.
- *
- * Rather than requiring each protocol to implement its own equivalent
- * of "dd" to arrange the data into well-sized pieces before handing
- * off to the image loader, we provide these generic buffer functions
- * which assemble a file into a single contiguous block. The whole
- * block is then passed to the image loader.
- *
- * Example usage:
- *
- * @code
- *
- * struct buffer my_buffer;
- * void *data;
- * off_t offset;
- * size_t len;
- *
- * // We have an area of memory [buf_start,buf_end) into which we want
- * // to load a file, where buf_start and buf_end are physical addresses.
- * buffer->start = buf_start;
- * buffer->end = buf_end;
- * init_buffer ( &buffer );
- * ...
- * while ( get_file_block ( ... ) ) {
- * // Downloaded block is stored in [data,data+len), and represents
- * // the portion of the file at offsets [offset,offset+len)
- * if ( ! fill_buffer ( &buffer, data, offset, len ) ) {
- * // An error occurred
- * return 0;
- * }
- * ...
- * }
- * ...
- * // The whole file is now present at [buf_start,buf_start+filesize),
- * // where buf_start is a physical address. The struct buffer can simply
- * // be discarded; there is no done_buffer() call.
- *
- * @endcode
- *
- * For a description of the internal operation, see \ref buffer_int.
- *
- */
-
-/** @page buffer_int Buffer internals
+ * Buffer internals.
*
* A buffer consists of a single, contiguous area of memory, some of
* which is "filled" and the remainder of which is "free". The