summaryrefslogtreecommitdiffabout
path: root/src/proto.h
authorSergey Poznyakoff <gray@gnu.org>2018-05-30 09:45:21 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2018-05-30 09:45:21 (GMT)
commitb8d5da4c426b21ca0e56fc1cd6f75b49c0668e95 (patch) (unidiff)
tree26cbb1b04cd9febcdd37237c9576ea1c5eff3926 /src/proto.h
parenta14a6881538229cd938282bd56c7f0d12a089be6 (diff)
downloadgdbm-b8d5da4c426b21ca0e56fc1cd6f75b49c0668e95.tar.gz
gdbm-b8d5da4c426b21ca0e56fc1cd6f75b49c0668e95.tar.bz2
Namespace cleanup
Rename: __read to gdbm_file_read __write to gdbm_file_write __lseek to gdbm_file_seek __fsync to gdbm_file_sync
Diffstat (limited to 'src/proto.h') (more/less context) (ignore whitespace changes)
-rw-r--r--src/proto.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/proto.h b/src/proto.h
index 9592f52..563505f 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -83,4 +83,24 @@ int _gdbm_dump (GDBM_FILE dbf, FILE *fp);
83/* From recover.c */ 83/* From recover.c */
84int _gdbm_next_bucket_dir (GDBM_FILE dbf, int bucket_dir); 84int _gdbm_next_bucket_dir (GDBM_FILE dbf, int bucket_dir);
85 85
86/* I/O macros. */
87#if HAVE_MMAP
88# define gdbm_file_read(_dbf, _buf, _size) \
89 _gdbm_mapped_read(_dbf, _buf, _size)
90# define gdbm_file_write(_dbf, _buf, _size) \
91 _gdbm_mapped_write(_dbf, _buf, _size)
92# define gdbm_file_seek(_dbf, _off, _whn) \
93 _gdbm_mapped_lseek(_dbf, _off, _whn)
94# define gdbm_file_sync(_dbf) \
95 _gdbm_mapped_sync(_dbf)
96#else
97 # define gdbm_file_read(_dbf, _buf, _size)read(_dbf->desc, _buf, _size)
98 # define gdbm_file_write(_dbf, _buf, _size)write(_dbf->desc, _buf, _size)
99 # define gdbm_file_seek(_dbf, _off, _whn)lseek(_dbf->desc, _off, _whn)
100# if HAVE_FSYNC
101 # define gdbm_file_sync(_dbf) fsync(_dbf->desc)
102# else
103 # define gdbm_file_sync(_dbf) { sync(); sync(); }
104# endif
105#endif
86 106

Return to:

Send suggestions and report system problems to the System administrator.