… | |
… | |
87 | Request has reached the end of its lifetime and holds no resources |
87 | Request has reached the end of its lifetime and holds no resources |
88 | anymore (except possibly for the Perl object, but its connection to |
88 | anymore (except possibly for the Perl object, but its connection to |
89 | the actual aio request is severed and calling its methods will |
89 | the actual aio request is severed and calling its methods will |
90 | either do nothing or result in a runtime error). |
90 | either do nothing or result in a runtime error). |
91 | |
91 | |
|
|
92 | FILENAMES/DATABASE NAMES |
|
|
93 | The BDB expects "binary" filenames (octet strings) for pathnames on |
|
|
94 | POSIX systems, and "unicode" filenames (strings with characters |
|
|
95 | potentially >255) on Win32 (expecting a Unicode win32 build - win32 is a |
|
|
96 | total mess). |
|
|
97 | |
92 | BERKELEYDB FUNCTIONS |
98 | BERKELEYDB FUNCTIONS |
93 | All of these are functions. The create functions simply return a new |
99 | All of these are functions. The create functions simply return a new |
94 | object and never block. All the remaining functions all take an optional |
100 | object and never block. All the remaining functions take an optional |
95 | callback as last argument. If it is missing, then the function will be |
101 | callback as last argument. If it is missing, then the function will be |
96 | executed synchronously. In both cases, $! will reflect the return value |
102 | executed synchronously. In both cases, $! will reflect the return value |
97 | of the function. |
103 | of the function. |
98 | |
104 | |
99 | BDB functions that cannot block (mostly functions that manipulate |
105 | BDB functions that cannot block (mostly functions that manipulate |
100 | settings) are method calls on the relevant objects, so the rule of thumb |
106 | settings) are method calls on the relevant objects, so the rule of thumb |
101 | is: if its a method, its not blocking, if its a function, it takes a |
107 | is: if it's a method, it's not blocking, if it's a function, it takes a |
102 | callback as last argument. |
108 | callback as last argument. |
103 | |
109 | |
104 | In the following, $int signifies an integer return value, "octetstring" |
110 | In the following, $int signifies an integer return value, "octetstring" |
105 | is a "binary string" (i.e. a perl string with no character indices |
111 | is a "binary string" (i.e. a perl string with no character indices |
106 | >255), "U32" is an unsigned 32 bit integer, "int" is some integer, "NV" |
112 | >255), "U32" is an unsigned 32 bit integer, "int" is some integer, "NV" |
… | |
… | |
361 | flags: SEQ_DEC SEQ_INC SEQ_WRAP |
367 | flags: SEQ_DEC SEQ_INC SEQ_WRAP |
362 | $int = $seq->set_range (db_seq_t min, db_seq_t max) |
368 | $int = $seq->set_range (db_seq_t min, db_seq_t max) |
363 | |
369 | |
364 | Example: |
370 | Example: |
365 | my $seq = $db->sequence; |
371 | my $seq = $db->sequence; |
366 | |
372 | |
367 | db_sequence_open $seq, undef, "seq", BDB::CREATE; |
373 | db_sequence_open $seq, undef, "seq", BDB::CREATE; |
368 | db_sequence_get $seq, undef, 1, my $value; |
374 | db_sequence_get $seq, undef, 1, my $value; |
369 | |
375 | |
370 | SUPPORT FUNCTIONS |
376 | SUPPORT FUNCTIONS |
371 | EVENT PROCESSING AND EVENT LOOP INTEGRATION |
377 | EVENT PROCESSING AND EVENT LOOP INTEGRATION |
372 | $msg = BDB::strerror [$errno] |
378 | $msg = BDB::strerror [$errno] |
373 | Returns the string corresponding to the given errno value. If no |
379 | Returns the string corresponding to the given errno value. If no |
374 | argument is given, use $!. |
380 | argument is given, use $!. |
|
|
381 | |
|
|
382 | Note that the BDB module also patches the $! variable directly, so |
|
|
383 | you should be able to get a bdb error string by simply stringifying |
|
|
384 | $!. |
375 | |
385 | |
376 | $fileno = BDB::poll_fileno |
386 | $fileno = BDB::poll_fileno |
377 | Return the *request result pipe file descriptor*. This filehandle |
387 | Return the *request result pipe file descriptor*. This filehandle |
378 | must be polled for reading by some mechanism outside this module |
388 | must be polled for reading by some mechanism outside this module |
379 | (e.g. Event or select, see below or the SYNOPSIS). If the pipe |
389 | (e.g. Event or select, see below or the SYNOPSIS). If the pipe |