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

📄 partial.so

📁 berkeley db 4.6.21的源码。berkeley db是一个简单的数据库管理系统
💻 SO
字号:
m4_comment([$Id: partial.so,v 10.25 2003/10/18 19:15:56 bostic Exp $])m4_ref_title(Access Methods,    Partial record storage and retrieval,    @partial record storage and retrieval, am_misc/get_bulk, am_misc/struct)m4_p([dnlIt is possible to both store and retrieve parts of data items in allm4_db access methods.  This is done by setting them4_ref(DB_DBT_PARTIAL) flag in the m4_ref(Dbt) structure passed to them4_db method.])m4_p([dnlThe m4_ref(DB_DBT_PARTIAL) flag is based on the values of two fieldsof the m4_ref(Dbt) structure: m4_arg(dlen) and m4_arg(doff).  The valueof m4_arg(dlen) is the number of bytes of the record in which theapplication is interested.  The value of m4_arg(doff) is the offset fromthe beginning of the data item where those bytes start.])m4_p([dnlFor example, if the data item were m4_bold(ABCDEFGHIJKL), a m4_arg(doff)value of 3 would indicate that the bytes of interest started atm4_bold(D), and a m4_arg(dlen) value of 4 would indicate that the bytesof interest were m4_bold(DEFG).])m4_p([dnlWhen retrieving a data item from a database, the m4_arg(dlen) bytesstarting m4_arg(doff) bytes from the beginning of the record arereturned, as if they comprised the entire record.  If any or all of thespecified bytes do not exist in the record, the retrieval is stillsuccessful and any existing bytes are returned.])m4_p([dnlWhen storing a data item into the database, the m4_arg(dlen) bytesstarting m4_arg(doff) bytes from the beginning of the specified key'sdata record are replaced by the data specified by the m4_arg(data) andm4_arg(size) fields.  If m4_arg(dlen) is smaller than m4_arg(size), therecord will grow, and if m4_arg(dlen) is larger than m4_arg(size), therecord will shrink. If the specified bytes do not exist, the record willbe extended using nul bytes as necessary, and the store call will stillsucceed.])m4_p([dnlThe following are various examples of the put case for them4_ref(DB_DBT_PARTIAL) flag. In all examples, the initial data item is 20bytes in length:])m4_p([m4_bold([ABCDEFGHIJ0123456789])])m4_nlistbeginm4_nlist([m4_indent([dnlsize = 20doff = 0dlen = 20data = abcdefghijabcdefghijm4_blankResult: The 20 bytes at offset 0 are replaced by the 20 bytes of data;that is, the entire record is replaced.m4_blankABCDEFGHIJ0123456789 -__GT__ abcdefghijabcdefghij])])m4_nlist([m4_indent([dnlsize = 10doff = 20dlen = 0data = abcdefghijm4_blankResult: The 0 bytes at offset 20 are replaced by the 10 bytes of data;that is, the record is extended by 10 bytes.m4_blankABCDEFGHIJ0123456789 -__GT__ ABCDEFGHIJ0123456789abcdefghij])])m4_nlist([m4_indent([dnlsize = 10doff = 10dlen = 5data = abcdefghijm4_blankResult: The 5 bytes at offset 10 are replaced by the 10 bytes of data.m4_blankABCDEFGHIJ0123456789 -__GT__ ABCDEFGHIJabcdefghij56789])])m4_nlist([m4_indent([dnlsize = 10doff = 10dlen = 0data = abcdefghijm4_blankResult: The 0 bytes at offset 10 are replaced by the 10 bytes of data;that is, 10 bytes are inserted into the record.m4_blankABCDEFGHIJ0123456789 -__GT__ ABCDEFGHIJabcdefghij0123456789])])m4_nlist([m4_indent([dnlsize = 10doff = 2dlen = 15data = abcdefghijm4_blankResult: The 15 bytes at offset 2 are replaced by the 10 bytes of data.m4_blankABCDEFGHIJ0123456789 -__GT__ ABabcdefghij789])])m4_nlist([m4_indent([dnlsize = 10doff = 0dlen = 0data = abcdefghijm4_blankResult: The 0 bytes at offset 0 are replaced by the 10 bytes of data;that is, the 10 bytes are inserted at the beginning of the record.m4_blankABCDEFGHIJ0123456789 -__GT__ abcdefghijABCDEFGHIJ0123456789])])m4_nlist([m4_indent([dnlsize = 0doff = 0dlen = 10data = ""m4_blankResult: The 10 bytes at offset 0 are replaced by the 0 bytes of data;that is, the first 10 bytes of the record are discarded.m4_blankABCDEFGHIJ0123456789 -__GT__ 0123456789])])m4_nlist([m4_indent([dnlsize = 10doff = 25dlen = 0data = abcdefghijm4_blankResult: The 0 bytes at offset 25 are replaced by the 10 bytes of data;that is, 10 bytes are inserted into the record past the end of thecurrent data (\0 represents a nul byte).m4_blankABCDEFGHIJ0123456789 -__GT__ ABCDEFGHIJ0123456789\0\0\0\0\0abcdefghij])])m4_nlistendm4_page_footer

⌨️ 快捷键说明

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