ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/BDB/BDB.pm
(Generate patch)

Comparing BDB/BDB.pm (file contents):
Revision 1.32 by root, Sun Mar 30 04:34:20 2008 UTC vs.
Revision 1.34 by root, Sun Mar 30 06:17:31 2008 UTC

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
141The BDB expects "binary" filenames (octet strings) for pathnames on POSIX
142systems, 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
141All of these are functions. The create functions simply return a new 147All of these are functions. The create functions simply return a new
142object and never block. All the remaining functions all take an optional 148object and never block. All the remaining functions take an optional
143callback as last argument. If it is missing, then the function will be 149callback as last argument. If it is missing, then the function will be
144executed synchronously. In both cases, C<$!> will reflect the return value 150executed synchronously. In both cases, C<$!> will reflect the return value
145of the function. 151of the function.
146 152
147BDB functions that cannot block (mostly functions that manipulate 153BDB functions that cannot block (mostly functions that manipulate
148settings) are method calls on the relevant objects, so the rule of thumb 154settings) are method calls on the relevant objects, so the rule of thumb
149is: if its a method, its not blocking, if its a function, it takes a 155is: if it's a method, it's not blocking, if it's a function, it takes a
150callback as last argument. 156callback as last argument.
151 157
152In the following, C<$int> signifies an integer return value, 158In the following, C<$int> signifies an integer return value,
153C<octetstring> is a "binary string" (i.e. a perl string with no character 159C<octetstring> is a "binary string" (i.e. a perl string with no character
154indices >255), C<U32> is an unsigned 32 bit integer, C<int> is some 160indices >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
442Returns the string corresponding to the given errno value. If no argument 448Returns the string corresponding to the given errno value. If no argument
443is given, use C<$!>. 449is given, use C<$!>.
444 450
451Note that the BDB module also patches the C<$!> variable directly, so you
452should 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
447Return the I<request result pipe file descriptor>. This filehandle must be 456Return the I<request result pipe file descriptor>. This filehandle must be
448polled for reading by some mechanism outside this module (e.g. Event or 457polled for reading by some mechanism outside this module (e.g. Event or
449select, see below or the SYNOPSIS). If the pipe becomes readable you have 458select, see below or the SYNOPSIS). If the pipe becomes readable you have

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines