⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lwres_buffer.3

📁 bind 9.3结合mysql数据库
💻 3
字号:
.\" Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC").\" Copyright (C) 2000, 2001  Internet Software Consortium..\".\" Permission to use, copy, modify, and distribute this software for any.\" purpose with or without fee is hereby granted, provided that the above.\" copyright notice and this permission notice appear in all copies..\".\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY.\" AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR.\" PERFORMANCE OF THIS SOFTWARE..\".\" $Id: lwres_buffer.3,v 1.12.2.1.8.1 2004/03/06 07:41:42 marka Exp $.\".TH "LWRES_BUFFER" "3" "Jun 30, 2000" "BIND9" "".SH NAMElwres_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.SH SYNOPSIS\fB#include <lwres/lwbuffer.h>.sp.navoidlwres_buffer_init(lwres_buffer_t *b, void *base, unsigned int length);.ad.sp.navoidlwres_buffer_invalidate(lwres_buffer_t *b);.ad.sp.navoidlwres_buffer_add(lwres_buffer_t *b, unsigned int n);.ad.sp.navoidlwres_buffer_subtract(lwres_buffer_t *b, unsigned int n);.ad.sp.navoidlwres_buffer_clear(lwres_buffer_t *b);.ad.sp.navoidlwres_buffer_first(lwres_buffer_t *b);.ad.sp.navoidlwres_buffer_forward(lwres_buffer_t *b, unsigned int n);.ad.sp.navoidlwres_buffer_back(lwres_buffer_t *b, unsigned int n);.ad.sp.nalwres_uint8_tlwres_buffer_getuint8(lwres_buffer_t *b);.ad.sp.navoidlwres_buffer_putuint8(lwres_buffer_t *b, lwres_uint8_t val);.ad.sp.nalwres_uint16_tlwres_buffer_getuint16(lwres_buffer_t *b);.ad.sp.navoidlwres_buffer_putuint16(lwres_buffer_t *b, lwres_uint16_t val);.ad.sp.nalwres_uint32_tlwres_buffer_getuint32(lwres_buffer_t *b);.ad.sp.navoidlwres_buffer_putuint32(lwres_buffer_t *b, lwres_uint32_t val);.ad.sp.navoidlwres_buffer_putmem(lwres_buffer_t *b, const unsigned char *base, unsigned int length);.ad.sp.navoidlwres_buffer_getmem(lwres_buffer_t *b, unsigned char *base, unsigned int length);.ad\fR.SH "DESCRIPTION".PPThese functions provide bounds checked access to a region of memorywhere data is being read or written.They are based on, and similar to, theisc_buffer_functions in the ISC library..PPA buffer is a region of memory, together with a set of relatedsubregions.The \fBused region\fR and the\fBavailable\fR region are disjoint, andtheir union is the buffer's region.The used region extends from the beginning of the buffer region to thelast used byte.The available region extends from one byte greater than the last usedbyte to the end of the buffer's region.The size of the used region can be changed using variousbuffer commands.Initially, the used region is empty..PPThe used region is further subdivided into two disjoint regions: the\fBconsumed region\fR and the \fBremaining region\fR.The union of these two regions is the used region.The consumed region extends from the beginning of the used region tothe byte before the \fBcurrent\fR offset (if any).The \fBremaining\fR region the current pointer to the end of the usedregion.The size of the consumed region can be changed using variousbuffer commands.Initially, the consumed region is empty..PPThe \fBactive region\fR is an (optional) subregion of the remainingregion.It extends from the current offset to an offset in theremaining region.Initially, the active region is empty.If the current offset advances beyond the chosen offset,the active region will also be empty..PP.sp.nf    /------------entire length---------------\\\\   /----- used region -----\\\\/-- available --\\\\   +----------------------------------------+   | consumed  | remaining |                |   +----------------------------------------+   a           b     c     d                e   a == base of buffer.  b == current pointer.  Can be anywhere between a and d.  c == active pointer.  Meaningful between b and d.  d == used pointer.  e == length of buffer.   a-e == entire length of buffer.  a-d == used region.  a-b == consumed region.  b-d == remaining region.  b-c == optional active region..sp.fi.PP\fBlwres_buffer_init()\fRinitializes the\fBlwres_buffer_t\fR\fI*b\fRand assocates it with the memory region of size\fIlength\fRbytes starting at location\fIbase.\fR.PP\fBlwres_buffer_invalidate()\fRmarks the buffer\fI*b\fRas invalid. Invalidating a buffer after use is not required,but makes it possible to catch its possible accidental use..PPThe functions\fBlwres_buffer_add()\fRand\fBlwres_buffer_subtract()\fRrespectively increase and decrease the used space inbuffer\fI*b\fRby\fIn\fRbytes.\fBlwres_buffer_add()\fRchecks for buffer overflow and\fBlwres_buffer_subtract()\fRchecks for underflow.These functions do not allocate or deallocate memory.They just change the value of\fBused\fR..PPA buffer is re-initialised by\fBlwres_buffer_clear()\fR.The function sets\fBused\fR ,\fBcurrent\fRand\fBactive\fRto zero..PP\fBlwres_buffer_first\fRmakes the consumed region of buffer\fI*p\fRempty by setting\fBcurrent\fRto zero (the start of the buffer)..PP\fBlwres_buffer_forward()\fRincreases the consumed region of buffer\fI*b\fRby\fIn\fRbytes, checking for overflow.Similarly,\fBlwres_buffer_back()\fRdecreases buffer\fIb\fR'sconsumed region by\fIn\fRbytes and checks for underflow..PP\fBlwres_buffer_getuint8()\fRreads an unsigned 8-bit integer from\fI*b\fRand returns it.\fBlwres_buffer_putuint8()\fRwrites the unsigned 8-bit integer\fIval\fRto buffer\fI*b\fR..PP\fBlwres_buffer_getuint16()\fRand\fBlwres_buffer_getuint32()\fRare identical to\fBlwres_buffer_putuint8()\fRexcept that they respectively read an unsigned 16-bit or 32-bit integer in network byte order from\fIb\fR.Similarly,\fBlwres_buffer_putuint16()\fRand\fBlwres_buffer_putuint32()\fRwrites the unsigned 16-bit or 32-bit integer\fIval\fRto buffer\fIb\fR,in network byte order..PPArbitrary amounts of data are read or written from a lightweightresolver buffer with\fBlwres_buffer_getmem()\fRand\fBlwres_buffer_putmem()\fRrespectively.\fBlwres_buffer_putmem()\fRcopies\fIlength\fRbytes of memory at\fIbase\fRto\fIb\fR.Conversely,\fBlwres_buffer_getmem()\fRcopies\fIlength\fRbytes of memory from\fIb\fRto\fIbase\fR.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -