lwres_buffer.html revision 8a66318e41ed14c5a88130e8c362610e8faa2121
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi - Copyright (C) 2001 Internet Software Consortium.
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi - Permission to use, copy, modify, and distribute this software for any
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi - purpose with or without fee is hereby granted, provided that the above
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi - copyright notice and this permission notice appear in all copies.
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi - PERFORMANCE OF THIS SOFTWARE.
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi<!-- $Id: lwres_buffer.html,v 1.5 2004/03/05 08:32:19 marka Exp $ -->
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>lwres_buffer</TITLE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiNAME="GENERATOR"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCONTENT="Modular DocBook HTML Stylesheet Version 1.73
faefa7f8584a7d1567df2e6f1f9240a28a6466abStéphane GraberCLASS="REFENTRY"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiBGCOLOR="#FFFFFF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiTEXT="#000000"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiLINK="#0000FF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiVLINK="#840084"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiALINK="#0000FF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>lwres_buffer</A
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="REFNAMEDIV"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>lwres_buffer_init, lwres_buffer_invalidate, lwres_buffer_add, lwres_buffer_subtract, lwres_buffer_clear, lwres_buffer_first, lwres_buffer_forward, lwres_buffer_back, lwres_buffer_getuint8, lwres_buffer_putuint8, lwres_buffer_getuint16, lwres_buffer_putuint16, lwres_buffer_getuint32, lwres_buffer_putuint32, lwres_buffer_putmem, lwres_buffer_getmem -- lightweight resolver buffer management</DIV
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="REFSYNOPSISDIV"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCSYNOPSIS"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCSYNOPSISINFO"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_init</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b, void *base, unsigned int length);</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_invalidate</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b);</CODE
dc421f3aac1f0e516c763dd156629a8ed2a7b4caKATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_add</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b, unsigned int n);</CODE
dc421f3aac1f0e516c763dd156629a8ed2a7b4caKATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_subtract</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b, unsigned int n);</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_clear</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b);</CODE
dc421f3aac1f0e516c763dd156629a8ed2a7b4caKATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_first</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b);</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_forward</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b, unsigned int n);</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_back</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b, unsigned int n);</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCDEF"
dc421f3aac1f0e516c763dd156629a8ed2a7b4caKATOH Yasufumi>lwres_uint8_t
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_getuint8</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b);</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_putuint8</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b, lwres_uint8_t val);</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>lwres_uint16_t
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_getuint16</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b);</CODE
dc421f3aac1f0e516c763dd156629a8ed2a7b4caKATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_putuint16</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b, lwres_uint16_t val);</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>lwres_uint32_t
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_getuint32</CODE
a5ba96715d4ef264c43d4f187251de491ba198c0KATOH Yasufumi>(lwres_buffer_t *b);</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCDEF"
a5ba96715d4ef264c43d4f187251de491ba198c0KATOH Yasufumilwres_buffer_putuint32</CODE
a5ba96715d4ef264c43d4f187251de491ba198c0KATOH Yasufumi>(lwres_buffer_t *b, lwres_uint32_t val);</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_putmem</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b, const unsigned char *base, unsigned int length);</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="FUNCDEF"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilwres_buffer_getmem</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>(lwres_buffer_t *b, unsigned char *base, unsigned int length);</CODE
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="REFSECT1"
dc421f3aac1f0e516c763dd156629a8ed2a7b4caKATOH Yasufumi>DESCRIPTION</H2
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>These functions provide bounds checked access to a region of memory
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumiwhere data is being read or written.
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiThey are based on, and similar to, the
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="LITERAL"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>isc_buffer_</TT
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumifunctions in the ISC library.</P
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>A buffer is a region of memory, together with a set of related
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="emphasis"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="EMPHASIS"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi>used region</I
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="emphasis"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiCLASS="EMPHASIS"
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi> region are disjoint, and
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumitheir union is the buffer's region.
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiThe used region extends from the beginning of the buffer region to the
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumilast used byte.
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiThe available region extends from one byte greater than the last used
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumibyte to the end of the buffer's region.
57da8c32f85c0255efa61ee32e260068afdaa565KATOH YasufumiThe size of the used region can be changed using various
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumibuffer commands.