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

📄 bt_compare.so

📁 berkeley db 4.6.21的源码。berkeley db是一个简单的数据库管理系统
💻 SO
字号:
m4_comment([$Id: bt_compare.so,v 10.25 2004/03/05 21:39:33 bostic Exp $])m4_ref_title(Access Methods, Btree comparison,    specifying a Btree @comparison function, am_conf/malloc, am_conf/bt_prefix)m4_p([dnlThe Btree data structure is a sorted, balanced tree structure storingassociated key/data pairs.  By default, the sort order is lexicographical,with shorter keys collating before longer keys.  The user can specify thesort order for the Btree by using the m4_refT(dbh_set_bt_compare).])m4_p([dnlSort routines are passed pointers to keys as arguments.  The keys arerepresented as m4_ref(Dbt) structures.  The routine must return an integerless than, equal to, or greater than zero if the first argument isconsidered to be respectively less than, equal to, or greater than thesecond argument.  The only fields that the routines may examine in them4_ref(Dbt) structures are m4_arg(data) and m4_arg(size) fields.])m4_p([dnlAn example routine that might be used to sort integer keys in the databaseis as follows:])include(ref/am_conf/bt_compare1.cs)m4_p([dnlNote that the data must first be copied into memory that is appropriatelyaligned, as m4_db does not guarantee any kind of alignment of theunderlying data, including for comparison routines.  When writingcomparison routines, remember that databases created on machines ofdifferent architectures may have different integer byte orders, for whichyour code may need to compensate.])m4_p([dnlAn example routine that might be used to sort keys based on the firstfive bytes of the key (ignoring any subsequent bytes) is as follows:])include(ref/am_conf/bt_compare2.cs)m4_p([dnlAll comparison functions must cause the keys in the database to bewell-ordered. The most important implication of being well-ordered isthat the key relations must be transitive, that is, if key A is lessthan key B, and key B is less than key C, then the comparison routinemust also return that key A is less than key C.])m4_p([dnlIt is reasonable for a comparison function to not examine an entire keyin some applications, which implies that partial keys may be specifiedto the m4_db interfaces.  When partial keys are specified to m4_db,interfaces which retrieve data items based on a user-specified key (forexample, m4_ref(dbh_get) and m4_ref(dbc_get) with the m4_ref(DB_SET)flag), will not modify the user-specified key by returning the actualkey stored in the database.  The actual key can be retrieved by callingthe m4_refT(dbc_get) with the m4_ref(DB_CURRENT) flag.])m4_page_footer

⌨️ 快捷键说明

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