… | |
… | |
134 | |
134 | |
135 | require XSLoader; |
135 | require XSLoader; |
136 | XSLoader::load ("BDB", $VERSION); |
136 | XSLoader::load ("BDB", $VERSION); |
137 | } |
137 | } |
138 | |
138 | |
|
|
139 | =head2 FILENAMES/DATABASE NAMES |
|
|
140 | |
|
|
141 | The BDB expects "binary" filenames (octet strings) for pathnames on POSIX |
|
|
142 | systems, and "unicode" filenames (strings with characters potentially |
|
|
143 | >255) on Win32 (expecting a Unicode win32 build - win32 is a total mess). |
|
|
144 | |
139 | =head2 BERKELEYDB FUNCTIONS |
145 | =head2 BERKELEYDB FUNCTIONS |
140 | |
146 | |
141 | All of these are functions. The create functions simply return a new |
147 | All of these are functions. The create functions simply return a new |
142 | object and never block. All the remaining functions all take an optional |
148 | object and never block. All the remaining functions take an optional |
143 | callback as last argument. If it is missing, then the function will be |
149 | callback as last argument. If it is missing, then the function will be |
144 | executed synchronously. In both cases, C<$!> will reflect the return value |
150 | executed synchronously. In both cases, C<$!> will reflect the return value |
145 | of the function. |
151 | of the function. |
146 | |
152 | |
147 | BDB functions that cannot block (mostly functions that manipulate |
153 | BDB functions that cannot block (mostly functions that manipulate |
148 | settings) are method calls on the relevant objects, so the rule of thumb |
154 | settings) are method calls on the relevant objects, so the rule of thumb |
149 | is: if its a method, its not blocking, if its a function, it takes a |
155 | is: if it's a method, it's not blocking, if it's a function, it takes a |
150 | callback as last argument. |
156 | callback as last argument. |
151 | |
157 | |
152 | In the following, C<$int> signifies an integer return value, |
158 | In the following, C<$int> signifies an integer return value, |
153 | C<octetstring> is a "binary string" (i.e. a perl string with no character |
159 | C<octetstring> is a "binary string" (i.e. a perl string with no character |
154 | indices >255), C<U32> is an unsigned 32 bit integer, C<int> is some |
160 | indices >255), C<U32> is an unsigned 32 bit integer, C<int> is some |
… | |
… | |
440 | =item $msg = BDB::strerror [$errno] |
446 | =item $msg = BDB::strerror [$errno] |
441 | |
447 | |
442 | Returns the string corresponding to the given errno value. If no argument |
448 | Returns the string corresponding to the given errno value. If no argument |
443 | is given, use C<$!>. |
449 | is given, use C<$!>. |
444 | |
450 | |
|
|
451 | Note that the BDB module also patches the C<$!> variable directly, so you |
|
|
452 | should be able to get a bdb error string by simply stringifying C<$!>. |
|
|
453 | |
445 | =item $fileno = BDB::poll_fileno |
454 | =item $fileno = BDB::poll_fileno |
446 | |
455 | |
447 | Return the I<request result pipe file descriptor>. This filehandle must be |
456 | Return the I<request result pipe file descriptor>. This filehandle must be |
448 | polled for reading by some mechanism outside this module (e.g. Event or |
457 | polled for reading by some mechanism outside this module (e.g. Event or |
449 | select, see below or the SYNOPSIS). If the pipe becomes readable you have |
458 | select, see below or the SYNOPSIS). If the pipe becomes readable you have |