Revision 10724,
1.2 KB
checked in by ghudson, 27 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r10723,
which included commits to RCS files with non-trunk default branches.
|
Line | |
---|
1 | #include "EXTERN.h" |
---|
2 | #include "perl.h" |
---|
3 | #include "XSUB.h" |
---|
4 | #include "sdbm/sdbm.h" |
---|
5 | |
---|
6 | typedef DBM* SDBM_File; |
---|
7 | #define sdbm_TIEHASH(dbtype,filename,flags,mode) sdbm_open(filename,flags,mode) |
---|
8 | #define sdbm_FETCH(db,key) sdbm_fetch(db,key) |
---|
9 | #define sdbm_STORE(db,key,value,flags) sdbm_store(db,key,value,flags) |
---|
10 | #define sdbm_DELETE(db,key) sdbm_delete(db,key) |
---|
11 | #define sdbm_FIRSTKEY(db) sdbm_firstkey(db) |
---|
12 | #define sdbm_NEXTKEY(db,key) sdbm_nextkey(db) |
---|
13 | |
---|
14 | |
---|
15 | MODULE = SDBM_File PACKAGE = SDBM_File PREFIX = sdbm_ |
---|
16 | |
---|
17 | SDBM_File |
---|
18 | sdbm_TIEHASH(dbtype, filename, flags, mode) |
---|
19 | char * dbtype |
---|
20 | char * filename |
---|
21 | int flags |
---|
22 | int mode |
---|
23 | |
---|
24 | void |
---|
25 | sdbm_DESTROY(db) |
---|
26 | SDBM_File db |
---|
27 | CODE: |
---|
28 | sdbm_close(db); |
---|
29 | |
---|
30 | datum |
---|
31 | sdbm_FETCH(db, key) |
---|
32 | SDBM_File db |
---|
33 | datum key |
---|
34 | |
---|
35 | int |
---|
36 | sdbm_STORE(db, key, value, flags = DBM_REPLACE) |
---|
37 | SDBM_File db |
---|
38 | datum key |
---|
39 | datum value |
---|
40 | int flags |
---|
41 | CLEANUP: |
---|
42 | if (RETVAL) { |
---|
43 | if (RETVAL < 0 && errno == EPERM) |
---|
44 | croak("No write permission to sdbm file"); |
---|
45 | croak("sdbm store returned %d, errno %d, key \"%s\"", |
---|
46 | RETVAL,errno,key.dptr); |
---|
47 | sdbm_clearerr(db); |
---|
48 | } |
---|
49 | |
---|
50 | int |
---|
51 | sdbm_DELETE(db, key) |
---|
52 | SDBM_File db |
---|
53 | datum key |
---|
54 | |
---|
55 | datum |
---|
56 | sdbm_FIRSTKEY(db) |
---|
57 | SDBM_File db |
---|
58 | |
---|
59 | datum |
---|
60 | sdbm_NEXTKEY(db, key) |
---|
61 | SDBM_File db |
---|
62 | datum key |
---|
63 | |
---|
64 | int |
---|
65 | sdbm_error(db) |
---|
66 | SDBM_File db |
---|
67 | |
---|
68 | int |
---|
69 | sdbm_clearerr(db) |
---|
70 | SDBM_File db |
---|
71 | |
---|
Note: See
TracBrowser
for help on using the repository browser.