Commit | Line | Data |
---|---|---|
a0d0e21e LW |
1 | package GDBM_File; |
2 | ||
3 | require Carp; | |
4 | require TieHash; | |
5 | require Exporter; | |
3b35bae3 | 6 | use AutoLoader; |
a0d0e21e | 7 | require DynaLoader; |
fec02dd3 | 8 | @ISA = qw(TieHash Exporter DynaLoader); |
a0d0e21e LW |
9 | @EXPORT = qw( |
10 | GDBM_CACHESIZE | |
11 | GDBM_FAST | |
12 | GDBM_INSERT | |
13 | GDBM_NEWDB | |
14 | GDBM_READER | |
15 | GDBM_REPLACE | |
16 | GDBM_WRCREAT | |
17 | GDBM_WRITER | |
18 | ); | |
19 | ||
20 | sub AUTOLOAD { | |
a0d0e21e LW |
21 | local($constname); |
22 | ($constname = $AUTOLOAD) =~ s/.*:://; | |
23 | $val = constant($constname, @_ ? $_[0] : 0); | |
24 | if ($! != 0) { | |
25 | if ($! =~ /Invalid/) { | |
26 | $AutoLoader::AUTOLOAD = $AUTOLOAD; | |
27 | goto &AutoLoader::AUTOLOAD; | |
28 | } | |
29 | else { | |
30 | Carp::croak("Your vendor has not defined GDBM_File macro $constname, used"); | |
31 | } | |
32 | } | |
33 | eval "sub $AUTOLOAD { $val }"; | |
34 | goto &$AUTOLOAD; | |
35 | } | |
36 | ||
37 | bootstrap GDBM_File; | |
38 | ||
39 | # Preloaded methods go here. Autoload methods go after __END__, and are | |
40 | # processed by the autosplit program. | |
41 | ||
42 | 1; | |
43 | __END__ |