gdbm-1.18.1/ 0000755 0001750 0001750 00000000000 13364776741 007536 5 0000000 0000000 gdbm-1.18.1/git2chg.awk 0000644 0001750 0001750 00000003214 12764624100 011471 0000000 0000000 # This file is part of grecs
# Copyright (C) 2007, 2009-2014 Sergey Poznyakoff
#
# Grecs is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# Grecs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Grecs. If not, see .
BEGIN {
if (since)
split(since,since_a,"-")
}
function timeok(t, a) {
if (!since)
return 1
split(t,a,"-")
if (a[1] < since_a[1])
return 0
if (a[1] > since_a[1])
return 1
if (a[2] < since_a[2])
return 0
if (a[2] > since_a[2])
return 1
return a[3] > since_a[3]
}
/^[0-9]+ .* +<[^>]+>/ {
s = strftime("%F", $1)
if (!timeok(s))
exit
sub(/^[0-9]+ +/,"")
if (s == datestr && author == $0)
next
datestr = s
author = $0
if (runlen) { runlen = 0; print "" }
printf("%s %s\n", datestr, author)
next
}
/^Signed-off-by:/ { next }
/^$/ { next }
NF==0 {
runlen++
next
}
{ if (runlen) { runlen = 0; print "" }
print "\t" $0 }
END {
if (append) {
print ""
while ((getline < append) > 0) {
if (match($0, /^Local *Variables:/))
break
print
}
}
print "\f"
# Make sure Emacs won't recognize this line:
print "Local", "Variables:"
print "mode: change-log"
print "version-control: never"
print "buffer-read-only: t"
print "End:"
}
gdbm-1.18.1/ABOUT-NLS 0000644 0001750 0001750 00000272155 12764624126 010711 0000000 0000000 1 Notes on the Free Translation Project
***************************************
Free software is going international! The Free Translation Project is
a way to get maintainers of free software, translators, and users all
together, so that free software will gradually become able to speak many
languages. A few packages already provide translations for their
messages.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
itself available at your nearest GNU archive site. But you do _not_
need to install GNU `gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work on translations can contact the appropriate team.
When reporting bugs in the `intl/' directory or bugs which may be
related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
1.1 Quick configuration advice
==============================
If you want to exploit the full power of internationalization, you
should configure it using
./configure --with-included-gettext
to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in the
operating system where this package is being installed. So far, only
the `gettext' implementation in the GNU C library version 2 provides as
many features (such as locale alias, message inheritance, automatic
charset conversion or plural form handling) as the implementation here.
It is also not possible to offer this additional functionality on top
of a `catgets' implementation. Future versions of GNU `gettext' will
very likely convey even more functionality. So it might be a good idea
to change to GNU `gettext' as soon as possible.
So you need _not_ provide this option if you are using GNU libc 2 or
you have installed a recent copy of the GNU gettext package with the
included `libintl'.
1.2 INSTALL Matters
===================
Some packages are "localizable" when properly installed; the programs
they contain can be made to speak your own native language. Most such
packages use GNU `gettext'. Other packages have their own ways to
internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
provides the GNU `gettext' functions. If not, the included GNU
`gettext' library will be used. This library is wholly contained
within this package, usually in the `intl/' subdirectory, so prior
installation of the GNU `gettext' package is _not_ required.
Installers may use special options at configuration time for changing
the default behaviour. The commands:
./configure --with-included-gettext
./configure --disable-nls
will, respectively, bypass any pre-existing `gettext' to use the
internationalizing routines provided within this package, or else,
_totally_ disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
probably detect the previously built and installed `libintl.a' file and
will decide to use this. This might not be desirable. You should use
the more recent version of the GNU `gettext' library. I.e. if the file
`intl/VERSION' shows that the library which comes with this package is
more recent, you should use
./configure --with-included-gettext
to prevent auto-detection.
The configuration process will not test for the `catgets' function
and therefore it will not be used. The reason is that even an
emulation of `gettext' on top of `catgets' could not provide all the
extensions of the GNU `gettext' library.
Internationalized packages usually have many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable `LINGUAS'
may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
1.3 Using This Package
======================
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
`LL_CC' combination. If you happen to have the `LC_ALL' or some other
`LC_xxx' environment variables set, you should unset them before
setting `LANG', otherwise the setting of `LANG' will not have the
desired effect. Here `LL' is an ISO 639 two-letter language code, and
`CC' is an ISO 3166 two-letter country code. For example, let's
suppose that you speak German and live in Germany. At the shell
prompt, merely execute `setenv LANG de_DE' (in `csh'),
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
This can be done from your `.login' or `.profile' file, once and for
all.
You might think that the country code specification is redundant.
But in fact, some languages have dialects in different countries. For
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
country code serves to distinguish the dialects.
The locale naming convention of `LL_CC', with `LL' denoting the
language and `CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
locales supported by your system for your language by running the
command `locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
understand other languages, you can set up a priority list of languages.
This is done through a different environment variable, called
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
for the purpose of message handling, but you still need to have `LANG'
set to the primary language; this is required by other parts of the
system libraries. For example, some Swedish users who would rather
read translations in German than English for when Swedish is not
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
Special advice for Norwegian users: The language code for Norwegian
bokma*l changed from `no' to `nb' recently (in 2003). During the
transition period, while some message catalogs for this language are
installed under `nb' and some older ones under `no', it's recommended
for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
older translations are used.
In the `LANGUAGE' environment variable, but not in the `LANG'
environment variable, `LL_CC' combinations can be abbreviated as `LL'
to denote the language's main dialect. For example, `de' is equivalent
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
(Portuguese as spoken in Portugal) in this context.
1.4 Translating Teams
=====================
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list. The up-to-date list of
teams can be found at the Free Translation Project's homepage,
`http://translationproject.org/', in the "Teams" area.
If you'd like to volunteer to _work_ at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is _not_ the same as the list itself, it has
`-request' appended. For example, speakers of Swedish can send a
message to `sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate
_actively_ in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `coordinator@translationproject.org' to
reach the coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology in use. Proven linguistic skills are praised more than
programming skills, here.
1.5 Available Packages
======================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of May 2010.
The matrix shows, in regard of each package, for which languages PO
files have been submitted to translation coordination, with a
translation percentage of at least 50%.
Ready PO files af am ar as ast az be be@latin bg bn_IN bs ca crh
+---------------------------------------------------+
a2ps | [] [] |
aegis | |
ant-phone | |
anubis | |
aspell | [] [] |
bash | |
bfd | |
bibshelf | [] |
binutils | |
bison | |
bison-runtime | [] |
bluez-pin | [] [] |
bombono-dvd | |
buzztard | |
cflow | |
clisp | |
coreutils | [] [] |
cpio | |
cppi | |
cpplib | [] |
cryptsetup | |
dfarc | |
dialog | [] [] |
dico | |
diffutils | [] |
dink | |
doodle | |
e2fsprogs | [] |
enscript | [] |
exif | |
fetchmail | [] |
findutils | [] |
flex | [] |
freedink | |
gas | |
gawk | [] [] |
gcal | [] |
gcc | |
gettext-examples | [] [] [] [] |
gettext-runtime | [] [] [] |
gettext-tools | [] [] |
gip | [] |
gjay | |
gliv | [] |
glunarclock | [] [] |
gnubiff | |
gnucash | [] |
gnuedu | |
gnulib | |
gnunet | |
gnunet-gtk | |
gnutls | |
gold | |
gpe-aerial | |
gpe-beam | |
gpe-bluetooth | |
gpe-calendar | |
gpe-clock | [] |
gpe-conf | |
gpe-contacts | |
gpe-edit | |
gpe-filemanager | |
gpe-go | |
gpe-login | |
gpe-ownerinfo | [] |
gpe-package | |
gpe-sketchbook | |
gpe-su | [] |
gpe-taskmanager | [] |
gpe-timesheet | [] |
gpe-today | [] |
gpe-todo | |
gphoto2 | |
gprof | [] |
gpsdrive | |
gramadoir | |
grep | |
grub | [] [] |
gsasl | |
gss | |
gst-plugins-bad | [] |
gst-plugins-base | [] |
gst-plugins-good | [] |
gst-plugins-ugly | [] |
gstreamer | [] [] [] |
gtick | |
gtkam | [] |
gtkorphan | [] |
gtkspell | [] [] [] |
gutenprint | |
hello | [] |
help2man | |
hylafax | |
idutils | |
indent | [] [] |
iso_15924 | |
iso_3166 | [] [] [] [] [] [] [] [] |
iso_3166_2 | |
iso_4217 | |
iso_639 | [] [] [] [] [] |
iso_639_3 | [] |
jwhois | |
kbd | |
keytouch | [] |
keytouch-editor | |
keytouch-keyboa... | [] |
klavaro | [] |
latrine | |
ld | [] |
leafpad | [] [] |
libc | [] [] |
libexif | () |
libextractor | |
libgnutls | |
libgpewidget | |
libgpg-error | |
libgphoto2 | |
libgphoto2_port | |
libgsasl | |
libiconv | [] |
libidn | |
lifelines | |
liferea | [] [] |
lilypond | |
linkdr | [] |
lordsawar | |
lprng | |
lynx | [] |
m4 | |
mailfromd | |
mailutils | |
make | |
man-db | |
man-db-manpages | |
minicom | |
mkisofs | |
myserver | |
nano | [] [] |
opcodes | |
parted | |
pies | |
popt | |
psmisc | |
pspp | [] |
pwdutils | |
radius | [] |
recode | [] [] |
rosegarden | |
rpm | |
rush | |
sarg | |
screem | |
scrollkeeper | [] [] [] |
sed | [] [] |
sharutils | [] [] |
shishi | |
skencil | |
solfege | |
solfege-manual | |
soundtracker | |
sp | |
sysstat | |
tar | [] |
texinfo | |
tin | |
unicode-han-tra... | |
unicode-transla... | |
util-linux-ng | [] |
vice | |
vmm | |
vorbis-tools | |
wastesedge | |
wdiff | |
wget | [] [] |
wyslij-po | |
xchat | [] [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] |
+---------------------------------------------------+
af am ar as ast az be be@latin bg bn_IN bs ca crh
6 0 2 3 19 1 11 3 28 3 1 38 5
cs da de el en en_GB en_ZA eo es et eu fa fi
+-------------------------------------------------+
a2ps | [] [] [] [] [] [] [] [] |
aegis | [] [] [] |
ant-phone | [] () |
anubis | [] [] [] |
aspell | [] [] [] [] [] |
bash | [] [] [] [] |
bfd | [] [] |
bibshelf | [] [] [] [] |
binutils | [] [] |
bison | [] [] [] |
bison-runtime | [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] [] |
bombono-dvd | [] [] |
buzztard | [] [] [] |
cflow | [] [] [] |
clisp | [] [] [] [] |
coreutils | [] [] [] [] |
cpio | [] |
cppi | [] |
cpplib | [] [] [] |
cryptsetup | [] |
dfarc | [] [] [] [] |
dialog | [] [] [] [] [] |
dico | |
diffutils | [] [] [] [] [] [] [] |
dink | [] [] [] |
doodle | [] |
e2fsprogs | [] [] [] |
enscript | [] [] [] |
exif | () [] [] [] |
fetchmail | [] [] () [] [] [] |
findutils | [] [] [] [] |
flex | [] [] [] |
freedink | [] [] [] [] |
gas | [] |
gawk | [] [] [] |
gcal | [] |
gcc | [] [] |
gettext-examples | [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] |
gettext-tools | [] [] [] |
gip | [] [] [] [] [] |
gjay | [] [] |
gliv | [] [] [] [] |
glunarclock | [] [] [] |
gnubiff | () |
gnucash | [] () () () () () |
gnuedu | [] [] |
gnulib | [] [] [] |
gnunet | |
gnunet-gtk | [] |
gnutls | [] [] |
gold | [] [] |
gpe-aerial | [] [] [] [] [] |
gpe-beam | [] [] [] [] [] |
gpe-bluetooth | [] [] [] |
gpe-calendar | [] [] |
gpe-clock | [] [] [] [] [] |
gpe-conf | [] [] [] [] |
gpe-contacts | [] [] [] [] |
gpe-edit | [] [] [] |
gpe-filemanager | [] [] [] [] |
gpe-go | [] [] [] [] [] |
gpe-login | [] [] [] |
gpe-ownerinfo | [] [] [] [] [] |
gpe-package | [] [] [] [] |
gpe-sketchbook | [] [] [] [] [] |
gpe-su | [] [] [] [] [] |
gpe-taskmanager | [] [] [] [] [] |
gpe-timesheet | [] [] [] [] [] |
gpe-today | [] [] [] [] [] |
gpe-todo | [] [] [] [] |
gphoto2 | [] [] () [] [] [] [] |
gprof | [] [] [] [] |
gpsdrive | [] [] [] |
gramadoir | [] [] [] |
grep | [] [] |
grub | [] [] [] |
gsasl | [] [] |
gss | [] |
gst-plugins-bad | [] [] [] [] [] [] |
gst-plugins-base | [] [] [] [] [] [] |
gst-plugins-good | [] [] [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] [] |
gtick | [] () [] [] |
gtkam | [] [] () [] [] |
gtkorphan | [] [] [] [] |
gtkspell | [] [] [] [] [] [] [] [] |
gutenprint | [] [] [] [] |
hello | [] [] [] [] [] |
help2man | [] [] |
hylafax | [] [] |
idutils | [] [] [] |
indent | [] [] [] [] [] [] [] [] |
iso_15924 | [] () [] [] [] |
iso_3166 | [] [] [] () [] [] [] () [] |
iso_3166_2 | () |
iso_4217 | [] [] [] () [] [] [] |
iso_639 | [] [] [] () [] [] [] |
iso_639_3 | |
jwhois | [] [] |
kbd | [] [] [] [] [] |
keytouch | [] [] [] |
keytouch-editor | [] [] [] |
keytouch-keyboa... | [] [] |
klavaro | [] [] [] [] |
latrine | [] () [] |
ld | [] [] [] |
leafpad | [] [] [] [] [] [] [] |
libc | [] [] [] [] [] |
libexif | [] [] () |
libextractor | |
libgnutls | [] |
libgpewidget | [] [] [] |
libgpg-error | [] [] |
libgphoto2 | [] () |
libgphoto2_port | [] () [] |
libgsasl | [] |
libiconv | [] [] [] [] [] [] |
libidn | [] [] [] [] |
lifelines | [] () |
liferea | [] [] [] [] [] |
lilypond | [] [] [] [] |
linkdr | [] [] [] [] |
lordsawar | [] |
lprng | |
lynx | [] [] [] [] |
m4 | [] [] [] [] [] |
mailfromd | |
mailutils | [] |
make | [] [] [] [] |
man-db | |
man-db-manpages | |
minicom | [] [] [] [] [] |
mkisofs | [] |
myserver | |
nano | [] [] [] [] |
opcodes | [] [] [] |
parted | [] [] |
pies | |
popt | [] [] [] [] [] [] |
psmisc | [] [] [] [] |
pspp | [] |
pwdutils | [] |
radius | [] |
recode | [] [] [] [] [] [] [] |
rosegarden | () () () () |
rpm | [] [] [] |
rush | |
sarg | |
screem | |
scrollkeeper | [] [] [] [] [] [] |
sed | [] [] [] [] [] [] [] |
sharutils | [] [] [] [] [] |
shishi | |
skencil | [] () [] |
solfege | [] [] [] [] |
solfege-manual | [] [] |
soundtracker | [] [] [] |
sp | [] |
sysstat | [] [] [] [] |
tar | [] [] [] [] [] |
texinfo | [] [] [] |
tin | [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux-ng | [] [] [] [] [] |
vice | () () |
vmm | [] |
vorbis-tools | [] [] |
wastesedge | [] |
wdiff | [] [] [] |
wget | [] [] [] [] |
wyslij-po | [] |
xchat | [] [] [] [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] [] [] |
+-------------------------------------------------+
cs da de el en en_GB en_ZA eo es et eu fa fi
64 105 117 18 1 8 0 28 89 18 19 0 104
fr ga gl gu he hi hr hu hy id is it ja ka kn
+------------------------------------------------+
a2ps | [] [] [] |
aegis | [] [] |
ant-phone | [] [] |
anubis | [] [] [] |
aspell | [] [] [] [] |
bash | [] [] [] |
bfd | [] [] |
bibshelf | [] [] [] [] |
binutils | [] [] |
bison | [] [] [] |
bison-runtime | [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] [] |
bombono-dvd | |
buzztard | [] |
cflow | [] [] |
clisp | [] |
coreutils | [] [] [] [] [] |
cpio | [] [] [] |
cppi | [] |
cpplib | [] [] |
cryptsetup | [] [] [] |
dfarc | [] [] |
dialog | [] [] [] [] [] [] [] |
dico | |
diffutils | [] [] [] [] [] [] [] [] |
dink | [] |
doodle | [] [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
exif | [] [] [] [] [] |
fetchmail | [] [] [] [] |
findutils | [] [] [] [] [] |
flex | [] [] |
freedink | [] [] |
gas | [] [] |
gawk | [] [] [] [] () [] |
gcal | [] |
gcc | [] |
gettext-examples | [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] |
gettext-tools | [] [] [] [] |
gip | [] [] [] [] [] |
gjay | |
gliv | () |
glunarclock | [] [] [] |
gnubiff | () [] () |
gnucash | () () () () [] |
gnuedu | [] [] |
gnulib | [] [] [] [] [] |
gnunet | |
gnunet-gtk | [] |
gnutls | [] [] |
gold | [] |
gpe-aerial | [] [] |
gpe-beam | [] [] [] |
gpe-bluetooth | [] [] [] |
gpe-calendar | [] |
gpe-clock | [] [] [] [] |
gpe-conf | [] [] [] |
gpe-contacts | [] [] [] |
gpe-edit | [] [] |
gpe-filemanager | [] [] [] |
gpe-go | [] [] [] [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] [] [] |
gpe-package | [] [] |
gpe-sketchbook | [] [] [] |
gpe-su | [] [] [] [] [] |
gpe-taskmanager | [] [] [] [] |
gpe-timesheet | [] [] [] [] |
gpe-today | [] [] [] [] [] [] |
gpe-todo | [] [] |
gphoto2 | [] [] [] [] [] |
gprof | [] [] [] |
gpsdrive | [] [] [] |
gramadoir | [] [] [] |
grep | [] |
grub | [] [] [] |
gsasl | [] [] [] [] |
gss | [] [] [] [] |
gst-plugins-bad | [] [] [] [] |
gst-plugins-base | [] [] [] [] [] |
gst-plugins-good | [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] |
gstreamer | [] [] [] [] |
gtick | [] [] [] [] |
gtkam | [] [] [] [] [] |
gtkorphan | [] [] [] |
gtkspell | [] [] [] [] [] [] [] [] |
gutenprint | [] [] [] |
hello | [] [] |
help2man | [] |
hylafax | [] |
idutils | [] [] [] [] [] |
indent | [] [] [] [] [] [] [] |
iso_15924 | () [] [] |
iso_3166 | () [] [] [] [] [] [] [] [] [] [] |
iso_3166_2 | () [] [] [] |
iso_4217 | () [] [] [] [] |
iso_639 | () [] [] [] [] [] [] [] |
iso_639_3 | () [] [] |
jwhois | [] [] [] [] |
kbd | [] [] |
keytouch | [] [] [] [] [] |
keytouch-editor | [] [] [] [] |
keytouch-keyboa... | [] [] [] [] |
klavaro | [] [] |
latrine | [] [] |
ld | [] [] [] |
leafpad | [] [] [] [] [] [] () |
libc | [] [] [] [] |
libexif | |
libextractor | |
libgnutls | [] [] |
libgpewidget | [] [] [] |
libgpg-error | [] [] |
libgphoto2 | [] [] [] |
libgphoto2_port | [] [] [] |
libgsasl | [] [] [] [] |
libiconv | [] [] [] [] [] |
libidn | [] [] [] |
lifelines | () |
liferea | [] [] [] [] |
lilypond | [] |
linkdr | [] [] [] [] |
lordsawar | |
lprng | [] |
lynx | [] [] [] [] [] |
m4 | [] [] [] [] [] |
mailfromd | |
mailutils | [] [] |
make | [] [] [] [] [] [] [] [] |
man-db | [] [] |
man-db-manpages | [] |
minicom | [] [] [] [] |
mkisofs | [] [] [] |
myserver | |
nano | [] [] [] [] [] |
opcodes | [] [] [] |
parted | [] [] [] [] |
pies | |
popt | [] [] [] [] [] [] [] [] |
psmisc | [] [] |
pspp | |
pwdutils | [] [] |
radius | [] [] |
recode | [] [] [] [] [] [] [] |
rosegarden | () () () () |
rpm | [] [] |
rush | |
sarg | [] |
screem | [] [] |
scrollkeeper | [] [] [] |
sed | [] [] [] [] [] [] [] |
sharutils | [] [] [] [] [] [] |
shishi | [] |
skencil | [] |
solfege | [] [] [] |
solfege-manual | [] [] |
soundtracker | [] [] |
sp | [] () |
sysstat | [] [] [] [] |
tar | [] [] [] [] [] [] |
texinfo | [] [] [] [] |
tin | [] |
unicode-han-tra... | |
unicode-transla... | [] [] |
util-linux-ng | [] [] [] [] [] |
vice | () () () |
vmm | [] |
vorbis-tools | [] |
wastesedge | () () |
wdiff | |
wget | [] [] [] [] [] [] [] |
wyslij-po | [] [] |
xchat | [] [] [] [] [] [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] |
+------------------------------------------------+
fr ga gl gu he hi hr hu hy id is it ja ka kn
121 53 20 4 8 2 5 53 2 120 5 83 66 0 4
ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
+-----------------------------------------------+
a2ps | [] |
aegis | |
ant-phone | |
anubis | [] [] |
aspell | [] |
bash | |
bfd | |
bibshelf | [] [] |
binutils | |
bison | [] |
bison-runtime | [] [] [] [] [] |
bluez-pin | [] [] [] [] [] |
bombono-dvd | |
buzztard | |
cflow | |
clisp | |
coreutils | [] |
cpio | |
cppi | |
cpplib | |
cryptsetup | |
dfarc | [] |
dialog | [] [] [] [] [] |
dico | |
diffutils | [] [] |
dink | |
doodle | |
e2fsprogs | |
enscript | |
exif | [] |
fetchmail | |
findutils | |
flex | |
freedink | [] |
gas | |
gawk | |
gcal | |
gcc | |
gettext-examples | [] [] [] [] |
gettext-runtime | [] |
gettext-tools | [] |
gip | [] [] |
gjay | |
gliv | |
glunarclock | [] |
gnubiff | |
gnucash | () () () () |
gnuedu | |
gnulib | |
gnunet | |
gnunet-gtk | |
gnutls | [] |
gold | |
gpe-aerial | [] |
gpe-beam | [] |
gpe-bluetooth | [] [] |
gpe-calendar | [] |
gpe-clock | [] [] [] [] [] |
gpe-conf | [] [] |
gpe-contacts | [] [] |
gpe-edit | [] |
gpe-filemanager | [] [] |
gpe-go | [] [] [] |
gpe-login | [] |
gpe-ownerinfo | [] [] |
gpe-package | [] [] |
gpe-sketchbook | [] [] |
gpe-su | [] [] [] [] [] [] |
gpe-taskmanager | [] [] [] [] [] [] |
gpe-timesheet | [] [] |
gpe-today | [] [] [] [] |
gpe-todo | [] [] |
gphoto2 | |
gprof | [] |
gpsdrive | |
gramadoir | |
grep | |
grub | |
gsasl | |
gss | |
gst-plugins-bad | [] [] |
gst-plugins-base | [] [] |
gst-plugins-good | [] [] |
gst-plugins-ugly | [] [] [] [] [] |
gstreamer | |
gtick | |
gtkam | [] |
gtkorphan | [] [] |
gtkspell | [] [] [] [] [] [] [] |
gutenprint | |
hello | [] [] [] |
help2man | |
hylafax | |
idutils | |
indent | |
iso_15924 | [] [] |
iso_3166 | [] [] () [] [] [] [] [] |
iso_3166_2 | |
iso_4217 | [] [] |
iso_639 | [] [] |
iso_639_3 | [] |
jwhois | [] |
kbd | |
keytouch | [] |
keytouch-editor | [] |
keytouch-keyboa... | [] |
klavaro | [] |
latrine | [] |
ld | |
leafpad | [] [] [] |
libc | [] |
libexif | |
libextractor | |
libgnutls | [] |
libgpewidget | [] [] |
libgpg-error | |
libgphoto2 | |
libgphoto2_port | |
libgsasl | |
libiconv | |
libidn | |
lifelines | |
liferea | |
lilypond | |
linkdr | |
lordsawar | |
lprng | |
lynx | |
m4 | |
mailfromd | |
mailutils | |
make | [] |
man-db | |
man-db-manpages | |
minicom | [] |
mkisofs | |
myserver | |
nano | [] [] |
opcodes | |
parted | |
pies | |
popt | [] [] [] |
psmisc | |
pspp | |
pwdutils | |
radius | |
recode | |
rosegarden | |
rpm | |
rush | |
sarg | |
screem | |
scrollkeeper | [] [] |
sed | |
sharutils | |
shishi | |
skencil | |
solfege | [] |
solfege-manual | |
soundtracker | |
sp | |
sysstat | [] |
tar | [] |
texinfo | [] |
tin | |
unicode-han-tra... | |
unicode-transla... | |
util-linux-ng | |
vice | |
vmm | |
vorbis-tools | |
wastesedge | |
wdiff | |
wget | [] |
wyslij-po | |
xchat | [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] |
+-----------------------------------------------+
ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
20 5 10 1 12 48 4 2 2 4 24 10 19 3 1
nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
+---------------------------------------------------+
a2ps | [] [] [] [] [] [] [] [] |
aegis | [] [] [] |
ant-phone | [] [] |
anubis | [] [] [] |
aspell | [] [] [] [] [] |
bash | [] [] |
bfd | [] |
bibshelf | [] [] |
binutils | [] [] |
bison | [] [] [] |
bison-runtime | [] [] [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] [] [] |
bombono-dvd | [] () |
buzztard | [] [] |
cflow | [] |
clisp | [] [] |
coreutils | [] [] [] [] [] [] |
cpio | [] [] [] |
cppi | [] |
cpplib | [] |
cryptsetup | [] |
dfarc | [] |
dialog | [] [] [] [] |
dico | [] |
diffutils | [] [] [] [] [] [] |
dink | () |
doodle | [] [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] [] |
exif | [] [] [] () [] |
fetchmail | [] [] [] [] |
findutils | [] [] [] [] [] |
flex | [] [] [] [] [] |
freedink | [] [] |
gas | |
gawk | [] [] [] [] |
gcal | |
gcc | [] |
gettext-examples | [] [] [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] [] [] [] |
gettext-tools | [] [] [] [] [] [] |
gip | [] [] [] [] [] |
gjay | |
gliv | [] [] [] [] [] [] |
glunarclock | [] [] [] [] [] |
gnubiff | [] () |
gnucash | [] () () () |
gnuedu | [] |
gnulib | [] [] [] [] |
gnunet | |
gnunet-gtk | |
gnutls | [] [] |
gold | |
gpe-aerial | [] [] [] [] [] [] [] |
gpe-beam | [] [] [] [] [] [] [] |
gpe-bluetooth | [] [] |
gpe-calendar | [] [] [] [] |
gpe-clock | [] [] [] [] [] [] [] [] |
gpe-conf | [] [] [] [] [] [] [] |
gpe-contacts | [] [] [] [] [] |
gpe-edit | [] [] [] |
gpe-filemanager | [] [] [] |
gpe-go | [] [] [] [] [] [] [] [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] [] [] [] [] [] [] |
gpe-package | [] [] |
gpe-sketchbook | [] [] [] [] [] [] [] |
gpe-su | [] [] [] [] [] [] [] [] |
gpe-taskmanager | [] [] [] [] [] [] [] [] |
gpe-timesheet | [] [] [] [] [] [] [] [] |
gpe-today | [] [] [] [] [] [] [] [] |
gpe-todo | [] [] [] [] [] |
gphoto2 | [] [] [] [] [] [] [] [] |
gprof | [] [] [] |
gpsdrive | [] [] |
gramadoir | [] [] |
grep | [] [] [] [] |
grub | [] [] [] |
gsasl | [] [] [] [] |
gss | [] [] [] |
gst-plugins-bad | [] [] [] [] [] |
gst-plugins-base | [] [] [] [] [] |
gst-plugins-good | [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] |
gtick | [] [] [] |
gtkam | [] [] [] [] [] [] |
gtkorphan | [] |
gtkspell | [] [] [] [] [] [] [] [] [] [] |
gutenprint | [] [] |
hello | [] [] [] [] |
help2man | [] [] |
hylafax | [] |
idutils | [] [] [] [] [] |
indent | [] [] [] [] [] [] [] |
iso_15924 | [] [] [] [] |
iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] |
iso_3166_2 | [] [] [] |
iso_4217 | [] [] [] [] [] [] [] [] |
iso_639 | [] [] [] [] [] [] [] [] [] |
iso_639_3 | [] [] |
jwhois | [] [] [] [] |
kbd | [] [] [] |
keytouch | [] [] [] |
keytouch-editor | [] [] [] |
keytouch-keyboa... | [] [] [] |
klavaro | [] [] |
latrine | [] [] |
ld | |
leafpad | [] [] [] [] [] [] [] [] [] |
libc | [] [] [] [] |
libexif | [] [] () [] |
libextractor | |
libgnutls | [] [] |
libgpewidget | [] [] [] |
libgpg-error | [] [] |
libgphoto2 | [] [] |
libgphoto2_port | [] [] [] [] |
libgsasl | [] [] [] [] [] |
libiconv | [] [] [] [] [] |
libidn | [] [] |
lifelines | [] [] |
liferea | [] [] [] [] [] () () [] |
lilypond | [] |
linkdr | [] [] [] |
lordsawar | |
lprng | [] |
lynx | [] [] [] |
m4 | [] [] [] [] [] |
mailfromd | [] |
mailutils | [] |
make | [] [] [] [] |
man-db | [] [] [] |
man-db-manpages | [] [] [] |
minicom | [] [] [] [] |
mkisofs | [] [] [] |
myserver | |
nano | [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] [] |
pies | [] |
popt | [] [] [] [] |
psmisc | [] [] [] |
pspp | [] [] |
pwdutils | [] |
radius | [] [] [] |
recode | [] [] [] [] [] [] [] [] |
rosegarden | () () |
rpm | [] [] [] |
rush | [] [] |
sarg | |
screem | |
scrollkeeper | [] [] [] [] [] [] [] [] |
sed | [] [] [] [] [] [] [] [] [] |
sharutils | [] [] [] [] |
shishi | [] |
skencil | [] [] |
solfege | [] [] [] [] |
solfege-manual | [] [] [] |
soundtracker | [] |
sp | |
sysstat | [] [] [] [] |
tar | [] [] [] [] |
texinfo | [] [] [] [] |
tin | [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux-ng | [] [] [] [] [] |
vice | [] |
vmm | [] |
vorbis-tools | [] [] |
wastesedge | [] |
wdiff | [] [] |
wget | [] [] [] [] [] [] [] |
wyslij-po | [] [] [] |
xchat | [] [] [] [] [] [] [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] [] |
+---------------------------------------------------+
nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
135 10 4 7 105 1 29 61 47 91 3 55 47 8 37
sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
+---------------------------------------------------+
a2ps | [] [] [] [] [] | 27
aegis | [] | 9
ant-phone | [] [] [] [] | 9
anubis | [] [] [] [] | 15
aspell | [] [] [] | 20
bash | [] [] | 11
bfd | [] | 6
bibshelf | [] [] [] | 16
binutils | [] [] | 8
bison | [] [] | 12
bison-runtime | [] [] [] [] [] [] | 29
bluez-pin | [] [] [] [] [] [] [] [] | 37
bombono-dvd | [] | 4
buzztard | [] | 7
cflow | [] [] [] | 9
clisp | | 10
coreutils | [] [] [] [] | 22
cpio | [] [] [] [] [] [] | 13
cppi | [] [] | 5
cpplib | [] [] [] [] [] [] | 13
cryptsetup | [] [] | 7
dfarc | [] | 9
dialog | [] [] [] [] [] [] [] | 30
dico | [] | 2
diffutils | [] [] [] [] [] [] | 30
dink | | 4
doodle | [] [] | 7
e2fsprogs | [] [] [] | 11
enscript | [] [] [] [] | 17
exif | [] [] [] | 16
fetchmail | [] [] [] | 17
findutils | [] [] [] [] [] | 20
flex | [] [] [] [] | 15
freedink | [] | 10
gas | [] | 4
gawk | [] [] [] [] | 18
gcal | [] [] | 5
gcc | [] [] [] | 7
gettext-examples | [] [] [] [] [] [] [] | 34
gettext-runtime | [] [] [] [] [] [] [] | 30
gettext-tools | [] [] [] [] [] [] | 22
gip | [] [] [] [] | 22
gjay | [] | 3
gliv | [] [] [] | 14
glunarclock | [] [] [] [] [] | 19
gnubiff | [] [] | 4
gnucash | () [] () () | 9
gnuedu | [] [] | 7
gnulib | [] [] [] [] | 16
gnunet | [] | 1
gnunet-gtk | [] [] [] | 5
gnutls | [] [] [] | 10
gold | [] | 4
gpe-aerial | [] [] [] | 18
gpe-beam | [] [] [] | 19
gpe-bluetooth | [] [] [] | 13
gpe-calendar | [] [] [] [] | 12
gpe-clock | [] [] [] [] [] | 28
gpe-conf | [] [] [] [] | 20
gpe-contacts | [] [] [] | 17
gpe-edit | [] [] [] | 12
gpe-filemanager | [] [] [] [] | 16
gpe-go | [] [] [] [] [] | 25
gpe-login | [] [] [] | 11
gpe-ownerinfo | [] [] [] [] [] | 25
gpe-package | [] [] [] | 13
gpe-sketchbook | [] [] [] | 20
gpe-su | [] [] [] [] [] | 30
gpe-taskmanager | [] [] [] [] [] | 29
gpe-timesheet | [] [] [] [] [] | 25
gpe-today | [] [] [] [] [] [] | 30
gpe-todo | [] [] [] [] | 17
gphoto2 | [] [] [] [] [] | 24
gprof | [] [] [] | 15
gpsdrive | [] [] [] | 11
gramadoir | [] [] [] | 11
grep | [] [] [] | 10
grub | [] [] [] | 14
gsasl | [] [] [] [] | 14
gss | [] [] [] | 11
gst-plugins-bad | [] [] [] [] | 22
gst-plugins-base | [] [] [] [] [] | 24
gst-plugins-good | [] [] [] [] [] | 25
gst-plugins-ugly | [] [] [] [] [] | 29
gstreamer | [] [] [] [] | 22
gtick | [] [] [] | 13
gtkam | [] [] [] | 20
gtkorphan | [] [] [] | 14
gtkspell | [] [] [] [] [] [] [] [] [] | 45
gutenprint | [] | 10
hello | [] [] [] [] [] [] | 21
help2man | [] [] | 7
hylafax | [] | 5
idutils | [] [] [] [] | 17
indent | [] [] [] [] [] [] | 30
iso_15924 | () [] () [] [] | 16
iso_3166 | [] [] () [] [] () [] [] [] () | 53
iso_3166_2 | () [] () [] | 9
iso_4217 | [] () [] [] () [] [] | 26
iso_639 | [] [] [] () [] () [] [] [] [] | 38
iso_639_3 | [] () | 8
jwhois | [] [] [] [] [] | 16
kbd | [] [] [] [] [] | 15
keytouch | [] [] [] | 16
keytouch-editor | [] [] [] | 14
keytouch-keyboa... | [] [] [] | 14
klavaro | [] | 11
latrine | [] [] [] | 10
ld | [] [] [] [] | 11
leafpad | [] [] [] [] [] [] | 33
libc | [] [] [] [] [] | 21
libexif | [] () | 6
libextractor | [] | 1
libgnutls | [] [] [] | 9
libgpewidget | [] [] [] | 14
libgpg-error | [] [] [] | 9
libgphoto2 | [] [] | 8
libgphoto2_port | [] [] [] [] | 13
libgsasl | [] [] [] | 13
libiconv | [] [] [] [] | 21
libidn | () [] [] | 11
lifelines | [] | 4
liferea | [] [] [] | 21
lilypond | [] | 7
linkdr | [] [] [] [] [] | 17
lordsawar | | 1
lprng | [] | 3
lynx | [] [] [] [] | 17
m4 | [] [] [] [] | 19
mailfromd | [] [] | 3
mailutils | [] | 5
make | [] [] [] [] | 21
man-db | [] [] [] | 8
man-db-manpages | | 4
minicom | [] [] | 16
mkisofs | [] [] | 9
myserver | | 0
nano | [] [] [] [] | 21
opcodes | [] [] [] | 11
parted | [] [] [] [] [] | 15
pies | [] [] | 3
popt | [] [] [] [] [] [] | 27
psmisc | [] [] | 11
pspp | | 4
pwdutils | [] [] | 6
radius | [] [] | 9
recode | [] [] [] [] | 28
rosegarden | () | 0
rpm | [] [] [] | 11
rush | [] [] | 4
sarg | | 1
screem | [] | 3
scrollkeeper | [] [] [] [] [] | 27
sed | [] [] [] [] [] | 30
sharutils | [] [] [] [] [] | 22
shishi | [] | 3
skencil | [] [] | 7
solfege | [] [] [] [] | 16
solfege-manual | [] | 8
soundtracker | [] [] [] | 9
sp | [] | 3
sysstat | [] [] | 15
tar | [] [] [] [] [] [] | 23
texinfo | [] [] [] [] | 16
tin | | 4
unicode-han-tra... | | 0
unicode-transla... | | 2
util-linux-ng | [] [] [] [] | 20
vice | () () | 1
vmm | [] | 4
vorbis-tools | [] | 6
wastesedge | | 2
wdiff | [] [] | 7
wget | [] [] [] [] [] | 26
wyslij-po | [] [] | 8
xchat | [] [] [] [] [] [] | 36
xdg-user-dirs | [] [] [] [] [] [] [] [] [] | 60
xkeyboard-config | [] [] [] [] | 25
+---------------------------------------------------+
84 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
178 domains 119 1 3 2 0 10 66 50 155 17 97 7 41 2610
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
If May 2010 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
matrix with full percentage details can be found at
`http://translationproject.org/extra/matrix.html'.
1.6 Using `gettext' in new packages
===================================
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
package. Of course you have to respect the GNU Library General Public
License which covers the use of the GNU `gettext' library. This means
in particular that even non-free programs can use `libintl' as a shared
library, whereas only free software can use `libintl' as a static
library or use modified versions of `libintl'.
Once the sources are changed appropriately and the setup can handle
the use of `gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
`coordinator@translationproject.org' to make the `.pot' files available
to the translation teams.
gdbm-1.18.1/TODO 0000644 0001750 0001750 00000000771 13315177665 010147 0000000 0000000 Current:
GDBM_FILE gdbm_open (const char *file,
int block_size,
int flags,
int mode,
void (*fatal_func) (const char *))
Planned:
GDBM_FILE gdbm_open_X (const char *file, int flags);
GDBM_FILE gdbm_creat_X (const char *file, int flags, int block_size);
GDBM_FILE gdbm_open_Y (const char *file, int flags, ...);
enum {
GDBM_OPEN_FD,
GDBM_OPEN_BLOCK_SIZE,
GDBM_OPEN_CREAT_MODE,
GDBM_OPEN_FATAL_FUNC,
}
gdbm-1.18.1/Makefile.am 0000644 0001750 0001750 00000004111 13301476720 011470 0000000 0000000 # This file is part of GDBM. -*- Makefile -*-
# Copyright (C) 2007, 2011, 2013, 2016-2018 Free Software Foundation,
# Inc.
#
# GDBM is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GDBM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GDBM. If not, see . */
EXTRA_DIST = build-aux/config.rpath NOTE-WARNING git2chg.awk
if COMPAT_OPT
MAYBE_COMPAT = compat
endif
SUBDIRS = po src doc $(MAYBE_COMPAT) tests
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-libgdbm-compat
.PHONY: set-dist-date
set-dist-date:
rm -f $(distdir)/src/version.c; \
d=`date '+%d/%m/%Y'`; \
sed 's|/\*@DIST_DATE@\*/|"'"$$d"'"|' $(srcdir)/src/version.c > \
$(distdir)/src/version.c
dist-hook: ChangeLog set-dist-date
@if test -f ChangeLog && test -f NEWS; then \
PATCHLEV=`echo "$(PACKAGE_VERSION)" | sed -r "s/[0-9]+\.[0-9]+\.?//"`;\
if test $${PATCHLEV:-0} -lt 50; then \
if grep -q FIXME NEWS; then \
echo >&2 "*** NEWS file contains FIXMEs"; \
echo >&2 "*** Aborting"; \
exit 1; \
fi; \
fi; \
fi
gen_start_date = 2016-07-08
prev_change_log = ChangeLog.cvs
.PHONY: ChangeLog
ChangeLog:
$(AM_V_GEN)if test -d .git; then \
git log --pretty='format:%ct %an <%ae>%n%n%s%n%n%b%n' \
--since=$(gen_start_date) | \
awk -f $(top_srcdir)/git2chg.awk \
-v append=$(top_srcdir)/$(prev_change_log) > ChangeLog; \
fi
gdbm-1.18.1/autoconf.h.in 0000644 0001750 0001750 00000011160 13364776061 012044 0000000 0000000 /* autoconf.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
/* TLS qualifier */
#undef GDBM_THREAD_LOCAL
/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
CoreFoundation framework. */
#undef HAVE_CFLOCALECOPYCURRENT
/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
the CoreFoundation framework. */
#undef HAVE_CFPREFERENCESCOPYAPPVALUE
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
#undef HAVE_DCGETTEXT
/* Define to 1 if you have the header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `flock' function. */
#undef HAVE_FLOCK
/* Define to 1 if you have the `fsync' function. */
#undef HAVE_FSYNC
/* Define to 1 if you have the `ftruncate' function. */
#undef HAVE_FTRUNCATE
/* Define to 1 if you have the header file. */
#undef HAVE_GETOPT_H
/* Define to 1 if you have the `getopt_long' function. */
#undef HAVE_GETOPT_LONG
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
/* Define if you have the iconv() function and it works. */
#undef HAVE_ICONV
/* Define to 1 if you have the header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `dbm' library (-ldbm). */
#undef HAVE_LIBDBM
/* Define to 1 if you have the `ndbm' library (-lndbm). */
#undef HAVE_LIBNDBM
/* Define to 1 if you have the header file. */
#undef HAVE_LOCALE_H
/* Define to 1 if you have the `lockf' function. */
#undef HAVE_LOCKF
/* Define to 1 if you have the header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define to 1 if you have the `msync' function. */
#undef HAVE_MSYNC
/* Define to 1 if you have the header file. */
#undef HAVE_READLINE_READLINE_H
/* Define to 1 if you have the `rl_completion_matches' function. */
#undef HAVE_RL_COMPLETION_MATCHES
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
/* Define to 1 if you have the header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRING_H
/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_FILE_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_TERMIOS_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if the system has the type `unsigned long long int'. */
#undef HAVE_UNSIGNED_LONG_LONG_INT
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `off_t', as computed by sizeof. */
#undef SIZEOF_OFF_T
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Enable use of readline */
#undef WITH_READLINE
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#undef YYTEXT_POINTER
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `long int' if does not define. */
#undef off_t
gdbm-1.18.1/doc/ 0000755 0001750 0001750 00000000000 13364776741 010303 5 0000000 0000000 gdbm-1.18.1/doc/fdl.texi 0000644 0001750 0001750 00000056026 13237505627 011664 0000000 0000000 @c The GNU Free Documentation License.
@center Version 1.3, 3 November 2008
@c This file is intended to be included within another document,
@c hence no sectioning command or @node.
@display
Copyright @copyright{} 2000-2002, 2007-2008, 2011, 2017-2018 Free
Software Foundation, Inc.
@uref{http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document @dfn{free} in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
@item
APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The ``Document'', below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as ``you''. You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A ``Secondary Section'' is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject. (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
@sc{ascii} without markup, Texinfo input format, La@TeX{} input
format, @acronym{SGML} or @acronym{XML} using a publicly available
@acronym{DTD}, and standard-conforming simple @acronym{HTML},
PostScript or @acronym{PDF} designed for human modification. Examples
of transparent image formats include @acronym{PNG}, @acronym{XCF} and
@acronym{JPG}. Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, @acronym{SGML} or
@acronym{XML} for which the @acronym{DTD} and/or processing tools are
not generally available, and the machine-generated @acronym{HTML},
PostScript or @acronym{PDF} produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
The ``publisher'' means any person or entity that distributes copies
of the Document to the public.
A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as ``Acknowledgements'',
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
@item
VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
@item
COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
@item
MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
@enumerate A
@item
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
@item
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
@item
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
@item
Preserve all the copyright notices of the Document.
@item
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
@item
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
@item
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
@item
Include an unaltered copy of this License.
@item
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
@item
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@item
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
Do not retitle any existing section to be Entitled ``Endorsements'' or
to conflict in title with any Invariant Section.
@item
Preserve any Warranty Disclaimers.
@end enumerate
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
@item
COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled ``History''
in the various original documents, forming one section Entitled
``History''; likewise combine any sections Entitled ``Acknowledgements'',
and any sections Entitled ``Dedications''. You must delete all
sections Entitled ``Endorsements.''
@item
COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
@item
TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
@item
TERMINATION
You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense, or distribute it is void, and
will automatically terminate your rights under this License.
However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, receipt of a copy of some or all of the same material does
not give you any rights to use it.
@item
FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
@uref{http://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation. If the Document
specifies that a proxy can decide which future versions of this
License can be used, that proxy's public statement of acceptance of a
version permanently authorizes you to choose that version for the
Document.
@item
RELICENSING
``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works. A
public wiki that anybody can edit is an example of such a server. A
``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
site means any set of copyrightable works thus published on the MMC
site.
``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.
``Incorporate'' means to publish or republish a Document, in whole or
in part, as part of another Document.
An MMC is ``eligible for relicensing'' if it is licensed under this
License, and if all works that were first published under this License
somewhere other than this MMC, and subsequently incorporated in whole
or in part into the MMC, (1) had no cover texts or invariant sections,
and (2) were thus incorporated prior to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the site
under CC-BY-SA on the same site at any time before August 1, 2009,
provided the MMC is eligible for relicensing.
@end enumerate
@page
@heading ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
@smallexample
@group
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the ``with@dots{}Texts.'' line with this:
@smallexample
@group
with the Invariant Sections being @var{list their titles}, with
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
being @var{list}.
@end group
@end smallexample
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:
gdbm-1.18.1/doc/stamp-vti 0000644 0001750 0001750 00000000136 13364776113 012063 0000000 0000000 @set UPDATED 1 July 2018
@set UPDATED-MONTH July 2018
@set EDITION 1.18.1
@set VERSION 1.18.1
gdbm-1.18.1/doc/gdbmtool.1 0000644 0001750 0001750 00000033257 13314754542 012114 0000000 0000000 .\" This file is part of GDBM. -*- nroff -*-
.\" Copyright (C) 2013, 2016-2018 Free Software Foundation, Inc.
.\"
.\" GDBM is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 3, or (at your option)
.\" any later version.
.\"
.\" GDBM is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with GDBM. If not, see . */
.TH GDBMTOOL 1 "June 27, 2018" "GDBM" "GDBM User Reference"
.SH NAME
gdbmtool \- examine and modify a GDBM database
.SH SYNOPSIS
\fBgdbmtool\fR\
[\fB\-lmNnqrs\fR]\
[\fB\-b\fR \fISIZE\fR]\
[\fB\-c\fR \fISIZE\fR]\
[\fB\-f\fR \fIFILE\fR]\
[\fB\-\-block\-size\fR=\fISIZE\fR]\
[\fB\-\-cache\-size\fR=\fISIZE\fR]\
[\fB\-\-file\fR \fIFILE\fR]\
[\fB\-\-newdb\fR]\
[\fB\-\-no\-lock\fR]\
[\fB\-\-no\-mmap\fR]\
[\fB\-\-norc\fR]\
[\fB\-\-quiet\fR]\
[\fB\-\-read\-only\fR]\
[\fB\-\-synchronize\fR]\
[\fIDBFILE\fR] [\fICOMMAND\fR [; \fICOMMAND\fR...]]
.sp
\fBgdbmtool\fR\
[\fB\-Vh\fR]\
[\fB\-\-help\fR]\
[\fB\-\-usage\fR]\
[\fB\-\-version\fR]
.SH DESCRIPTION
The
.B gdbmtool
utility allows you to view and modify an existing GDBM database or to
create a new one.
.PP
The \fIDBFILE\fR argument supplies the name of the database to open.
If not supplied, the default name
.B junk.gdbm
is used instead.
If the named database does not exist, it will be created. An existing
database can be cleared (i.e. all records removed from it) using the
\fB\-\-newdb\fR option (see below).
.PP
Unless the \fB\-N\fR (\fB\-\-norc\fR) option is given, after startup
.B gdbmtool
looks for file named
.B .gdbmtoolrc
first in the current working directory, and, if not found there, in
the home directory of the user who started the program. If found,
this file is read and interpreted as a list of
.B gdbmtool
commands.
.PP
Then
.B gdbmtool
starts a loop, in which it reads
commands from the standard input, executes them and prints the results on the
standard output. If the standard input is attached to a console,
the program runs in interactive mode.
.PP
The program terminates when the
.B quit
command is given, or end-of-file is detected on its standard input.
.PP
Commands can also be specified in the command line, after the \fIDBFILE\fR
argument. In this case, they will be interpreted without attempting to
read more commands from the standard input.
.PP
If several commands are supplied, they must be separated by
semicolons (properly escaped or quoted, in order to prevent them from
being interpreted by the shell).
.PP
A
.B gdbmtool
command consists of a command verb, optionally
followed by one or more arguments, separated by any amount of white
space. A command verb can be entered either in full or in an
abbreviated form, as long as that abbreviation does not match any other
verb.
.PP
Any sequence of non-whitespace characters appearing after the command
verb forms an argument. If the argument contains whitespace or
unprintable characters it must be enclosed in double quotes. Within
double quotes the usual escape sequences are understood, as
shown in the table below:
.sp
.nf
.ta 8n 20n
.ul
Escape Expansion
\\a Audible bell character (ASCII 7)
\\b Backspace character (ASCII 8)
\\f Form-feed character (ASCII 12)
\\n Newline character (ASCII 10)
\\r Carriage return character (ASCII 13)
\\t Horizontal tabulation character (ASCII 9)
\\v Vertical tabulation character (ASCII 11)
\\\\ Single slash
\" Double quote
.fi
.PP
In addition, a backslash immediately followed by the end-of-line
character effectively removes that character, allowing to split long
arguments over several input lines.
.SH OPTIONS
.TP
\fB\-b\fR, \fB\-\-block\-size\fR=\fISIZE\fR
Set block size.
.TP
\fB\-c\fR, \fB\-\-cache\-size\fR=\fISIZE\fR
Set cache size.
.TP
\fB\-f\fR, \fB\-\-file\fR=\fIFILE\fR
Read commands from \fIFILE\fR, instead of from the standard input.
.TP
\fB\-l\fR, \fB\-\-no\-lock\fR
Disable file locking.
.TP
\fB\-m\fR, \fB\-\-no\-mmap\fR
Do not use
.BR mmap (2).
.TP
\fB\-n\fR, \fB\-\-newdb\fR
Create the database, truncating it if it already exists.
.TP
\fB\-q\fR, \fB\-\-quiet\fR
Don't print initial banner.
.TP
\fB\-r\fR, \fB\-\-read\-only\fR
Open database in read-only mode.
.TP
\fB\-s\fR, \fB\-\-synchronize\fR
Synchronize to disk after each write.
.TP
\fB\-h\fR, \fB\-\-help\fR
Print a short usage summary.
.TP
\fB\-\-usage\fR
Print a list of available options.
.TP
\fB\-V\fR, \fB\-\-version\fR
Print program version
.SH SHELL COMMANDS
.TP
.BR avail
Print the
.BR "avail list" .
.TP
\fBbucket\fR \fINUM\fR
Print the bucket number \fINUM\fR and set is as the current one.
.TP
.BR cache
Print the bucket cache.
.TP
.B close
Close the currently open database.
.TP
.BR count
Print the number of entries in the database.
.TP
.BR current
Print the current bucket.
.TP
\fBdelete\fR \fIKEY\fR
Delete record with the given \fIKEY\fR.
.TP
.BR dir
Print hash directory.
.TP
\fBexport\fR \fIFILE\-NAME\fR [\fBtruncate\fR] [\fBbinary\fR|\fBascii\fR]
Export the database to the flat file \fIFILE\-NAME\fR. This is equivalent to
.BR gdbm_dump (1).
This command will not overwrite an existing file, unless the
.B truncate
parameter is also given. Another optional parameter determines the type of
the dump (*note Flat files::). By default, ASCII dump will be created.
.TP
\fBfetch\fR \fIKEY\fR
Fetch and display the record with the given \fIKEY\fR.
.TP
.BR first
Fetch and display the first record in the database. Subsequent
records can be fetched using the
.B next
command (see below).
.TP
\fBhash\fR \fIKEY\fR
Compute and display the hash value for the given \fIKEY\fR.
.TP
.BR header
Print file header.
.TP
.BR help " or " ?
Print a concise command summary, showing each command letter and
verb with its parameters and a short description of what it does.
Optional arguments are enclosed in square brackets.
.TP
.B history
Shows the command history list with line numbers. This command is
available only if the program was compiled with GNU Readline.
.TP
\fBhistory\fR \fICOUNT\fR.
Shows \fICOUNT\fR latest commands from the command history.
.TP
\fBhistory\fR \fIN\fR \fICOUNT\fR.
Shows \fICOUNT\fR commands from the command history starting with \fIN\fRth
command.
.TP
\fBimport\fR \fIFILE\-NAME\fR [\fBreplace\fR] [\fBnometa\fR]
Import data from a flat dump file \fIFILE\-NAME\fR.
If the
.B replace
argument is given, any records with the same keys as the already
existing ones will replace them. The
.B nometa
argument turns off restoring meta-information from the dump file.
.TP
\fBlist\fR
List the contents of the database.
.TP
\fBnext\fR [\fIKEY\fR]
Sequential access: fetch and display the next record. If the \fIKEY\fR is
given, the record following the one with this key will be fetched.
.TP
\fBopen\fR \fIFILE\fR
Open the database file \fIFILE\fR. If successful, any previously
open database is closed. Otherwise, if the operation fails, the
currently opened database remains unchanged.
This command takes additional information from the variables
.BR open ,
.BR lock ,
.BR mmap ", and"
.BR sync .
See the section
.BR VARIABLES ,
for a detailed description of these.
.TP
.B quit
Close the database and quit the utility.
.TP
.BR reorganize
Reorganize the database.
.TP
\fBset\fR [\fIVAR\fR=\fIVALUE\fR...]
Without arguments, lists variables and their values. If arguments are
specified, sets variables. Boolean variables can be set by specifying
variable name, optionally prefixed with \fBno\fR, to set it to \fBfalse\fR.
.TP
\fBsource\fR \fIFILE\fR
Read commands from the given \fIFILE\fR.
.TP
.BR status
Print current program status.
.TP
\fBstore\fR \fIKEY\fR \fIDATA\fR
Store the \fIDATA\fR with the given \fIKEY\fR in the database. If the
\fIKEY\fR already exists, its data will be replaced.
.TP
\fBunset\fR \fIVARIABLE\fR...
Unsets listed variables.
.TP
.BR version
Print the version of
.BR gdbm .
.SH "DATA DEFINITIONS"
The \fBdefine\fR statement provides a mechanism for defining key or
content structures. It is similar to the \fBC\fR \fBstruct\fR
declaration:
.sp
.nf
.in +4
\fBdefine\fR \fBkey\fR|\fBcontent\fR \fB{\fR \fIdefnlist\fR \fB}\fR
.in
.fi
.PP
The \fIdefnlist\fR is a comma-separated list of member declarations.
Within \fIdefnlist\fR the newline character looses its special meaning
as the command terminator, so each declaration can appear on a
separate line and arbitrary number of comments can be inserted to
document the definition.
.PP
Each declaration has one of the following formats
.sp
.nf
.in +4
\fItype\fR \fIname\fR
\fItype\fR \fIname\fR \fB[\fIN\fB]\fR
.in
.fi
.sp
where \fItype\fR is a data type and \fIname\fR is the member name.
The second format defines the member \fIname\fR as an array of \fIN\fR
elements of \fItype\fR.
.PP
The supported types are:
.sp
.nf
.ta 8n 20n
.ul
type meaning
char single byte (signed)
short signed short integer
ushort unsigned short integer
int signed integer
unsigned unsigned integer
uint ditto
long signed long integer
ulong unsigned long integer
llong signed long long integer
ullong unsigned long long integer
float a floating point number
double double-precision floating point number
string array of characters (see the \fBNOTE\fR below)
stringz null-terminated string of characters
.fi
.PP
The following alignment declarations can be used within \fIdefnlist\fR:
.TP
\fBoffset\fR \fIN\fR
The next member begins at offset \fIN\fR.
.TP
\fBpad\fR \fIN\fR
Add \fIN\fR bytes of padding to the previous member.
.PP
For example:
.sp
.nf
.in +4
\fBdefine content {
int status,
pad 8,
char id[3],
stringz name
}\fR
.fi
.PP
To define data consisting of a single data member, the following
simplified construct can be used:
.sp
.nf
.in +4
\fBdefine\fR \fBkey\fR|\fBcontent\fR \fItype\fR
.fi
.PP
where \fItype\fR is one of the types discussed above.
.PP
\fBNOTE\fR: The \fBstring\fR type can reasonably be used only if it is
the last or the only member of the data structure. That's because it
provides no information about the number of elements in the array, so
it is interpreted to contain all bytes up to the end of the datum.
.SH VARIABLES
.TP
.BR confirm ", boolean"
Whether to ask for confirmation before certain destructive operations,
such as truncating the existing database. Default is
.BR true .
.TP
.BR ps1 ", string"
Primary prompt string. Its value can contain \fIconversion
specifiers\fR, consisting of the \fB%\fR character followed by another
character. These specifiers are expanded in the resulting prompt as
follows:
.sp
.nf
.ta 8n 20n
.ul
Sequence Expansion
\fB%f\fR name of the db file
\fB%p\fR program name
\fB%P\fR package name (\fBgdbm\fR)
\fB%_\fR horizontal space (\fBASCII\fR 32)
\fB%v\fR program version
\fB%%\fR \fB%\fR
.fi
.sp
The default prompt is \fB%p>%_\fR.
.TP
.BR ps2 ", string"
Secondary prompt. See
.B ps1
for a description of its value.
This prompt is displayed before reading the second and subsequent
lines of a multi-line command.
The default value is \fB%_>%_\fR.
.TP
.BR delim1 ", string"
A string used to delimit fields of a structured datum on output
(see the section \fBDATA DEFINITIONS\fR).
Default is \fB,\fR (a comma). This variable cannot be unset.
.TP
.BR delim2 ", string"
A string used to delimit array items when printing a structured datum.
Default is \fB,\fR (a comma). This variable cannot be unset.
.TP
.BR pager ", string"
The name and command line of the pager program to pipe output to.
This program is used in interactive mode when the estimated number of
output lines is greater then the number of lines on your screen.
The default value is inherited from the environment variable
\fBPAGER\fR. Unsetting this variable disables paging.
.TP
.BR quiet ", boolean"
Whether to display welcome banner at startup. This variable should
be set in a startup script file.
.PP
The following variables control how the database is opened:
.TP
.BR cachesize ", numeric"
Sets the cache size. By default this variable is not set.
.TP
.BR blocksize ", numeric"
Sets the block size. Unset by default.
.TP
.BR open ", string"
Open mode. The following values are allowed:
.RS 7
.TP
.BR newdb
Truncate the database if it exists or create a new one. Open it in
read-write mode.
.TP
.BR wrcreat " or " rw
Open the database in read-write mode. Create it if it does not
exist. This is the default.
.TP
.BR reader " or " readonly
Open the database in read-only mode. Signal an error if it does not
exist.
.RE
.TP
.BR filemode ", octal"
Sets the file mode for newly created database files. Default is 0644.
.TP
.BR lock ", boolean"
Lock the database. This is the default.
.TP
.BR mmap ", boolean"
Use memory mapping. This is the default.
.TP
.BR coalesce ", boolean"
When set, this option causes adjacent free blocks to be merged which
allows for more efficient memory management at the expense of a
certain increase in CPU usage.
.TP
.BR centfree ", boolean"
Enables central free block pool. This causes all free blocks of space
to be placed in the global pool, thereby speeding up the allocation of
data space.
.SH "SEE ALSO"
.BR gdbm_dump (1),
.BR gdbm_load (1),
.BR gdbm (3).
.SH "REPORTING BUGS"
Report bugs to .
.SH COPYRIGHT
Copyright \(co 2013-2018 Free Software Foundation, Inc
.br
.na
License GPLv3+: GNU GPL version 3 or later
.br
.ad
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.\" Local variables:
.\" eval: (add-hook 'write-file-hooks 'time-stamp)
.\" time-stamp-start: ".TH GDBM[A-Z_-]* 1 \""
.\" time-stamp-format: "%:B %:d, %:y"
.\" time-stamp-end: "\""
.\" time-stamp-line-limit: 20
.\" end:
gdbm-1.18.1/doc/Makefile.am 0000644 0001750 0001750 00000004700 13237505627 012250 0000000 0000000 # This file is part of GDBM. -*- Makefile -*-
# Copyright (C) 2007, 2011, 2014-2018 Free Software Foundation, Inc.
#
# GDBM is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GDBM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GDBM. If not, see . */
# Documentation
info_TEXINFOS = gdbm.texi
gdbm_TEXINFOS=\
fdl.texi
dist_man_MANS = gdbm.3 gdbm_dump.1 gdbm_load.1 gdbmtool.1
GENDOCS=$(srcdir)/gendocs.sh --no-copy-images --html '--init-file=$(abs_srcdir)/html.init'
TEXI2DVI=texi2dvi -t '@set $(RENDITION)'
# Make sure you set TEXINPUTS.
# TEXINPUTS=/usr/share/texmf/pdftex/plain/misc/ is ok for most distributions
.PHONY: manual
manual:
TEXINPUTS=$(srcdir):$(top_srcdir)/build-aux:$(TEXINPUTS) \
MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
TEXI2DVI="$(TEXI2DVI) -t @finalout" \
$(GENDOCS) --no-copy-images $(PACKAGE) '$(PACKAGE_NAME) manual'
# Checking
check-tabs:
@if test -n "`cat $(info_TEXINFOS) $(gdbm_TEXINFOS) | tr -d -c '\t'`"; then \
echo "Sources contain tabs; run make untabify"; \
false; \
fi
check-sentence-spacing:
@if grep -q '\. [@A-Z]' $(info_TEXINFOS) $(gdbm_TEXINFOS); then \
echo >&2 "Sources contain single-space sentence separators"; \
echo >&2 "Run make fix-sentence-spacing to fix"; \
fi
check-fixmes:
@for file in $(info_TEXINFOS) $(gdbm_TEXINFOS); \
do \
sed -e = $$file | \
sed -n 'N;/@c *FIXME:/{s/\(^[0-9][0-9]*\).*@c *FIXME:\(.*\)/'$$file':\1: \2/gp}'; \
done > $@-t; \
if [ -s $@-t ]; then \
echo "Unresolved FIXMEs:"; \
cat $@-t; \
rm $@-t; \
false; \
else \
rm -f $@-t; \
fi
check-format: check-tabs check-sentence-spacing
check-docs: check-format check-fixmes
untabify:
emacs -batch -l untabify.el $(info_TEXINFOS) $(gdbm_TEXINFOS)
fix-sentence-spacing:
for file in $(info_TEXINFOS) $(gdbm_TEXINFOS); \
do \
if grep -q '\. [@A-Z]' $$file; then \
mv $$file $${file}~; \
sed -r 's/\. ([@A-Z])/. \1/g' $${file}~ > $$file; \
fi; \
done
final: untabify fix-sentence-spacing
gdbm-1.18.1/doc/gdbm.info 0000644 0001750 0001750 00000420507 13364776123 012013 0000000 0000000 This is gdbm.info, produced by makeinfo version 5.9.93 from gdbm.texi.
Published by the Free Software Foundation, 51 Franklin Street, Fifth
Floor Boston, MA 02110-1301, USA
Copyright (C) 1989-1999, 2007-2018 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover, and no Back-Cover texts. A copy of
the license is included in the section entitled "GNU Free Documentation
License."
INFO-DIR-SECTION Programming & development tools
START-INFO-DIR-ENTRY
* GDBM: (gdbm). The GNU database manager.
* gdbm_dump: (gdbm) gdbm_dump. Dump the GDBM database into a flat file.
* gdbm_load: (gdbm) gdbm_load. Load the database from a flat file.
* gdbmtool: (gdbm) gdbmtool. Examine and modify a GDBM database.
END-INFO-DIR-ENTRY
File: gdbm.info, Node: Top, Next: Copying, Up: (dir)
The GNU database manager.
*************************
GNU 'dbm' is a library of functions implementing a hashed database on a
disk file. This manual documents GNU 'dbm' Version 1.18.1 ('gdbm').
The software was originally written by Philip A. Nelson. This document
was originally written by Pierre Gaumond from texts written by Phil.
* Menu:
Introduction:
* Copying:: Your rights.
* Intro:: Introduction to GNU dbm.
* List:: List of functions.
Functions:
* Open:: Opening the database.
* Close:: Closing the database.
* Count:: Counting records in the database.
* Store:: Inserting and replacing records in the database.
* Fetch:: Searching records in the database.
* Delete:: Removing records from the database.
* Sequential:: Sequential access to records.
* Reorganization:: Database reorganization.
* Sync:: Insure all writes to disk have competed.
* Flat files:: Export and import to Flat file format.
* Errors:: Error handling.
* Recovery:: Recovery from fatal errors.
* Options:: Setting internal options.
* Locking:: File locking.
* Variables:: Useful global variables.
* Error codes:: Error codes returned by 'gdbm' calls.
* Compatibility:: Compatibility with UNIX dbm and ndbm.
Programs
* gdbmtool:: Examine and modify a GDBM database.
* gdbm_dump:: Dump the database into a flat file.
* gdbm_load:: Load the database from a flat file.
* Exit codes:: Exit codes returned by GDBM utilities.
Other topics:
* Bugs:: Problems and bugs.
* Resources:: Additional resources,
* GNU Free Documentation License:: Document license.
* Index:: Index
File: gdbm.info, Node: Copying, Next: Intro, Prev: Top, Up: Top
1 Copying Conditions.
*********************
This library is "free"; this means that everyone is free to use it and
free to redistribute it on a free basis. GNU 'dbm' ('gdbm') is not in
the public domain; it is copyrighted and there are restrictions on its
distribution, but these restrictions are designed to permit everything
that a good cooperating citizen would want to do. What is not allowed
is to try to prevent others from further sharing any version of 'gdbm'
that they might get from you.
Specifically, we want to make sure that you have the right to give
away copies 'gdbm', that you receive source code or else can get it if
you want it, that you can change these functions or use pieces of them
in new free programs, and that you know you can do these things.
To make sure that everyone has such rights, we have to forbid you to
deprive anyone else of these rights. For example, if you distribute
copies 'gdbm', you must give the recipients all the rights that you
have. You must make sure that they, too, receive or can get the source
code. And you must tell them their rights.
Also, for our own protection, we must make certain that everyone
finds out that there is no warranty for anything in the 'gdbm'
distribution. If these functions are modified by someone else and
passed on, we want their recipients to know that what they have is not
what we distributed, so that any problems introduced by others will not
reflect on our reputation.
'Gdbm' is currently distributed under the terms of the GNU General
Public License, Version 3. (_NOT_ under the GNU General Library Public
License.) A copy the GNU General Public License is included with the
distribution of 'gdbm'.
File: gdbm.info, Node: Intro, Next: List, Prev: Copying, Up: Top
2 Introduction to GNU 'dbm'.
****************************
GNU 'dbm' ('gdbm') is a library of database functions that use
extensible hashing and works similar to the standard UNIX 'dbm'
functions. These routines are provided to a programmer needing to
create and manipulate a hashed database. ('gdbm' is _NOT_ a complete
database package for an end user.)
The basic use of 'gdbm' is to store key/data pairs in a data file.
Each key must be unique and each key is paired with only one data item.
The keys can not be directly accessed in sorted order. The basic unit
of data in 'gdbm' is the structure:
typedef struct {
char *dptr;
int dsize;
} datum;
This structure allows for arbitrary sized keys and data items.
The key/data pairs are stored in a 'gdbm' disk file, called a 'gdbm'
database. An application must open a 'gdbm' database to be able
manipulate the keys and data contained in the database. 'gdbm' allows
an application to have multiple databases open at the same time. When
an application opens a 'gdbm' database, it is designated as a 'reader'
or a 'writer'. A 'gdbm' database can be opened by at most one writer at
a time. However, many readers may open the database simultaneously.
Readers and writers can not open the 'gdbm' database at the same time.
File: gdbm.info, Node: List, Next: Open, Prev: Intro, Up: Top
3 List of functions.
********************
The following is a quick list of the functions contained in the 'gdbm'
library. The include file 'gdbm.h', that can be included by the user,
contains a definition of these functions.
#include
GDBM_FILE gdbm_open(name, block_size, flags, mode, fatal_func);
int gdbm_close(dbf);
int gdbm_store(dbf, key, content, flag);
datum gdbm_fetch(dbf, key);
int gdbm_delete(dbf, key);
datum gdbm_firstkey(dbf);
datum gdbm_nextkey(dbf, key);
int gdbm_reorganize(dbf);
int gdbm_sync(dbf);
int gdbm_exists(dbf, key);
char *gdbm_strerror(errno);
int gdbm_setopt(dbf, option, value, size);
int gdbm_fdesc(dbf);
int gdbm_export (GDBM_FILE, const char *, int, int);
int gdbm_export_to_file (GDBM_FILE dbf, FILE *fp);
int gdbm_import (GDBM_FILE, const char *, int);
int gdbm_import_from_file (GDBM_FILE dbf, FILE *fp, int flag);
int gdbm_count (GDBM_FILE dbf, gdbm_count_t *pcount);
int gdbm_version_cmp (int const a[], int const b[]);
The 'gdbm.h' include file is often in the '/usr/include' directory.
(The actual location of 'gdbm.h' depends on your local installation of
'gdbm'.)
File: gdbm.info, Node: Open, Next: Close, Prev: List, Up: Top
4 Opening the database.
***********************
-- gdbm interface: GDBM_FILE gdbm_open (const char *NAME, int
BLOCK_SIZE, int FLAGS, int MODE, void (*fatal_func)(const char
*))
Initializes 'gdbm' system. If the file has a size of zero bytes, a
file initialization procedure is performed, setting up the initial
structure in the file.
The arguments are:
NAME
The name of the file (the complete name, 'gdbm' does not
append any characters to this name).
BLOCK_SIZE
It is used during initialization to determine the size of
various constructs. It is the size of a single transfer from
disk to memory. This parameter is ignored if the file has
been previously initialized. If the value is less than 512,
the file system block size is used instead. The size is
adjusted so that the block can hold exact number of directory
entries, so that the effective block size can be slightly
greater than requested. However, if the 'GDBM_BSEXACT' flag
is set and the size needs to be adjusted, the function will
return with error status, setting the 'gdbm_errno' variable to
'GDBM_BLOCK_SIZE_ERROR'.
FLAGS
If 'flags' is set to 'GDBM_READER', the user wants to just
read the database and any call to 'gdbm_store' or
'gdbm_delete' will fail. Many readers can access the database
at the same time. If 'flags' is set to 'GDBM_WRITER', the
user wants both read and write access to the database and
requires exclusive access. If 'flags' is set to
'GDBM_WRCREAT', the user wants both read and write access to
the database and wants it created if it does not already
exist. If 'flags' is set to 'GDBM_NEWDB', the user want a new
database created, regardless of whether one existed, and wants
read and write access to the new database.
The following may also be logically or'd into the database
flags: 'GDBM_SYNC', which causes all database operations to be
synchronized to the disk, 'GDBM_NOLOCK', which prevents the
library from performing any locking on the database file, and
'GDBM_NOMMAP', which disables the memory mapping mechanism.
The option 'GDBM_FAST' is now obsolete, since 'gdbm' defaults
to no-sync mode.
If this flag is set and the requested BLOCK_SIZE cannot be
used without adjustment, 'gdbm_open' will refuse to create the
databases. In this case it will set the 'gdbm_errno' variable
to 'GDBM_BLOCK_SIZE_ERROR' and return 'NULL'.
If the host 'open' call (*note (open(2))open::) supports the
'O_CLOEXEC' flag, the 'GDBM_CLOEXEC' can be or'd into the
flags, to enable the close-on-exec flag for the database file
descriptor.
MODE
File mode (see *note change permissions of a file:
(chmod(2))chmod, and *note open a file: (open(2))open.), which
is used if the file is created).
FATAL_FUNC
A function for 'gdbm' to call if it detects a fatal error.
The only parameter of this function is a string. If the value
of 'NULL' is provided, 'gdbm' will use a default function.
The return value, is the pointer needed by all other functions to
access that 'gdbm' file. If the return is the 'NULL' pointer,
'gdbm_open' was not successful. The errors can be found in
'gdbm_errno' variable (*note gdbm_errno: Variables.). Available
error codes are discussed in *note Error codes::.
In all of the following calls, the parameter DBF refers to the
pointer returned from 'gdbm_open'.
-- gdbm interface: GDBM_FILE gdbm_fd_open (int FD, const char *NAME,
int BLOCK_SIZE, int FLAGS, int MODE, void (*fatal_func)(const
char *))
Alternative function for opening a GDBM database. The FD argument
is the file descriptor of the database file obtained by a call to
'open'(2), 'creat'(2) or similar funcionss. The descriptor is not
dup'ed, and will be closed when the returned GDBM_FILE is closed.
Use 'dup'(2) if that is not desirable.
-- gdbm interface: int gdbm_copy_meta (GDBM_FILE DST, GDBM_FILE SRC)
Copy file ownership and mode from SRC to DST.
File: gdbm.info, Node: Close, Next: Count, Prev: Open, Up: Top
5 Closing the database.
***********************
It is important that every file opened is also closed. This is needed
to update the reader/writer count on the file:
-- gdbm interface: int gdbm_close (GDBM_FILE DBF)
This function closes the 'gdbm' file and frees all memory
associated with it. The parameter is:
DBF
The pointer returned by 'gdbm_open'.
'Gdbm_close' returns 0 on success. On error, it sets 'gdbm_errno'
and system 'errno' variables to the codes describing the error and
returns -1.
File: gdbm.info, Node: Count, Next: Store, Prev: Close, Up: Top
6 Number of Records
*******************
-- gdbm interface: int gdbm_count (GDBM_FILE DBF, gdbm_count_t *PCOUNT)
Counts number of records in the database DBF. On success, stores
it in the memory location pointed to by PCOUNT and return 0. On
error, sets 'gdbm_errno' (if relevant, also 'errno') and returns
-1.
File: gdbm.info, Node: Store, Next: Fetch, Prev: Count, Up: Top
7 Inserting and replacing records in the database.
**************************************************
-- gdbm interface: int gdbm_store (GDBM_FILE DBF, datum KEY, datum
CONTENT, int FLAG)
The function 'gdbm_store' inserts or replaces records in the
database.
The parameters are:
DBF
The pointer returned by 'gdbm_open'.
KEY
The search key.
CONTENT
The data to be associated with the key.
FLAG
Defines the action to take when the key is already in the
database. The value 'GDBM_REPLACE' (defined in 'gdbm.h') asks
that the old data be replaced by the new CONTENT. The value
'GDBM_INSERT' asks that an error be returned and no action
taken if the KEY already exists.
This function can return the following values:
-1
The item was not stored in the database because the caller was
not an official writer or either KEY or CONTENT have a 'NULL'
'dptr' field.
Both KEY and CONTENT must have the 'dptr' field be a
non-'NULL' value. Since a 'NULL' 'dptr' field is used by
other functions to indicate an error, it cannot be valid data.
+1
The item was not stored because the argument FLAG was
'GDBM_INSERT' and the KEY was already in the database.
0
No error. The value of CONTENT is keyed by KEY. The file on
disk is updated to reflect the structure of the new database
before returning from this function.
If you store data for a KEY that is already in the data base, 'gdbm'
replaces the old data with the new data if called with 'GDBM_REPLACE'.
You do not get two data items for the same 'key' and you do not get an
error from 'gdbm_store'.
The size in 'gdbm' is not restricted like 'dbm' or 'ndbm'. Your data
can be as large as you want.
File: gdbm.info, Node: Fetch, Next: Delete, Prev: Store, Up: Top
8 Searching for records in the database.
****************************************
-- gdbm interface: datum gdbm_fetch (GDBM_FILE DBF, datum KEY)
Looks up a given KEY and returns the information associated with
it. The 'dptr' field in the structure that is returned points to a
memory block allocated by 'malloc'. It is the caller's
responsibility to free it when no longer needed.
If the 'dptr' is 'NULL', inspect the value of the 'gdbm_errno'
variable (*note gdbm_errno: Variables.). If it is
'GDBM_ITEM_NOT_FOUND', no data was found. Any other value means an
error occurred. Use 'gdbm_strerror' function to convert
'gdbm_errno' to a human-readable string.
The parameters are:
DBF
The pointer returned by 'gdbm_open'.
KEY
The search key.
An example of using this function:
content = gdbm_fetch (dbf, key);
if (content.dptr == NULL)
{
fprintf(stderr, "key not found\n");
}
else
{
/* do something with content.dptr */
}
You may also search for a particular key without retrieving it:
-- gdbm interface: int gdbm_exists (GDBM_FILE DBF, datum KEY)
Checks whether the KEY exists in the database DBF.
If KEY is found, returns 'true' ('1'). If it is not found, returns
'false' ('0') and sets 'gdbm_errno' to 'GDBM_NO_ERROR' ('0').
On error, returns '0' and sets 'gdbm_errno' to a non-'0' error
code.
The parameters are:
DBF
The pointer returned by 'gdbm_open'.
KEY
The search key.
File: gdbm.info, Node: Delete, Next: Sequential, Prev: Fetch, Up: Top
9 Removing records from the database.
*************************************
To remove some data from the database, use the 'gdbm_delete' function.
-- gdbm interface: int gdbm_delete (GDBM_FILE DBF, datum KEY)
Deletes the data associated with the given KEY, if it exists in the
database DBF. The file on disk is updated to reflect the structure
of the new database before returning from this function.
The parameters are:
DBF
The pointer returned by 'gdbm_open'.
DATUM KEY
The search key.
The function returns '-1' if the item is not present or the
requester is a reader. The return of '0' marks a successful
delete.
File: gdbm.info, Node: Sequential, Next: Reorganization, Prev: Delete, Up: Top
10 Sequential access to records.
********************************
The next two functions allow for accessing all items in the database.
This access is not 'key' sequential, but it is guaranteed to visit every
'key' in the database once. The order has to do with the hash values.
'gdbm_firstkey' starts the visit of all keys in the database.
'gdbm_nextkey' finds and reads the next entry in the hash structure for
'dbf'.
-- gdbm interface: datum gdbm_firstkey (GDBM_FILE DBF)
Initiate sequential access to the database DBF. The returned value
is the first key accessed in the database. If the 'dptr' field in
the returned datum is 'NULL', inspect the 'gdbm_errno' variable
(*note gdbm_errno: Variables.). The value of 'GDBM_ITEM_NOT_FOUND'
means that the database contains no data. Other value means an
error occurred.
Otherwise, 'dptr' points to a memory block obtained from 'malloc',
which holds the key value. The caller is responsible for freeing
this memory block when no longer needed.
-- gdbm interface: datum gdbm_nextkey (GDBM_FILE DBF, datum PREV)
This function continues the iteration over the keys in DBF,
initiated by 'gdbm_firstkey'. The parameter PREV holds the value
returned from a previous call to 'gdbm_nextkey' or 'gdbm_firstkey'.
The function returns next key from the database. If the 'dptr'
field in the returned datum is 'NULL' inspect the 'gdbm_errno'
variable (*note gdbm_errno: Variables.). The value of
'GDBM_ITEM_NOT_FOUND' means that all keys in the database has been
visited. Any other value means an error occurred.
Otherwise, 'dptr' points to a memory block obtained from 'malloc',
which holds the key value. The caller is responsible for freeing
this memory block when no longer needed.
These functions were intended to visit the database in read-only
algorithms, for instance, to validate the database or similar
operations. The usual algorithm for sequential access is:
key = gdbm_firstkey (dbf);
while (key.dptr)
{
datum nextkey;
/* do something with the key */
...
/* Obtain the next key */
nextkey = gdbm_nextkey (dbf, key);
/* Reclaim the memory used by the key */
free (key.dptr);
/* Use nextkey in the next iteration. */
key = nextkey;
}
Care should be taken when the 'gdbm_delete' function is used in such
a loop. File visiting is based on a "hash table". The 'gdbm_delete'
function re-arranges the hash table to make sure that any collisions in
the table do not leave some item "un-findable". The original key order
is _not_ guaranteed to remain unchanged in all instances. So it is
possible that some key will not be visited if a loop like the following
is executed:
key = gdbm_firstkey (dbf);
while (key.dptr)
{
datum nextkey;
if (some condition)
{
gdbm_delete (dbf, key);
}
nextkey = gdbm_nextkey (dbf, key);
free (key.dptr);
key = nextkey;
}
File: gdbm.info, Node: Reorganization, Next: Sync, Prev: Sequential, Up: Top
11 Database reorganization.
***************************
The following function should be used very seldom.
-- gdbm interface: int gdbm_reorganize (GDBM_FILE DBF)
Reorganizes the database.
The parameter is:
DBF
The pointer returned by 'gdbm_open'.
If you have had a lot of deletions and would like to shrink the space
used by the 'gdbm' file, this function will reorganize the database.
This results, in particular, in shortening the length of a 'gdbm' file
by removing the space occupied by deleted records.
This reorganization requires creating a new file and inserting all
the elements in the old file DBF into the new file. The new file is
then renamed to the same name as the old file and DBF is updated to
contain all the correct information about the new file. If an error is
detected, the return value is negative. The value zero is returned
after a successful reorganization.
File: gdbm.info, Node: Sync, Next: Flat files, Prev: Reorganization, Up: Top
12 Database Synchronization
***************************
Unless your database was opened with the 'GDBM_SYNC' flag, 'gdbm' does
not wait for writes to be flushed to the disk before continuing. This
allows for faster writing of databases at the risk of having a corrupted
database if the application terminates in an abnormal fashion. The
following function allows the programmer to make sure the disk version
of the database has been completely updated with all changes to the
current time.
-- gdbm interface: int gdbm_sync (GDBM_FILE DBF)
Synchronizes the changes in DBF with its disk file. The parameter
is a pointer returned by 'gdbm_open'.
This function would usually be called after a complete set of
changes have been made to the database and before some long waiting
time. The 'gdbm_close' function automatically calls the equivalent
of 'gdbm_sync' so no call is needed if the database is to be closed
immediately after the set of changes have been made.
'Gdbm_sync' returns 0 on success. On error, it sets 'gdbm_errno'
and system 'errno' variables to the codes describing the error and
returns -1.
File: gdbm.info, Node: Flat files, Next: Errors, Prev: Sync, Up: Top
13 Export and Import
********************
'Gdbm' databases can be converted into so-called "flat format" files.
Such files cannot be used for searching, their sole purpose is to keep
the data from the database for restoring it when the need arrives.
There are two flat file formats, which differ in the way they represent
the data and in the amount of meta-information stored. Both formats can
be used, for example, to migrate between the different versions of
'gdbm' databases. Generally speaking, flat files are safe to send over
the network, and can be used to recreate the database on another
machine. The recreated database is guaranteed to be a byte-to-byte
equivalent of the database from which the flat file was created. This
does not necessarily mean, however, that this file can be used in the
same way as the original one. For example, if the original database
contained non-ASCII data (e.g. C structures, integers etc.), the
recreated database can be of any use only if the target machine has the
same integer size and byte ordering as the source one and if its C
compiler uses the same packing conventions as the one which generated C
which populated the original database. In general, such binary
databases are not portable between machines, unless you follow some
stringent rules on what data is written to them and how it is
interpreted.
The GDBM version 1.18.1 supports two flat file formats. The "binary"
flat file format was first implemented in GDBM version 1.9.1. This
format stores only key/data pairs, it does not keep information about
the database file itself. As its name implies, files in this format are
binary files.
The "ascii" flat file format encodes all data in base64 and stores
not only key/data pairs, but also the original database file metadata,
such as file name, mode and ownership. Files in this format can be sent
without additional encapsulation over transmission channels that
normally allow only ASCII data, such as, e.g. SMTP. Due to additional
metadata they allow for restoring an exact copy of the database,
including file ownership and privileges, which is especially important
if the database in question contained some security-related data.
We call a process of creating a flat file from a database "exporting"
or "dumping" this database. The reverse process, creating the database
from a flat file is called "importing" or "loading" the database.
-- gdbm interface: int gdbm_dump (GDBM_FILE DBF, const char *FILENAME,
int FORMAT, int OPEN_FLAGS, int MODE)
Dumps the database file to the named file in requested format.
Arguments are:
DBF
A pointer to the source database, returned by a prior call to
'gdbm_open'.
FILENAME
Name of the dump file.
FORMAT
Output file format. Allowed values are:
'GDBM_DUMP_FMT_BINARY' to create a binary dump and
'GDBM_DUMP_FMT_ASCII' to create an ASCII dump file.
OPEN_FLAGS
How to create the output file. If FLAG is 'GDBM_WRCREAT' the
file will be created if it does not exist. If it does exist,
the 'gdbm_dump' will fail.
If FLAG is 'GDBM_NEWDB', the function will create a new output
file, replacing it if it already exists.
MODE
The permissions to use when creating the output file. See
*note open a file: (open(2))open, for a detailed discussion.
-- gdbm interface: int gdbm_load (GDBM_FILE *PDBF, const char
*FILENAME, int FLAG, int META_MASK, unsigned long *ERRLINE)
Loads data from the dump file FILENAME into the database pointed to
by PDBF. The latter can point to 'NULL', in which case the
function will try to create a new database. If it succeeds, the
function will return, in the memory location pointed to by PDBF, a
pointer to the newly created database. If the dump file carries no
information about the original database file name, the function
will set 'gdbm_errno' to 'GDBM_NO_DBNAME' and return '-1',
indicating failure.
The FLAG has the same meaning as the FLAG argument to the
'gdbm_store' function (*note Store::).
The META_MASK argument can be used to disable restoring certain
bits of file's meta-data from the information in the input dump
file. It is a binary OR of zero or more of the following:
GDBM_META_MASK_MODE
Do not restore file mode.
GDBM_META_MASK_OWNER
Do not restore file owner.
The function returns 0 upon successful completion or -1 on fatal
errors and 1 on mild (non-fatal) errors.
If a fatal error occurs, 'gdbm_errno' will be set to one of the
following values:
GDBM_FILE_OPEN_ERROR
Input file (FILENAME) cannot be opened. The 'errno' variable
can be used to get more detail about the failure.
GDBM_MALLOC_ERROR
Not enough memory to load data.
GDBM_FILE_READ_ERROR
Reading from FILENAME failed. The 'errno' variable can be
used to get more detail about the failure.
GDBM_ILLEGAL_DATA
Input contained some illegal data.
GDBM_ITEM_NOT_FOUND
This error can occur only when the input file is in ASCII
format. It indicates that the data part of the record about
to be read lacked length specification. Application
developers are advised to treat this error equally as
'GDBM_ILLEGAL_DATA'.
Mild errors mean that the function was able to successfully load
and restore the data, but was unable to change database file
metadata afterward. The table below lists possible values for
'gdbm_errno' in this case. To get more detail, inspect the system
'errno' variable.
GDBM_ERR_FILE_OWNER
The function was unable to restore database file owner.
GDBM_ERR_FILE_MODE
The function was unable to restore database file mode
(permission bits).
If an error occurs while loading data from an input file in ASCII
format, the number of line in which the error occurred will be
stored in the location pointed to by the ERRLINE parameter, unless
it is 'NULL'.
If the line information is not available or applicable, ERRLINE
will be set to '0'.
-- gdbm interface: int gdbm_dump_to_file (GDBM_FILE DBF, FILE *FP, int
FORMAT)
This is an alternative entry point to 'gdbm_dump' (which see).
Arguments are:
DBF
A pointer to the source database, returned by a call to
'gdbm_open'.
FP
File to write the data to.
FORMAT
Format of the dump file. See the FORMAT argument to the
'gdbm_dump' function.
-- gdbm interface: int gdbm_load_from_file (GDBM_FILE *PDBF, FILE *FP,
int REPLACE, int META_MASK, unsigned long *LINE)
This is an alternative entry point to 'gdbm_dump'. It writes the
output to FP which must be a file open for writing. The rest of
arguments is the same as for 'gdbm_load' (excepting of course FLAG,
which is not needed in this case).
-- gdbm interface: int gdbm_export (GDBM_FILE DBF, const char
*EXPORTFILE, int FLAG, int MODE)
This function is retained for compatibility with GDBM 1.10 and
earlier. It dumps the database to a file in binary dump format and
is entirely equivalent to
gdbm_dump(DBF, EXPORTFILE, GDBM_DUMP_FMT_BINARY,
FLAG, MODE)
-- gdbm interface: int gdbm_export_to_file (GDBM_FILE DBF, FILE *FP)
This is an alternative entry point to 'gdbm_export'. This function
writes to file FP a binary dump of the database DBF.
-- gdbm interface: int gdbm_import (GDBM_FILE DBF, const char
*IMPORTFILE, int FLAG)
This function is retained for compatibility with GDBM 1.10 and
earlier. It loads the file IMPORTFILE, which must be a binary flat
file, into the database DBF and is equivalent to the following
construct:
DBF = gdbm_open (IMPORTFILE, 0,
FLAG == GDBM_REPLACE ?
GDBM_WRCREAT : GDBM_NEWDB,
0600, NULL);
gdbm_load (&DBF, EXPORTFILE, 0, FLAG, NULL)
-- gdbm interface: int gdbm_import_from_file (GDBM_FILE DBF, FILE *FP,
int FLAG)
An alternative entry point to 'gdbm_import'. Reads the binary dump
from the file FP and stores the key/value pairs to DBF. *Note
Store::, for a description of FLAG.
This function is equivalent to:
DBF = gdbm_open (IMPORTFILE, 0,
FLAG == GDBM_REPLACE ?
GDBM_WRCREAT : GDBM_NEWDB,
0600, NULL);
gdbm_load_from_file (DBF, FP, FLAG, 0, NULL);
File: gdbm.info, Node: Errors, Next: Recovery, Prev: Flat files, Up: Top
14 Error handling.
******************
The global variable 'gdbm_errno' (*note gdbm_errno: Variables.) keeps
the error code of the most recent error encountered by GDBM functions.
To convert this code to human-readable string, use the following
function:
-- gdbm interface: const char * gdbm_strerror (gdbm_error ERRNO)
Converts ERRNO (which is an integer value) into a human-readable
descriptive text. Returns a pointer to a static string. The
caller must not alter or free the returned pointer.
Detailed information about the most recent error that occurred while
operating on a GDBM file is stored in the 'GDBM_FILE' object itself. To
retrieve it, the following functions are provided:
-- gdbm interface: gdbm_error gdbm_last_errno (GDBM_FILE DBF)
Returns the code of the most recent error encountered when
operating on DBF.
-- gdbm interface: int gdbm_last_syserr (GDBM_FILE DBF)
Returns the value of the system 'errno' variable associated with
the most recent error.
Notice, that not all GDBM errors have an associated system error
code. The following are the ones that have:
* GDBM_FILE_OPEN_ERROR
* GDBM_FILE_WRITE_ERROR
* GDBM_FILE_SEEK_ERROR
* GDBM_FILE_READ_ERROR
* GDBM_FILE_STAT_ERROR
* GDBM_BACKUP_FAILED
For other errors, 'gdbm_last_syserr' will return 0.
-- gdbm interface: int gdbm_check_syserr (gdbm_errno ERR)
Returns '1', if system errno value should be checked to get more
info on the error described by GDBM code ERR.
To get a human-readable description of the recent error for a
particular database file, use the 'gdbm_db_strerror' function:
-- gdbm interface: const char * gdbm_db_strerror (GDBM_FILE DBF)
Returns textual description of the most recent error encountered
when operating on the database DBF. The resulting string is often
more informative than what would be returned by
'gdbm_strerror(gdbm_last_errno(DBF))'. In particular, if there is
a system error associated with the recent failure, it will be
described as well.
-- gdbm interface: void gdbm_clear_error (GDBM_FILE DBF)
Clears the error state for the database DBF. Normally, this
function is called upon the entry to any GDBM function.
Certain errors (such as write error when saving stored key) can leave
database file in inconistent state. When such a critical error occurs,
the database file is marked as needing recovery. Subsequent calls to
any GDBM functions for that database file (except 'gdbm_recover'), will
return immediately with GDBM error value 'GDBM_NEED_RECOVERY'.
Additionally, the following function can be used to check the state of
the database file:
-- gdbm interface: int gdbm_needs_recovery (GDBM_FILE DBF)
Returns '1' if the database file DBF is in inconsistent state and
needs recovery.
The only way to bring the database back to operational state is to
call the 'gdbm_recover' function (*note Recovery::).
File: gdbm.info, Node: Recovery, Next: Options, Prev: Errors, Up: Top
15 Recovery
***********
Certain errors (such as write error when saving stored key) can leave
database file in "inconistent state". When such a critical error
occurs, the database file is marked as needing recovery. Subsequent
calls to any GDBM functions for that database file (except
'gdbm_recover'), will return immediately with GDBM error value
'GDBM_NEED_RECOVERY'.
To escape from this state and bring the database back to operational
state, use the following function:
-- gdbm interface: int gdbm_recover (GDBM_FILE DBF, gdbm_recovery
*RCVR, int FLAGS)
Check the database file DBF and fix eventual errors. The RCVR
argument points to a structure that has "input members", providing
additional information to alter the behavior of 'gdbm_recover', and
"output members", used to return additional statistics about the
recovery process (RCVR can be 'NULL' if no such information is
needed).
Each input member has a corresponding flag bit, which must be set
in the FLAGS in order to instruct the function to use it.
The 'gdbm_recover' type is defined as:
typedef struct gdbm_recovery_s
{
/* Input members.
These are initialized before call to gdbm_recover.
The flags argument specifies which of them are initialized. */
void (*errfun) (void *data, char const *fmt, ...);
void *data;
size_t max_failed_keys;
size_t max_failed_buckets;
size_t max_failures;
/* Output members.
The gdbm_recover function fills these before returning. */
size_t recovered_keys;
size_t recovered_buckets;
size_t failed_keys;
size_t failed_buckets;
char *backup_name;
} gdbm_recovery;
The "input members" modify the behavior of 'gdbm_recover':
-- input member on gdbm_recovery: void (*errfun) (void *DATA, char
const *FMT, ...)
If the 'GDBM_RCVR_ERRFUN' flag bit is set, 'errfun' points to
a function that will be called upon each recoverable or
non-fatal error that occurred during the recovery.
-- input member of gdbm_recovery: void * data
Supplies first argument for the 'errfun' invocations.
-- input member of gdbm_recovery: size_t max_failed_keys
If 'GDBM_RCVR_MAX_FAILED_KEYS' is set, this member sets the
limit on the number of keys that cannot be retrieved. If the
number of failed keys grows bigger than 'max_failed_keys',
recovery is aborted and error is returned.
-- input member of gdbm_recovery: size_t max_failed_buckets
If 'GDBM_RCVR_MAX_FAILED_BUCKETS' is set, this member sets the
limit on the number of buckets that cannot be retrieved or
that contain bogus information. If the number of failed
buckets grows bigger than 'max_failed_buckets', recovery is
aborted and error is returned.
-- output member of gdbm_recovery: size_t max_failures
If 'GDBM_RCVR_MAX_FAILURES' is set, this member sets the limit
of failures that are tolerated during recovery. If the number
of errors grows bigger than 'max_failures', recovery is
aborted and error is returned.
The following members are filled on output, upon successful return
from the function:
-- output member of gdbm_recovery: size_t recovered_keys
Number of recovered keys.
-- output member of gdbm_recovery: size_t recovered_buckets
Number of recovered buckets.
-- output member of gdbm_recovery: size_t failed_keys
Number of key/data pairs that cannot be retrieved.
-- output member of gdbm_recovery: size_t failed_buckets
Number of buckets that cannot be retrieved.
-- output member of gdbm_recovery: char * backup_name
Name of the file keeping the copy of the original database, in
the state prior to recovery. It is filled if the
GDBM_RCVR_BACKUP flag is set. The string is allocated using
the 'malloc' call. The caller is responsible for freeing that
memory when no longer needed.
By default, 'gdbm_recovery' first checks the database fo
inconsistencies and attempts recovery only if some were found. The
special flag bit 'GDBM_RCVR_FORCE' instructs 'gdbm_recovery' to omit
this check and to force recovery unconditionally.
File: gdbm.info, Node: Options, Next: Locking, Prev: Recovery, Up: Top
16 Setting options
******************
'Gdbm' supports the ability to set certain options on an already open
database.
-- gdbm interface: int gdbm_setopt (GDBM_FILE DBF, int OPTION, void
*VALUE, int SIZE)
Sets an option on the database or returns the value of an option.
The parameters are:
DBF
The pointer returned by 'gdbm_open'.
OPTION
The option to be set or retrieved.
VALUE
A pointer to the value to which OPTION will be set or where to
place the option value (depending on the option).
SIZE
The length of the data pointed to by VALUE.
The valid options are:
GDBM_SETCACHESIZE
GDBM_CACHESIZE
Set the size of the internal bucket cache. This option may only be
set once on each GDBM_FILE descriptor, and is set automatically to
100 upon the first access to the database. The VALUE should point
to a 'size_t' holding the desired cache size.
The 'GDBM_CACHESIZE' option is provided for compatibility with
earlier versions.
GDBM_GETCACHESIZE
Return the size of the internal bucket cache. The VALUE should
point to a 'size_t' variable, where the size will be stored.
GDBM_GETFLAGS
Return the flags describing the state of the database. The VALUE
should point to a 'int' variable where to store the flags. The
return is the same as the flags used when opening the database
(*note gdbm_open: Open.), except that it reflects the current state
(which may have been altered by another calls to 'gdbm_setopt'.
GDBM_FASTMODE
Enable or disable the "fast writes mode", i.e. writes without
subsequent synchronization. The VALUE should point to an integer:
'TRUE' to enable fast mode, and 'FALSE' to disable it.
This option is retained for compatibility with previous versions of
'gdbm'. Its effect is the reverse of 'GDBM_SETSYNCMODE' (see
below).
GDBM_SETSYNCMODE
GDBM_SYNCMODE
Turn on or off file system synchronization operations. This
setting defaults to off. The VALUE should point to an integer:
'TRUE' to turn synchronization on, and 'FALSE' to turn it off.
Note, that this option is a reverse of 'GDBM_FASTMODE', i.e.
calling 'GDBM_SETSYNCMODE' with 'TRUE' has the same effect as
calling 'GDBM_FASTMODE' with 'FALSE'.
The 'GDBM_SYNCMODE' option is provided for compatibility with
earlier versions.
GDBM_GETSYNCMODE
Return the current synchronization status. The VALUE should point
to an 'int' where the status will be stored.
GDBM_SETCENTFREE
GDBM_CENTFREE
_NOTICE: This feature is still under study._
Set central free block pool to either on or off. The default is
off, which is how previous versions of 'gdbm' handled free blocks.
If set, this option causes all subsequent free blocks to be placed
in the _global_ pool, allowing (in theory) more file space to be
reused more quickly. The VALUE should point to an integer: 'TRUE'
to turn central block pool on, and 'FALSE' to turn it off.
The 'GDBM_CENTFREE' option is provided for compatibility with
earlier versions.
GDBM_SETCOALESCEBLKS
GDBM_COALESCEBLKS
_NOTICE: This feature is still under study._
Set free block merging to either on or off. The default is off,
which is how previous versions of 'gdbm' handled free blocks. If
set, this option causes adjacent free blocks to be merged. This
can become a CPU expensive process with time, though, especially if
used in conjunction with GDBM_CENTFREE. The VALUE should point to
an integer: 'TRUE' to turn free block merging on, and 'FALSE' to
turn it off.
GDBM_GETCOALESCEBLKS
Return the current status of free block merging. The VALUE should
point to an 'int' where the status will be stored.
GDBM_SETMAXMAPSIZE
Sets maximum size of a memory mapped region. The VALUE should
point to a value of type 'size_t', 'unsigned long' or 'unsigned'.
The actual value is rounded to the nearest page boundary (the page
size is obtained from 'sysconf(_SC_PAGESIZE)').
GDBM_GETMAXMAPSIZE
Return the maximum size of a memory mapped region. The VALUE
should point to a value of type 'size_t' where to return the data.
GDBM_SETMMAP
Enable or disable memory mapping mode. The VALUE should point to
an integer: 'TRUE' to enable memory mapping or 'FALSE' to disable
it.
GDBM_GETMMAP
Check whether memory mapping is enabled. The VALUE should point to
an integer where to return the status.
GDBM_GETDBNAME
Return the name of the database disk file. The VALUE should point
to a variable of type 'char**'. A pointer to the newly allocated
copy of the file name will be placed there. The caller is
responsible for freeing this memory when no longer needed. For
example:
char *name;
if (gdbm_setopt (dbf, GDBM_GETDBNAME, &name, sizeof (name)))
{
fprintf (stderr, "gdbm_setopt failed: %s\n",
gdbm_strerror (gdbm_errno));
}
else
{
printf ("database name: %s\n", name);
free (name);
}
GDBM_GETBLOCKSIZE
Return the block size in bytes. The VALUE should point to 'int'.
The return value will be '-1' upon failure, or '0' upon success. The
global variable 'gdbm_errno' will be set upon failure.
For instance, to set a database to use a cache of 10, after opening
it with 'gdbm_open', but prior to accessing it in any way, the following
code could be used:
int value = 10;
ret = gdbm_setopt (dbf, GDBM_CACHESIZE, &value, sizeof (int));
File: gdbm.info, Node: Locking, Next: Variables, Prev: Options, Up: Top
17 File Locking.
****************
With locking disabled (if 'gdbm_open' was called with 'GDBM_NOLOCK'),
the user may want to perform their own file locking on the database file
in order to prevent multiple writers operating on the same file
simultaneously.
In order to support this, the 'gdbm_fdesc' routine is provided.
-- gdbm interface: int gdbm_fdesc (GDBM_FILE DBF)
Returns the file descriptor of the database DBF. This value can be
used as an argument to 'flock', 'lockf' or similar calls.
File: gdbm.info, Node: Variables, Next: Error codes, Prev: Locking, Up: Top
18 Useful global variables.
***************************
The following global variables and constants are available:
-- Variable: gdbm_error gdbm_errno
This variable contains error code from the last failed 'gdbm' call.
*Note Error codes::, for a list of available error codes and their
descriptions.
Use 'gdbm_strerror' (*note Errors::) to convert it to a descriptive
text.
-- Variable: const char * gdbm_errlist[]
This variable is an array of error descriptions, which is used by
'gdbm_strerror' to convert error codes to human-readable text
(*note Errors::). You can access it directly, if you wish so. It
contains '_GDBM_MAX_ERRNO + 1' elements and can be directly indexed
by the error code to obtain a corresponding descriptive text.
-- Variable: int const gdbm_syserr[]
Array of boolean values indicating, for each GDBM error code,
whether the value of 'errno'(3) variable is meaningful for this
error code. *Note gdbm_check_syserr::.
-- Constant: _GDBM_MIN_ERRNO
The minimum error code used by 'gdbm'.
-- Constant: _GDBM_MAX_ERRNO
The maximum error code used by 'gdbm'.
-- Variable: const char * gdbm_version
A string containing the version information.
-- Variable: int const gdbm_version_number[3]
This variable contains the 'gdbm' version numbers:
Index Meaning
-------------------------------------------------------------------
0 Major number
1 Minor number
2 Patchlevel number
Additionally, the following constants are defined in the 'gdbm.h'
file:
GDBM_VERSION_MAJOR
Major number.
GDBM_VERSION_MINOR
Minor number.
GDBM_VERSION_PATCH
Patchlevel number.
These can be used to verify whether the header file matches the
library.
To compare two split-out version numbers, use the following function:
-- gdbm interface: int gdbm_version_cmp (int const A[3], int const
B[3])
Compare two version numbers. Return '-1' if A is less than B, '1'
if A is greater than B and '0' if they are equal.
Comparison is done from left to right, so that:
a = { 1, 8, 3 };
b = { 1, 8, 3 };
gdbm_version_cmp (a, b) => 0
a = { 1, 8, 3 };
b = { 1, 8, 2 };
gdbm_version_cmp (a, b) => 1
a = { 1, 8, 3 };
b = { 1, 9. 0 };
gdbm_version_cmp (a, b) => -1
File: gdbm.info, Node: Error codes, Next: Compatibility, Prev: Variables, Up: Top
19 Error codes
**************
This chapter summarizes error codes which can be set by the functions in
'gdbm' library.
GDBM_NO_ERROR
No error occurred.
GDBM_MALLOC_ERROR
Memory allocation failed. Not enough memory.
GDBM_BLOCK_SIZE_ERROR
This error is set by the 'gdbm_open' function (*note Open::), if
the value of its BLOCK_SIZE argument is incorrect and the
'GDBM_BSEXACT' flag is set.
GDBM_FILE_OPEN_ERROR
The library was not able to open a disk file. This can be set by
'gdbm_open' (*note Open::), 'gdbm_export' and 'gdbm_import'
functions (*note Flat files::).
Inspect the value of the system 'errno' variable to get more
detailed diagnostics.
GDBM_FILE_WRITE_ERROR
Writing to a disk file failed. This can be set by 'gdbm_open'
(*note Open::), 'gdbm_export' and 'gdbm_import' functions.
Inspect the value of the system 'errno' variable to get more
detailed diagnostics.
GDBM_FILE_SEEK_ERROR
Positioning in a disk file failed. This can be set by 'gdbm_open'
(*note Open::) function.
Inspect the value of the system 'errno' variable to get a more
detailed diagnostics.
GDBM_FILE_READ_ERROR
Reading from a disk file failed. This can be set by 'gdbm_open'
(*note Open::), 'gdbm_export' and 'gdbm_import' functions.
Inspect the value of the system 'errno' variable to get a more
detailed diagnostics.
GDBM_BAD_MAGIC_NUMBER
The file given as argument to 'gdbm_open' function is not a valid
'gdbm' file: it has a wrong magic number.
GDBM_EMPTY_DATABASE
The file given as argument to 'gdbm_open' function is not a valid
'gdbm' file: it has zero length.
GDBM_CANT_BE_READER
This error code is set by the 'gdbm_open' function if it is not
able to lock file when called in 'GDBM_READER' mode (*note
GDBM_READER: Open.).
GDBM_CANT_BE_WRITER
This error code is set by the 'gdbm_open' function if it is not
able to lock file when called in writer mode (*note Open::).
GDBM_READER_CANT_DELETE
Set by the 'gdbm_delete' (*note Delete::) if it attempted to
operate on a database that is open in read-only mode (*note
GDBM_READER: Open.).
GDBM_READER_CANT_STORE
Set by the 'gdbm_store' (*note Store::) if it attempted to operate
on a database that is open in read-only mode (*note GDBM_READER:
Open.).
GDBM_READER_CANT_REORGANIZE
Set by the 'gdbm_reorganize' (*note Reorganization::) if it
attempted to operate on a database that is open in read-only mode
(*note GDBM_READER: Open.).
GDBM_ITEM_NOT_FOUND
Requested item was not found. This error is set by 'gdbm_delete'
(*note Delete::) and 'gdbm_fetch' (*note Fetch::) when the
requested KEY value is not found in the database.
GDBM_REORGANIZE_FAILED
The 'gdbm_reorganize' function is not able to create a temporary
database. *Note Reorganization::.
GDBM_CANNOT_REPLACE
Cannot replace existing item. This error is set by the
'gdbm_store' if the requested KEY value is found in the database
and the FLAG parameter is not 'GDBM_REPLACE'. *Note Store::, for a
detailed discussion.
GDBM_ILLEGAL_DATA
Either KEY or CONTENT parameter was wrong in a call to to
'gdbm_store' (*note Store::).
GDBM_OPT_ALREADY_SET
Requested option can be set only once and was already set. This
error is returned by the 'gdbm_setopt' function. *Note
GDBM_CACHESIZE: Options.
GDBM_OPT_ILLEGAL
The OPTION argument is not valid or the VALUE argument points to an
invalid value in a call to 'gdbm_setopt' function. *Note
Options::.
GDBM_BYTE_SWAPPED
The 'gdbm_open' function (*note Open::) attempts to open a database
which is created on a machine with different byte ordering.
GDBM_BAD_FILE_OFFSET
The 'gdbm_open' function (*note Open::) sets this error code if the
file it tries to open has a wrong magic number.
GDBM_BAD_OPEN_FLAGS
Set by the 'gdbm_export' function if supplied an invalid FLAGS
argument. *Note Flat files::.
GDBM_FILE_STAT_ERROR
Getting information about a disk file failed. The system 'errno'
will give more details about the error.
This error can be set by the following functions: 'gdbm_open',
'gdbm_reorganize'.
GDBM_FILE_EOF
End of file was encountered where more data was expected to be
present. This error can occur when fetching data from the database
and usually means that the database is truncated or otherwise
corrupted.
This error can be set by any GDBM function that does I/O. Some of
these functions are: 'gdbm_delete', 'gdbm_exists', 'gdbm_fetch',
'gdbm_export', 'gdbm_import', 'gdbm_reorganize', 'gdbm_firstkey',
'gdbm_nextkey', 'gdbm_store'.
GDBM_NO_DBNAME
Output database name is not specified. This error code is set by
'gdbm_load' (*note gdbm_load: gdbm_load function.) if the first
argument points to 'NULL' and the input file does not specify the
database name.
GDBM_ERR_FILE_OWNER
This error code is set by 'gdbm_load' if it is unable to restore
database file owner. It is a mild error condition, meaning that
the data have been restored successfully, only changing the target
file owner failed. Inspect the system 'errno' variable to get a
more detailed diagnostics.
GDBM_ERR_FILE_MODE
This error code is set by 'gdbm_load' if it is unable to restore
database file mode. It is a mild error condition, meaning that the
data have been restored successfully, only changing the target file
owner failed. Inspect the system 'errno' variable to get a more
detailed diagnostics.
GDBM_NEED_RECOVERY
Database is in inconsistent state and needs recovery. Call
'gdbm_recover' if you get this error. *Note Recovery::, for a
detailed description of recovery functions.
GDBM_BACKUP_FAILED
The GDBM engine is unable to create backup copy of the file.
GDBM_DIR_OVERFLOW
Bucket directory would overflow the size limit during an attempt to
split hash bucket. This error can occur while storing a new key.
File: gdbm.info, Node: Compatibility, Next: gdbmtool, Prev: Error codes, Up: Top
20 Compatibility with standard 'dbm' and 'ndbm'.
************************************************
'Gdbm' includes a compatibility layer, which provides traditional 'ndbm'
and older 'dbm' functions. The layer is compiled and installed if the
'--enable-libgdbm-compat' option is used when configuring the package.
The compatibility layer consists of two header files: 'ndbm.h' and
'dbm.h' and the 'libgdbm_compat' library.
Older programs using 'ndbm' or 'dbm' interfaces can use
'libgdbm_compat' without any changes. To link a program with the
compatibility library, add the following two options to the 'cc'
invocation: '-lgdbm -lgdbm_compat'. The '-L' option may also be
required, depending on where 'gdbm' is installed, e.g.:
cc ... -lgdbm -lgdbm_compat
Databases created and manipulated by the compatibility interfaces
consist of two different files: 'FILE.dir' and 'FILE.pag'. This is
required by the POSIX specification and corresponds to the traditional
usage. Note, however, that despite the similarity of the naming
convention, actual data stored in these files has not the same format as
in the databases created by other 'dbm' or 'ndbm' libraries. In other
words, you cannot access a standard UNIX 'dbm' file with GNU 'dbm'!
GNU 'dbm' files are not 'sparse'. You can copy them with the usual
'cp' command and they will not expand in the copying process.
* Menu:
* ndbm:: NDBM interface functions.
* dbm:: DBM interface functions.
File: gdbm.info, Node: ndbm, Next: dbm, Up: Compatibility
20.1 NDBM interface functions.
==============================
The functions below implement the POSIX 'ndbm' interface:
-- ndbm: DBM * dbm_open (char *FILE, int FLAGS, int MODE)
Opens a database. The FILE argument is the full name of the
database file to be opened. The function opens two files:
'FILE.pag' and 'FILE.dir'. The FLAGS and MODE arguments have the
same meaning as the second and third arguments of 'open' (*note
open a file: (open(2))open.), except that a database opened for
write-only access opens the files for read and write access and the
behavior of the 'O_APPEND' flag is unspecified.
The function returns a pointer to the 'DBM' structure describing
the database. This pointer is used to refer to this database in
all operations described below.
Any error detected will cause a return value of 'NULL' and an
appropriate value will be stored in 'gdbm_errno' (*note
Variables::).
-- ndbm: void dbm_close (DBM *DBF)
Closes the database. The DBF argument must be a pointer returned
by an earlier call to 'dbm_open'.
-- ndbm: datum dbm_fetch (DBM *DBF, datum KEY)
Reads a record from the database with the matching key. The KEY
argument supplies the key that is being looked for.
If no matching record is found, the 'dptr' member of the returned
datum is 'NULL'. Otherwise, the 'dptr' member of the returned
datum points to the memory managed by the compatibility library.
The application should never free it.
-- ndbm: int dbm_store (DBM *DBF, datum KEY, datum CONTENT, int MODE)
Writes a key/value pair to the database. The argument DBF is a
pointer to the 'DBM' structure returned from a call to 'dbm_open'.
The KEY and CONTENT provide the values for the record key and
content. The MODE argument controls the behavior of 'dbm_store' in
case a matching record already exists in the database. It can have
one of the following two values:
'DBM_REPLACE'
Replace existing record with the new one.
'DBM_INSERT'
The existing record is left unchanged, and the function
returns '1'.
If no matching record exists in the database, new record will be
inserted no matter what the value of the MODE is.
-- ndbm: int dbm_delete (DBM *DBF, datum KEY)
Deletes the record with the matching key from the database. If the
function succeeds, '0' is returned. Otherwise, if no matching
record is found or if an error occurs, '-1' is returned.
-- ndbm: datum dbm_firstkey (DBM *DBF)
Initializes iteration over the keys from the database and returns
the first key. Note, that the word 'first' does not imply any
specific ordering of the keys.
If there are no records in the database, the 'dptr' member of the
returned datum is 'NULL'. Otherwise, the 'dptr' member of the
returned datum points to the memory managed by the compatibility
library. The application should never free it.
-- ndbm: datum dbm_nextkey (DBM *DBF)
Continues the iteration started by 'dbm_firstkey'. Returns the
next key in the database. If the iteration covered all keys in the
database, the 'dptr' member of the returned datum is 'NULL'.
Otherwise, the 'dptr' member of the returned datum points to the
memory managed by the compatibility library. The application
should never free it.
The usual way of iterating over all the records in the database is:
for (key = dbm_firstkey (dbf);
key.ptr;
key = dbm_nextkey (dbf))
{
/* do something with the key */
}
The loop above should not try to delete any records from the
database, otherwise the iteration is not guaranteed to cover all
the keys. *Note Sequential::, for a detailed discussion of this.
-- ndbm: int dbm_error (DBM *DBF)
Returns the error condition of the database: '0' if no errors
occurred so far while manipulating the database, and a non-zero
value otherwise.
-- ndbm: void dbm_clearerr (DBM *DBF)
Clears the error condition of the database.
-- ndbm: int dbm_dirfno (DBM *DBF)
Returns the file descriptor of the 'dir' file of the database. It
is guaranteed to be different from the descriptor returned by the
'dbm_pagfno' function (see below).
The application can lock this descriptor to serialize accesses to
the database.
-- ndbm: int dbm_pagfno (DBM *DBF)
Returns the file descriptor of the 'pag' file of the database. See
also 'dbm_dirfno'.
-- ndbm: int dbm_rdonly (DBM *DBF)
Returns '1' if the database DBF is open in a read-only mode and '0'
otherwise.
File: gdbm.info, Node: dbm, Prev: ndbm, Up: Compatibility
20.2 DBM interface functions.
=============================
The functions below are provided for compatibility with the old UNIX
'DBM' interface. Only one database at a time can be manipulated using
them.
-- dbm: int dbminit (char *FILE)
Opens a database. The FILE argument is the full name of the
database file to be opened. The function opens two files:
'FILE.pag' and 'FILE.dir'. If any of them does not exist, the
function fails. It never attempts to create the files.
The database is opened in the read-write mode, if its disk
permissions permit.
The application must ensure that the functions described below in
this section are called only after a successful call to 'dbminit'.
-- dbm: int dbmclose (void)
Closes the database opened by an earlier call to 'dbminit'.
-- dbm: datum fetch (datum KEY)
Reads a record from the database with the matching key. The KEY
argument supplies the key that is being looked for.
If no matching record is found, the 'dptr' member of the returned
datum is 'NULL'. Otherwise, the 'dptr' member of the returned
datum points to the memory managed by the compatibility library.
The application should never free it.
-- dbm: int store (datum KEY, datum CONTENT)
Stores the key/value pair in the database. If a record with the
matching key already exists, its content will be replaced with the
new one.
Returns '0' on success and '-1' on error.
-- dbm: int delete (datum KEY)
Deletes a record with the matching key.
If the function succeeds, '0' is returned. Otherwise, if no
matching record is found or if an error occurs, '-1' is returned.
-- dbm: datum firstkey (void)
Initializes iteration over the keys from the database and returns
the first key. Note, that the word 'first' does not imply any
specific ordering of the keys.
If there are no records in the database, the 'dptr' member of the
returned datum is 'NULL'. Otherwise, the 'dptr' member of the
returned datum points to the memory managed by the compatibility
library. The application should never free it.
-- dbm: datum nextkey (datum KEY)
Continues the iteration started by a call to 'firstkey'. Returns
the next key in the database. If the iteration covered all keys in
the database, the 'dptr' member of the returned datum is 'NULL'.
Otherwise, the 'dptr' member of the returned datum points to the
memory managed by the compatibility library. The application
should never free it.
File: gdbm.info, Node: gdbmtool, Next: gdbm_dump, Prev: Compatibility, Up: Top
21 Examine and modify a GDBM database.
**************************************
The 'gdbmtool' utility allows you to view and modify an existing GDBM
database or to create a new one.
When invoked without arguments, it tries to open a database file
called 'junk.gdbm', located in the current working directory. You can
change this default by supplying the name of the database as argument to
the program, e.g.:
$ gdbmtool file.db
The database will be opened in read-write mode, unless the '-r'
('--read-only') option is specified, in which case it will be opened
only for reading.
If the database does not exist, 'gdbmtool' will create it. There is
a special option '-n' ('--newdb', which instructs the utility to create
a new database. If it is used and if the database already exists, it
will be deleted, so use it sparingly.
* Menu:
* invocation::
* shell::
File: gdbm.info, Node: invocation, Next: shell, Up: gdbmtool
21.1 gdbmtool invocation
========================
When started without additional arguments, 'gdbmtool' operates on the
default database 'junk.gdbm'. Otherwise, the first argument supplies
the name of the database to operate upon. If neither any additional
arguments nor the '-f' ('--file') option are given, 'gdbmtool' opens
starts interactive shell and receives commands directly from the human
operator.
If more than one arguments are given, all arguments past the database
name are parsed as 'gdbmtool' commands (*note shell::, for a description
of available commands) and executed in turn. All commands, except the
last one, should be terminated with semicolons. Semicolon after the
last command is optional. Note, that semicolons should be escaped in
order to prevent them from being interpreted by the shell.
Finally, if the '-f' ('--file') option is supplied, its argument
specifies the name of the disk file with 'gdbmtool' script. The program
will open that file and read commands from it.
The following table summarizes all 'gdbmtool' command line options:
'-b SIZE'
'--block-size=SIZE'
Set block size.
'-c SIZE'
'--cache-size=SIZE'
Set cache size.
'-f FILE'
'--file FILE'
Read commands from FILE, instead of the standard input.
'-h'
'--help'
Print a concise help summary.
'-N'
'--norc'
Don't read startup files (*note startup files::).
'-n'
'--newdb'
Create the database.
'-l'
'--no-lock'
Disable file locking.
'-m'
'--no-mmap'
Disable mmap.
'-q'
'--quiet'
Don't print the usual welcome banner at startup. This is the same
as setting the variable 'quiet' in the startup file. *Note
quiet::.
'-r'
'--read-only'
Open the database in read-only mode.
'-s'
'--synchronize'
Synchronize to the disk after each write.
'-V'
'--version'
Print program version and licensing information and exit.
'--usage'
Print a terse invocation syntax summary along with a list of
available command line options.
File: gdbm.info, Node: shell, Prev: invocation, Up: gdbmtool
21.2 gdbmtool interactive mode
==============================
After successful startup, 'gdbmtool' starts a loop, in which it reads
commands from the standard input, executes them and prints results on
the standard output. If the standard input is attached to a console,
'gdbmtool' runs in interactive mode, which is indicated by its "prompt":
gdbmtool> _
The utility finishes when it reads the 'quit' command (see below) or
detects end-of-file on its standard input, whichever occurs first.
A 'gdbmtool' command consists of a "command verb", optionally
followed by "arguments", separated by any amount of white space and
terminated with a newline or semicolon. A command verb can be entered
either in full or in an abbreviated form, as long as that abbreviation
does not match any other verb. For example, 'co' can be used instead of
'count' and 'ca' instead of 'cache'.
Any sequence of non-whitespace characters appearing after the command
verb forms an argument. If the argument contains whitespace or
unprintable characters it must be enclosed in double quotes. Within
double quotes the usual "escape sequences" are understood, as shown in
the table below:
Sequence Replaced with
\a Audible bell character (ASCII 7)
\b Backspace character (ASCII 8)
\f Form-feed character (ASCII 12)
\n Newline character (ASCII 10)
\r Carriage return character (ASCII
13)
\t Horizontal tabulation character
(ASCII 9)
\v Vertical tabulation character
(ASCII 11)
\\ Single slash
\" Double quote
Table 21.1: Backslash escapes
In addition, a backslash immediately followed by the end-of-line
character effectively removes that character, allowing to split long
arguments over several input lines.
Command parameters may be optional or mandatory. If the number of
actual arguments is less than the number of mandatory parameters,
'gdbmtool' will prompt you to supply missing arguments. For example,
the 'store' command takes two mandatory parameters, so if you invoked it
with no arguments, you would be prompted twice to supply the necessary
data, as shown in example below:
gdbmtool> store
key? three
data? 3
However, such prompting is possible only in interactive mode. In
non-interactive mode (e.g. when running a script), all arguments must be
supplied with each command, otherwise 'gdbmtool' will report an error
and exit immediately.
If the package is compiled with GNU Readline, the input line can be
edited (*note Command Line Editing: (readline)Command Line Editing.).
* Menu:
* variables:: shell variables.
* commands:: shell commands.
* definitions:: how to define structured data.
* startup files::
File: gdbm.info, Node: variables, Next: commands, Up: shell
21.2.1 Shell Variables
----------------------
A number of 'gdbmtool' parameters is kept in its internal variables.
-- gdbmtool variable: bool confirm
Whether to ask for confirmation before certain destructive
operations, such as truncating the existing database.
Default is 'true'.
-- gdbmtool variable: string ps1
Primary prompt string. Its value can contain "conversion
specifiers", consisting of the '%' character followed by another
character. These specifiers are expanded in the resulting prompt
as follows:
Sequence Expansion
-------------------------------------------------------------------
%f name of the current database file
%p program invocation name
%P package name ('GDBM')
%v program version
%_ single space character
%% %
The default value is '%p>%_', i.e. the program name, followed by a
"greater than" sign, followed by a single space.
-- gdbmtool variable: string ps2
Secondary prompt. See 'ps1' for a description of its value. This
prompt is displayed before reading the second and subsequent lines
of a multi-line command.
The default value is '%_>%_'.
-- gdbmtool variable: string delim1
A string used to delimit fields of a structured datum on output
(*note definitions::).
Default is ',' (a comma). This variable cannot be unset.
-- gdbmtool variable: string delim2
A string used to delimit array items when printing a structured
datum (*note definitions::).
Default is ',' (a comma). This variable cannot be unset.
-- gdbmtool variable: string pager
The name and command line of the pager program to pipe output to.
This program is used in interactive mode when the estimated number
of output lines is greater then the number of lines on your screen.
The default value is inherited from the environment variable
'PAGER'. Unsetting this variable disables paging.
-- gdbmtool variable: bool quiet
Whether to display a welcome banner at startup. This variable
should be set in a startup script file (*note startup files::).
*Note -q option::.
The following variables control how the database is opened:
-- gdbmtool variable: numeric blocksize
Sets the block size. *Note block_size: Open. Unset by default.
-- gdbmtool variable: numeric cachesize
Sets the cache size. *Note GDBM_SETCACHESIZE: Options. By default
this variable is not set.
-- gdbmtool variable: string open
Open mode. The following values are allowed:
newdb
Truncate the database if it exists or create a new one. Open
it in read-write mode.
Technically, this sets the 'GDBM_NEWDB' flag in call to
'gdbm_open'. *Note GDBM_NEWDB: Open.
wrcreat
rw
Open the database in read-write mode. Create it if it does
not exist. This is the default.
Technically speaking, it sets the 'GDBM_WRCREAT' flag in call
to 'gdbm_open'. *Note GDBM_WRCREAT: Open.
reader
readonly
Open the database in read-only mode. Signal an error if it
does not exist.
This sets the 'GDBM_READER' flag (*note GDBM_READER: Open.).
Attempting to set any other value or to unset this variable
produces an error.
-- gdbmtool variable: number filemode
File mode (in octal) for creating new database files and database
dumps.
-- gdbmtool variable: bool lock
Lock the database. This is the default.
Setting this variable to false or unsetting it results in passing
'GDBM_NOLOCK' flag to 'gdbm_open' (*note GDBM_NOLOCK: Open.).
-- gdbmtool variable: bool mmap
Use memory mapping. This is the default.
Setting this variable to false or unsetting it results in passing
'GDBM_NOMMAP' flag to 'gdbm_open' (*note GDBM_NOMMAP: Open.).
-- gdbmtool variable: bool sync
Flush all database writes on disk immediately. Default is false.
*Note GDBM_SYNC: Open.
-- gdbmtool variable: bool coalesce
Enables the _coalesce_ mode, i.e. merging of the freed blocks of
GDBM files with entries in available block lists. This provides
for effective memory management at the cost of slight increase in
execution time when calling 'gdbm_delete'. *Note
GDBM_SETCOALESCEBLKS: Options.
This variable affects the 'open' command and should be set before
invoking it.
-- gdbmtool variable: bool centfree
Set to 'true', enables the use of central free block pool in newly
opened databases. *Note GDBM_SETCENTFREE: Options.
This variable affects the 'open' command and should be set before
invoking it.
The following commands are used to list or modify the variables:
-- command verb: set [ASSIGNMENTS]
When used without arguments, lists all variables and their values.
Unset variables are shown after a comment sign ('#'). For string
and numeric variables, values are shown after an equals sign. For
boolean variables, only the variable name is displayed if the
variable is 'true'. If it is 'false', its name is prefixed with
'no'.
For example:
ps1="%p>%_"
ps2="%_>%_"
delim1=","
delim2=","
confirm
# cachesize is unset
# blocksize is unset
open="wrcreat"
lock
mmap
nosync
pager="less"
# quiet is unset
If used with arguments, the 'set' command alters the specified
variables. In this case, arguments are variable assignments in the
form 'NAME=VALUE'. For boolean variables, the VALUE is interpreted
as follows: if it is numeric, '0' stands for 'false', any non-zero
value stands for 'true'. Otherwise, the values 'on', 'true', and
'yes' denote 'true', and 'off', 'false', 'no' stand for 'false'.
Alternatively, only the name of a boolean variable can be supplied
to set it to 'true', and its name prefixed with 'no' can be used to
set it to false. For example, the following command sets the
'delim2' variable to ';' and the 'confirm' variable to 'false':
set delim2=";" noconfirm
-- command verb: unset VARIABLES
Unsets the listed variables. The effect of unsetting depends on
the variable. Unless explicitly described in the discussion of the
variables above, unsetting a boolean variable is equivalent to
setting it to 'false'. Unsetting a string variable is equivalent
to assigning it an empty string.
File: gdbm.info, Node: commands, Next: definitions, Prev: variables, Up: shell
21.2.2 Gdbmtool Commands
------------------------
-- command verb: avail
Print the "avail list".
-- command verb: bucket NUM
Print the bucket number NUM and set it as the current one.
-- command verb: cache
Print the bucket cache.
-- command verb: close
Close the currently open database.
-- command verb: count
Print the number of entries in the database.
-- command verb: current
Print the current bucket.
-- command verb: debug [[+-]TOKEN...]
If 'GDBM' is configured with additional debugging, this statement
queries or sets 'GDBM' internal debugging level. This is intended
for debugging and testing purposes and requires good knowledge of
'GDBM' internals. The use of this command is not recommended.
-- command verb: delete KEY
Delete record with the given KEY
-- command verb: dir
Print hash directory.
-- command verb: export FILE-NAME [truncate] [binary|ascii]
Export the database to the flat file FILE-NAME. *Note Flat
files::, for a description of the flat file format and its
purposes. This command will not overwrite an existing file, unless
the 'truncate' parameter is also given. Another optional argument
determines the type of the dump (*note Flat files::). By default,
ASCII dump is created.
The global variable 'filemode' specifies the permissions to use for
the created output file.
-- command verb: fetch KEY
Fetch and display the record with the given KEY.
-- command verb: first
Fetch and display the first record in the database. Subsequent
records can be fetched using the 'next' command (see below). *Note
Sequential::, for more information on sequential access.
-- command verb: hash KEY
Compute and display the hash value for the given KEY.
-- command verb: header
Print file header.
-- command verb: help
-- command verb: ?
Print a concise command summary, showing each command verb with its
parameters and a short description of what it does. Optional
arguments are enclosed in square brackets.
-- command verb: import FILE-NAME [replace] [nometa]
Import data from a flat dump file FILE-NAME (*note Flat files::).
If the word 'replace' is given as an argument, any records with the
same keys as the already existing ones will replace them. The word
'nometa' turns off restoring meta-information from the dump file.
-- command verb: history
-- command verb: history COUNT
-- command verb: history N COUNT
Shows the command history list with line numbers. When used
without arguments, shows entire history. When used with one
argument, displays COUNT last commands from the history. With two
arguments, displays COUNT commands starting from Nth command.
Command numbering starts with 1.
This command is available only if GDBM was compiled with GNU
Readline. The history is saved in file '.gdbmtool_history' in the
user's home directory. If this file exists upon startup, it is
read to populate the history. Thus, command history is preserved
between 'gdbmtool' invocations.
-- command verb: list
List the contents of the database.
-- command verb: next [KEY]
Sequential access: fetch and display the next record. If the KEY
is given, the record following the one with this key will be
fetched.
Issuing several 'next' commands in row is rather common. A
shortcut is provided to facilitate such use: if the last entered
command was 'next', hitting the 'Enter' key repeats it without
arguments.
See also 'first', above.
*Note Sequential::, for more information on sequential access.
-- command verb: open FILENAME
Open the database file FILENAME. If successful, any previously
open database is closed. Otherwise, if the operation fails, the
currently opened database remains unchanged.
This command takes additional information from the following
variables:
'open'
The database access mode. *Note The OPEN variable: openvar,
for a list of its values.
'lock'
Whether or not to lock the database. Default is 'on'.
'mmap'
Use the memory mapping. Default is 'on'.
'sync'
Synchronize after each write. Default is 'off'.
'filemode'
Specifies the permissions to use in case a new file is
created.
*Note open parameters::, for a detailed description of these
variables.
-- command verb: quit
Close the database and quit the utility.
-- command verb: recover [OPTIONS]
Run database recovery. The following OPTIONS are understood:
'backup'
Create a backup copy of the original database.
'max-failed-buckets=N'
Abort recovery process if N buckets could not be recovered.
'max-failed-keys=N'
Abort recovery process if N keys could not be recovered.
'max-failures=N'
Abort recovery process after N failures. A "failure" in this
context is either a key or a bucket that failed to be
recovered.
'summary'
Print the recovery statistics at the end of the run. The
statistics includes number of successfully recovered, failed
and duplicate keys and the number of recovered and failed
buckets.
'verbose'
Verbosely list each error encountered.
-- command verb: reorganize
Reorganize the database (*note Reorganization::).
-- command verb: source FILENAME
Read 'gdbmtool' commands from the file FILENAME.
-- command verb: status
Print current program status. The following example shows the
information displayed:
Database file: junk.gdbm
Database is open
define key string
define content string
The two 'define' strings show the defined formats for key and
content data. *Note definitions::, for a detailed discussion of
their meaning.
-- command verb: store KEY DATA
Store the DATA with KEY in the database. If KEY already exists,
its data will be replaced.
-- command verb: version
Print the version of 'gdbm'.
File: gdbm.info, Node: definitions, Next: startup files, Prev: commands, Up: shell
21.2.3 Data Definitions
-----------------------
GDBM databases are able to keep data of any type, both in the key and in
the content part of a record. Quite often these data are structured,
i.e. they consist of several fields of various types. 'Gdbmtool'
provides a mechanism for handling such kind of records.
The 'define' command defines a record structure. The general syntax
is:
define WHAT DEFINITION
where WHAT is 'key' to defining the structure of key data and 'content'
to define the structure of the content records.
The DEFINITION can be of two distinct formats. In the simplest case
it is a single data type. For example,
define content int
defines content records consisting of a single integer field. Supported
data types are:
char
Single byte (signed).
short
Signed short integer.
ushort
Unsigned short integer.
int
Signed integer.
unsigned
uint
Unsigned integer.
long
Signed long integer.
ulong
Unsigned long integer.
llong
Signed long long integer.
ullong
Unsigned long long integer.
float
A floating point number.
double
Double-precision floating point number.
string
Array of bytes.
stringz
Null-terminated string, trailing null being part of the string.
All numeric data types (integer as well as floating point) have the
same respective widths as in C language on the host where the database
file resides.
The 'string' and 'stringz' are special. Both define a string of
bytes, similar to 'char x[]' in C. The former defines an array of bytes,
the latter - a null-terminated string. This makes a difference, in
particular, when the string is the only part of datum. Consider the
following two definitions:
1. 'define key string'
2. 'define key stringz'
Now, suppose we want to store the string "ab" in the key. Using the
definition (1), the 'dptr' member of GDBM 'datum' will contain two
bytes: 'a', and 'b'. Consequently, the 'dsize' member will have the
value 2. Using the definition (2), the 'dptr' member will contain three
bytes: 'a', 'b', and ASCII 0. The 'dsize' member will have the value 3.
The definition (1) is the default for both key and content.
The second form of the 'define' statement is similar to the C
'struct' statement and allows for defining structural data. In this
form, the DEFINITION part is a comma-separated list of data types and
variables enclosed in curly braces. In contrast to the rest of 'gdbm'
commands, this command is inherently multiline and is terminated with
the closing curly brace. For example:
define content {
int status,
pad 8,
char id[3],
string name
}
This defines a structure consisting of three members: an integer
'status', an array of 8 bytes 'id', and a null-terminated string 'name'.
Notice the 'pad' statement: it allows to introduce padding between
structure members. Another useful statement is 'offset': it specifies
that the member following it begins at the given offset in the
structure. Assuming the size of 'int' is 8 bytes, the above definition
can also be written as
define content {
int status,
offset 16,
char id[3],
string name
}
_NOTE_: The 'string' type can reasonably be used only if it is the
last or the only member of the data structure. That's because it
provides no information about the number of elements in the array, so it
is interpreted to contain all bytes up to the end of the datum.
When displaying the structured data, 'gdbmtool' precedes each value
with the corresponding field name and delimits parts of the structure
with the string defined in the 'delim1' variable (*note variables::).
Array elements are delimited using the string from 'delim2'. For
example:
gdbmtool> fetch foo
status=2,id={ a, u, x },name="quux"
To supply a structured datum as an argument to a 'gdbmtool' command,
use the same notation, but without field names, e.g.:
gdbmtool> hash { 2, {a,u,x}, "quux" }
hash value = 13089969.
File: gdbm.info, Node: startup files, Prev: definitions, Up: shell
21.2.4 Startup Files
--------------------
Upon startup 'gdbmtool' looks for a file named '.gdbmtoolrc' first in
the current working directory and, if not found, in the home directory
of the user who started the command.
If found, this file is read and interpreted as a list of 'gdbmtool'
commands. This allows you to customize the program behavior.
Following is an example startup file which disables the welcome
banner, sets command line prompt to contain the name of the database
file in parentheses and defines the structure of the database content
records:
set quiet
set ps1="(%f) "
define key stringz
define content {
int time,
pad 4,
int status
}
File: gdbm.info, Node: gdbm_dump, Next: gdbm_load, Prev: gdbmtool, Up: Top
22 The 'gdbm_dump' utility
**************************
The 'gdbm_dump' utility creates a flat file dump of a GDBM database
(*note Flat files::). It takes one mandatory argument: the name of the
source database file. The second argument, if given, specifies the name
of the output file. If not given, 'gdbm_dump' will produce the dump on
the standard output.
For example, the following invocation creates a dump of the database
'file.db' in the file 'file.dump':
$ gdbm_dump file.db file.dump
By default the utility creates dumps in ASCII format (*note ASCII:
Flat files.). Another format can be requested using the '--format'
('-H') option.
The 'gdbm_dump' utility understands the following command line
options:
'-H FMT'
'--format=FMT'
Select output format. Valid values for FMT are: 'binary' or '0' to
select binary dump format, and 'ascii' or '1' to select ASCII
format.
'-h'
'--help'
Print a concise help summary.
'-V'
'--version'
Print program version and licensing information and exit.
'--usage'
Print a terse invocation syntax summary along with a list of
available command line options.
File: gdbm.info, Node: gdbm_load, Next: Exit codes, Prev: gdbm_dump, Up: Top
23 The 'gdbm_load' utility
**************************
The 'gdbm_load' utility restores a GDBM database from a flat file. The
utility requires at least one argument: the name of the input flat file.
If it is '-', the standard input will be read. The format of the input
file is detected automatically.
By default the utility attempts to restore the database under its
original name, as stored in the input file. It will fail to do so if
the input is in binary format. In that case, the name of the database
must be given as the second argument.
In general, if two arguments are given the second one is treated as
the name of the database to create, overriding the file name specified
in the flat file.
The utility understands the following command line arguments:
'-b NUM'
'--block-size=NUM'
Sets block size. *Note block_size: Open.
'-c NUM'
'--cache-size=NUM'
Sets cache size. *Note GDBM_SETCACHESIZE: Options.
'-M'
'--mmap'
Use memory mapping.
'-m MODE'
'--mode=MODE'
Sets the file mode. The argument is the desired file mode in
octal.
'-n'
'--no-meta'
Do not restore file meta-data (ownership and mode) from the flat
file.
'-r'
'--replace'
Replace existing keys.
'-u USER[:GROUP]'
'--user=USER[:GROUP]'
Set file owner. The USER can be either a valid user name or UID.
Similarly, the GROUP is either a valid group name or GID. If GROUP
is not given, the main group of USER is used.
User and group parts can be separated by a dot, instead of the
colon.
'-h'
'--help'
Print a concise help summary.
'-V'
'--version'
Print program version and licensing information and exit.
'--usage'
Print a terse invocation syntax summary along with a list of
available command line options.
File: gdbm.info, Node: Exit codes, Next: Bugs, Prev: gdbm_load, Up: Top
24 Exit codes
*************
All GDBM utilities return uniform exit codes. These are summarized in
the table below:
Code Meaning
--------------------------------------------------------------------------
0 Successful termination.
1 A fatal error occurred.
2 Program was unable to restore file ownership or
mode.
3 Command line usage error.
File: gdbm.info, Node: Bugs, Next: Resources, Prev: Exit codes, Up: Top
25 Problems and bugs.
*********************
If you have problems with GNU 'dbm' or think you've found a bug, please
report it. Before reporting a bug, make sure you've actually found a
real bug. Carefully reread the documentation and see if it really says
you can do what you're trying to do. If it's not clear whether you
should be able to do something or not, report that too; it's a bug in
the documentation!
Before reporting a bug or trying to fix it yourself, try to isolate
it to the smallest possible input file that reproduces the problem.
Then send us the input file and the exact results 'gdbm' gave you. Also
say what you expected to occur; this will help us decide whether the
problem was really in the documentation.
Once you've got a precise problem, send e-mail to .
Please include the version number of GNU 'dbm' you are using. You
can get this information by printing the variable 'gdbm_version' (*note
Variables::).
Non-bug suggestions are always welcome as well. If you have
questions about things that are unclear in the documentation or are just
obscure features, please report them too.
You may contact the authors and maintainers by e-mail:
, ,
File: gdbm.info, Node: Resources, Next: GNU Free Documentation License, Prev: Bugs, Up: Top
26 Additional resources
***********************
For the latest updates and pointers to additional resources, visit
.
In particular, a copy of 'gdbm' documentation in various formats is
available online at .
Latest versions of 'gdbm' can be downloaded from anonymous FTP:
, or via HTTP from
, or from any GNU mirror worldwide. See
, for a list of mirrors.
To track 'gdbm' development, visit
.
File: gdbm.info, Node: GNU Free Documentation License, Next: Index, Prev: Resources, Up: Top
Appendix A GNU Free Documentation License
*****************************************
Version 1.3, 3 November 2008
Copyright (C) 2000-2002, 2007-2008, 2011, 2017-2018 Free
Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or
noncommercially. Secondarily, this License preserves for the
author and publisher a way to get credit for their work, while not
being considered responsible for modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense.
It complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for
free software, because free software needs free documentation: a
free program should come with manuals providing the same freedoms
that the software does. But this License is not limited to
software manuals; it can be used for any textual work, regardless
of subject matter or whether it is published as a printed book. We
recommend this License principally for works whose purpose is
instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium,
that contains a notice placed by the copyright holder saying it can
be distributed under the terms of this License. Such a notice
grants a world-wide, royalty-free license, unlimited in duration,
to use that work under the conditions stated herein. The
"Document", below, refers to any such manual or work. Any member
of the public is a licensee, and is addressed as "you". You accept
the license if you copy, modify or distribute the work in a way
requiring permission under copyright law.
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could
fall directly within that overall subject. (Thus, if the Document
is in part a textbook of mathematics, a Secondary Section may not
explain any mathematics.) The relationship could be a matter of
historical connection with the subject or with related matters, or
of legal, commercial, philosophical, ethical or political position
regarding them.
The "Invariant Sections" are certain Secondary Sections whose
titles are designated, as being those of Invariant Sections, in the
notice that says that the Document is released under this License.
If a section does not fit the above definition of Secondary then it
is not allowed to be designated as Invariant. The Document may
contain zero Invariant Sections. If the Document does not identify
any Invariant Sections then there are none.
The "Cover Texts" are certain short passages of text that are
listed, as Front-Cover Texts or Back-Cover Texts, in the notice
that says that the Document is released under this License. A
Front-Cover Text may be at most 5 words, and a Back-Cover Text may
be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed
of pixels) generic paint programs or (for drawings) some widely
available drawing editor, and that is suitable for input to text
formatters or for automatic translation to a variety of formats
suitable for input to text formatters. A copy made in an otherwise
Transparent file format whose markup, or absence of markup, has
been arranged to thwart or discourage subsequent modification by
readers is not Transparent. An image format is not Transparent if
used for any substantial amount of text. A copy that is not
"Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format,
SGML or XML using a publicly available DTD, and standard-conforming
simple HTML, PostScript or PDF designed for human modification.
Examples of transparent image formats include PNG, XCF and JPG.
Opaque formats include proprietary formats that can be read and
edited only by proprietary word processors, SGML or XML for which
the DTD and/or processing tools are not generally available, and
the machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the
material this License requires to appear in the title page. For
works in formats which do not have any title page as such, "Title
Page" means the text near the most prominent appearance of the
work's title, preceding the beginning of the body of the text.
The "publisher" means any person or entity that distributes copies
of the Document to the public.
A section "Entitled XYZ" means a named subunit of the Document
whose title either is precisely XYZ or contains XYZ in parentheses
following text that translates XYZ in another language. (Here XYZ
stands for a specific section name mentioned below, such as
"Acknowledgements", "Dedications", "Endorsements", or "History".)
To "Preserve the Title" of such a section when you modify the
Document means that it remains a section "Entitled XYZ" according
to this definition.
The Document may include Warranty Disclaimers next to the notice
which states that this License applies to the Document. These
Warranty Disclaimers are considered to be included by reference in
this License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and
has no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License
applies to the Document are reproduced in all copies, and that you
add no other conditions whatsoever to those of this License. You
may not use technical measures to obstruct or control the reading
or further copying of the copies you make or distribute. However,
you may accept compensation in exchange for copies. If you
distribute a large enough number of copies you must also follow the
conditions in section 3.
You may also lend copies, under the same conditions stated above,
and you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly
have printed covers) of the Document, numbering more than 100, and
the Document's license notice requires Cover Texts, you must
enclose the copies in covers that carry, clearly and legibly, all
these Cover Texts: Front-Cover Texts on the front cover, and
Back-Cover Texts on the back cover. Both covers must also clearly
and legibly identify you as the publisher of these copies. The
front cover must present the full title with all words of the title
equally prominent and visible. You may add other material on the
covers in addition. Copying with changes limited to the covers, as
long as they preserve the title of the Document and satisfy these
conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto
adjacent pages.
If you publish or distribute Opaque copies of the Document
numbering more than 100, you must either include a machine-readable
Transparent copy along with each Opaque copy, or state in or with
each Opaque copy a computer-network location from which the general
network-using public has access to download using public-standard
network protocols a complete Transparent copy of the Document, free
of added material. If you use the latter option, you must take
reasonably prudent steps, when you begin distribution of Opaque
copies in quantity, to ensure that this Transparent copy will
remain thus accessible at the stated location until at least one
year after the last time you distribute an Opaque copy (directly or
through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of
the Document well before redistributing any large number of copies,
to give them a chance to provide you with an updated version of the
Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document
under the conditions of sections 2 and 3 above, provided that you
release the Modified Version under precisely this License, with the
Modified Version filling the role of the Document, thus licensing
distribution and modification of the Modified Version to whoever
possesses a copy of it. In addition, you must do these things in
the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title
distinct from that of the Document, and from those of previous
versions (which should, if there were any, be listed in the
History section of the Document). You may use the same title
as a previous version if the original publisher of that
version gives permission.
B. List on the Title Page, as authors, one or more persons or
entities responsible for authorship of the modifications in
the Modified Version, together with at least five of the
principal authors of the Document (all of its principal
authors, if it has fewer than five), unless they release you
from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license
notice giving the public permission to use the Modified
Version under the terms of this License, in the form shown in
the Addendum below.
G. Preserve in that license notice the full lists of Invariant
Sections and required Cover Texts given in the Document's
license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title,
and add to it an item stating at least the title, year, new
authors, and publisher of the Modified Version as given on the
Title Page. If there is no section Entitled "History" in the
Document, create one stating the title, year, authors, and
publisher of the Document as given on its Title Page, then add
an item describing the Modified Version as stated in the
previous sentence.
J. Preserve the network location, if any, given in the Document
for public access to a Transparent copy of the Document, and
likewise the network locations given in the Document for
previous versions it was based on. These may be placed in the
"History" section. You may omit a network location for a work
that was published at least four years before the Document
itself, or if the original publisher of the version it refers
to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section
all the substance and tone of each of the contributor
acknowledgements and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document, unaltered
in their text and in their titles. Section numbers or the
equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled
"Endorsements" or to conflict in title with any Invariant
Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no
material copied from the Document, you may at your option designate
some or all of these sections as invariant. To do this, add their
titles to the list of Invariant Sections in the Modified Version's
license notice. These titles must be distinct from any other
section titles.
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text
has been approved by an organization as the authoritative
definition of a standard.
You may add a passage of up to five words as a Front-Cover Text,
and a passage of up to 25 words as a Back-Cover Text, to the end of
the list of Cover Texts in the Modified Version. Only one passage
of Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document
already includes a cover text for the same cover, previously added
by you or by arrangement made by the same entity you are acting on
behalf of, you may not add another; but you may replace the old
one, on explicit permission from the previous publisher that added
the old one.
The author(s) and publisher(s) of the Document do not by this
License give permission to use their names for publicity for or to
assert or imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under
this License, under the terms defined in section 4 above for
modified versions, provided that you include in the combination all
of the Invariant Sections of all of the original documents,
unmodified, and list them all as Invariant Sections of your
combined work in its license notice, and that you preserve all
their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name
but different contents, make the title of each such section unique
by adding at the end of it, in parentheses, the name of the
original author or publisher of that section if known, or else a
unique number. Make the same adjustment to the section titles in
the list of Invariant Sections in the license notice of the
combined work.
In the combination, you must combine any sections Entitled
"History" in the various original documents, forming one section
Entitled "History"; likewise combine any sections Entitled
"Acknowledgements", and any sections Entitled "Dedications". You
must delete all sections Entitled "Endorsements."
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other
documents released under this License, and replace the individual
copies of this License in the various documents with a single copy
that is included in the collection, provided that you follow the
rules of this License for verbatim copying of each of the documents
in all other respects.
You may extract a single document from such a collection, and
distribute it individually under this License, provided you insert
a copy of this License into the extracted document, and follow this
License in all other respects regarding verbatim copying of that
document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other
separate and independent documents or works, in or on a volume of a
storage or distribution medium, is called an "aggregate" if the
copyright resulting from the compilation is not used to limit the
legal rights of the compilation's users beyond what the individual
works permit. When the Document is included in an aggregate, this
License does not apply to the other works in the aggregate which
are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half
of the entire aggregate, the Document's Cover Texts may be placed
on covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic
form. Otherwise they must appear on printed covers that bracket
the whole aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section
4. Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also
include the original English version of this License and the
original versions of those notices and disclaimers. In case of a
disagreement between the translation and the original version of
this License or a notice or disclaimer, the original version will
prevail.
If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to
Preserve its Title (section 1) will typically require changing the
actual title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense, or distribute it is void,
and will automatically terminate your rights under this License.
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the
copyright holder fails to notify you of the violation by some
reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from
that copyright holder, and you cure the violation prior to 30 days
after your receipt of the notice.
Termination of your rights under this section does not terminate
the licenses of parties who have received copies or rights from you
under this License. If your rights have been terminated and not
permanently reinstated, receipt of a copy of some or all of the
same material does not give you any rights to use it.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of
the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
.
Each version of the License is given a distinguishing version
number. If the Document specifies that a particular numbered
version of this License "or any later version" applies to it, you
have the option of following the terms and conditions either of
that specified version or of any later version that has been
published (not as a draft) by the Free Software Foundation. If the
Document does not specify a version number of this License, you may
choose any version ever published (not as a draft) by the Free
Software Foundation. If the Document specifies that a proxy can
decide which future versions of this License can be used, that
proxy's public statement of acceptance of a version permanently
authorizes you to choose that version for the Document.
11. RELICENSING
"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works. A
public wiki that anybody can edit is an example of such a server.
A "Massive Multiauthor Collaboration" (or "MMC") contained in the
site means any set of copyrightable works thus published on the MMC
site.
"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.
"Incorporate" means to publish or republish a Document, in whole or
in part, as part of another Document.
An MMC is "eligible for relicensing" if it is licensed under this
License, and if all works that were first published under this
License somewhere other than this MMC, and subsequently
incorporated in whole or in part into the MMC, (1) had no cover
texts or invariant sections, and (2) were thus incorporated prior
to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the
site under CC-BY-SA on the same site at any time before August 1,
2009, provided the MMC is eligible for relicensing.
ADDENDUM: How to use this License for your documents
====================================================
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and license
notices just after the title page:
Copyright (C) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
If you have Invariant Sections, Front-Cover Texts and Back-Cover
Texts, replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with
the Front-Cover Texts being LIST, and with the Back-Cover Texts
being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of free
software license, such as the GNU General Public License, to permit
their use in free software.
File: gdbm.info, Node: Index, Prev: GNU Free Documentation License, Up: Top
Index
*****
[index ]
* Menu:
* (*errfun) on gdbm_recovery: Recovery. (line 52)
* '--newdb', 'gdbmtool' option: gdbmtool. (line 20)
* '--read-only', 'gdbmtool' option: gdbmtool. (line 16)
* '-n', 'gdbmtool' option: gdbmtool. (line 20)
* '-r', 'gdbmtool' option: gdbmtool. (line 16)
* .gdbmtoolrc: startup files. (line 6)
* ?: commands. (line 62)
* _GDBM_MAX_ERRNO: Variables. (line 31)
* _GDBM_MIN_ERRNO: Variables. (line 28)
* avail: commands. (line 6)
* backup_name of gdbm_recovery: Recovery. (line 95)
* blocksize: variables. (line 66)
* bucket: commands. (line 9)
* cache: commands. (line 12)
* cachesize: variables. (line 69)
* centfree: variables. (line 129)
* close: commands. (line 15)
* close-on-exec: Open. (line 57)
* closing database: Close. (line 6)
* coalesce: variables. (line 119)
* command line options, 'gdbmtool': invocation. (line 6)
* compatibility layer: Compatibility. (line 6)
* confirm: variables. (line 8)
* count: commands. (line 18)
* creating a database, 'gdbmtool': gdbmtool. (line 20)
* current: commands. (line 21)
* data of gdbm_recovery: Recovery. (line 58)
* database options: Options. (line 6)
* database reorganization: Reorganization. (line 6)
* database synchronization: Sync. (line 6)
* database, closing: Close. (line 6)
* database, opening or creating: Open. (line 6)
* DBM functions: dbm. (line 6)
* dbm.h: Compatibility. (line 10)
* dbmclose: dbm. (line 22)
* dbminit: dbm. (line 10)
* dbm_clearerr: ndbm. (line 97)
* dbm_close: ndbm. (line 25)
* dbm_delete: ndbm. (line 56)
* dbm_dirfno: ndbm. (line 100)
* dbm_error: ndbm. (line 92)
* dbm_fetch: ndbm. (line 29)
* dbm_firstkey: ndbm. (line 61)
* DBM_INSERT: ndbm. (line 49)
* dbm_nextkey: ndbm. (line 71)
* dbm_open: ndbm. (line 8)
* dbm_pagfno: ndbm. (line 108)
* dbm_rdonly: ndbm. (line 112)
* DBM_REPLACE: ndbm. (line 46)
* dbm_store: ndbm. (line 38)
* debug: commands. (line 24)
* default database, 'gdbmtool': gdbmtool. (line 9)
* delete: dbm. (line 41)
* delete <1>: commands. (line 30)
* deleting records: Delete. (line 6)
* deletion in iteration loops: Sequential. (line 60)
* delim1: variables. (line 39)
* delim2: variables. (line 45)
* dir: commands. (line 33)
* 'dir' file: Compatibility. (line 21)
* error code, most recent: Errors. (line 21)
* error codes: Error codes. (line 6)
* error strings: Errors. (line 6)
* exit code: Exit codes. (line 6)
* export: Flat files. (line 6)
* export <1>: commands. (line 36)
* failed_buckets of gdbm_recovery: Recovery. (line 92)
* failed_keys of gdbm_recovery: Recovery. (line 89)
* fetch: dbm. (line 25)
* fetch <1>: commands. (line 47)
* fetching records: Fetch. (line 6)
* filemode: variables. (line 99)
* first: commands. (line 50)
* firstkey: dbm. (line 47)
* Flat file format: Flat files. (line 6)
* gdbmtool: gdbmtool. (line 6)
* GDBM_BACKUP_FAILED: Error codes. (line 165)
* GDBM_BAD_FILE_OFFSET: Error codes. (line 114)
* GDBM_BAD_MAGIC_NUMBER: Error codes. (line 49)
* GDBM_BAD_OPEN_FLAGS: Error codes. (line 118)
* GDBM_BLOCK_SIZE_ERROR: Error codes. (line 15)
* GDBM_BSEXACT: Open. (line 52)
* GDBM_BSEXACT <1>: Error codes. (line 15)
* GDBM_BYTE_SWAPPED: Error codes. (line 110)
* GDBM_CACHESIZE: Options. (line 27)
* GDBM_CANNOT_REPLACE: Error codes. (line 90)
* GDBM_CANT_BE_READER: Error codes. (line 57)
* GDBM_CANT_BE_WRITER: Error codes. (line 62)
* GDBM_CENTFREE: Options. (line 74)
* gdbm_check_syserr: Errors. (line 41)
* gdbm_clear_error: Errors. (line 56)
* GDBM_CLOEXEC: Open. (line 57)
* gdbm_close: Close. (line 9)
* GDBM_COALESCEBLKS: Options. (line 88)
* gdbm_copy_meta: Open. (line 89)
* gdbm_count: Count. (line 6)
* gdbm_db_strerror: Errors. (line 48)
* gdbm_delete: Delete. (line 8)
* 'gdbm_delete' and sequential access: Sequential. (line 60)
* GDBM_DIR_OVERFLOW: Error codes. (line 168)
* gdbm_dump: gdbm_dump. (line 6)
* gdbm_dump <1>: Flat files. (line 46)
* gdbm_dump_to_file: Flat files. (line 147)
* GDBM_EMPTY_DATABASE: Error codes. (line 53)
* gdbm_errlist[]: Variables. (line 16)
* gdbm_errno: Variables. (line 8)
* gdbm_errno <1>: Errors. (line 6)
* GDBM_ERR_FILE_MODE: Flat files. (line 135)
* GDBM_ERR_FILE_MODE <1>: Error codes. (line 153)
* GDBM_ERR_FILE_OWNER: Flat files. (line 132)
* GDBM_ERR_FILE_OWNER <1>: Error codes. (line 146)
* gdbm_exists: Fetch. (line 39)
* gdbm_export: Flat files. (line 170)
* gdbm_export_to_file: Flat files. (line 179)
* GDBM_FASTMODE: Options. (line 48)
* gdbm_fdesc: Locking. (line 13)
* gdbm_fd_open: Open. (line 79)
* gdbm_fetch: Fetch. (line 6)
* GDBM_FILE_EOF: Error codes. (line 129)
* GDBM_FILE_OPEN_ERROR: Error codes. (line 20)
* GDBM_FILE_READ_ERROR: Error codes. (line 42)
* GDBM_FILE_SEEK_ERROR: Error codes. (line 35)
* GDBM_FILE_STAT_ERROR: Error codes. (line 122)
* GDBM_FILE_WRITE_ERROR: Error codes. (line 28)
* gdbm_firstkey: Sequential. (line 13)
* GDBM_GETBLOCKSIZE: Options. (line 143)
* GDBM_GETCACHESIZE: Options. (line 37)
* GDBM_GETCOALESCEBLKS: Options. (line 100)
* GDBM_GETDBNAME: Options. (line 123)
* GDBM_GETFLAGS: Options. (line 41)
* GDBM_GETMAXMAPSIZE: Options. (line 110)
* GDBM_GETMMAP: Options. (line 119)
* GDBM_GETSYNCMODE: Options. (line 70)
* GDBM_ILLEGAL_DATA: Error codes. (line 96)
* gdbm_import: Flat files. (line 183)
* gdbm_import_from_file: Flat files. (line 196)
* GDBM_INSERT: Store. (line 20)
* GDBM_ITEM_NOT_FOUND: Error codes. (line 81)
* gdbm_last_errno: Errors. (line 21)
* gdbm_last_syserr: Errors. (line 25)
* gdbm_load: gdbm_load. (line 6)
* gdbm_load <1>: Flat files. (line 75)
* gdbm_load_from_file: Flat files. (line 163)
* GDBM_MALLOC_ERROR: Error codes. (line 12)
* gdbm_needs_recovery: Errors. (line 68)
* GDBM_NEED_RECOVERY: Error codes. (line 160)
* GDBM_NEWDB: Open. (line 32)
* gdbm_nextkey: Sequential. (line 25)
* GDBM_NOLOCK: Open. (line 44)
* GDBM_NOLOCK <1>: Locking. (line 6)
* GDBM_NOMMAP: Open. (line 44)
* GDBM_NO_DBNAME: Error codes. (line 140)
* GDBM_NO_ERROR: Error codes. (line 9)
* gdbm_open: Open. (line 6)
* GDBM_OPT_ALREADY_SET: Error codes. (line 100)
* GDBM_OPT_ILLEGAL: Error codes. (line 105)
* GDBM_RCVR_BACKUP: Recovery. (line 96)
* GDBM_RCVR_ERRFUN: Recovery. (line 54)
* GDBM_RCVR_FORCE: Recovery. (line 102)
* GDBM_RCVR_MAX_FAILED_BUCKETS: Recovery. (line 68)
* GDBM_RCVR_MAX_FAILED_KEYS: Recovery. (line 62)
* GDBM_RCVR_MAX_FAILURES: Recovery. (line 75)
* GDBM_READER: Open. (line 32)
* GDBM_READER_CANT_DELETE: Error codes. (line 66)
* GDBM_READER_CANT_REORGANIZE: Error codes. (line 76)
* GDBM_READER_CANT_STORE: Error codes. (line 71)
* gdbm_recover: Recovery. (line 16)
* gdbm_reorganize: Reorganization. (line 8)
* GDBM_REORGANIZE_FAILED: Error codes. (line 86)
* GDBM_REPLACE: Store. (line 20)
* GDBM_SETCACHESIZE: Options. (line 27)
* GDBM_SETCENTFREE: Options. (line 74)
* GDBM_SETCOALESCEBLKS: Options. (line 88)
* GDBM_SETMAXMAPSIZE: Options. (line 104)
* GDBM_SETMMAP: Options. (line 114)
* gdbm_setopt: Options. (line 9)
* GDBM_SETSYNCMODE: Options. (line 57)
* gdbm_store: Store. (line 6)
* gdbm_strerror: Errors. (line 12)
* GDBM_SYNC: Open. (line 44)
* GDBM_SYNC <1>: Sync. (line 6)
* gdbm_sync: Sync. (line 14)
* GDBM_SYNCMODE: Options. (line 57)
* gdbm_syserr[]: Variables. (line 23)
* gdbm_version: Variables. (line 34)
* gdbm_version_cmp: Variables. (line 63)
* GDBM_VERSION_MAJOR: Variables. (line 49)
* GDBM_VERSION_MINOR: Variables. (line 52)
* gdbm_version_number[3]: Variables. (line 37)
* GDBM_VERSION_PATCH: Variables. (line 55)
* GDBM_WRCREAT: Open. (line 32)
* GDBM_WRITER: Open. (line 32)
* global error state: Errors. (line 6)
* GNU Readline: shell. (line 65)
* hash: commands. (line 55)
* header: commands. (line 58)
* help: commands. (line 61)
* history: commands. (line 73)
* history <1>: commands. (line 74)
* history <2>: commands. (line 75)
* import: Flat files. (line 6)
* import <1>: commands. (line 67)
* init file, gdbmtool: startup files. (line 6)
* interactive mode, 'gdbmtool': shell. (line 6)
* iterating over records: Sequential. (line 6)
* iteration and 'gdbm_delete': Sequential. (line 60)
* iteration loop: Sequential. (line 40)
* iteration loop, using 'NDBM': ndbm. (line 79)
* junk.gdbm: gdbmtool. (line 9)
* libgdbm_compat: Compatibility. (line 10)
* list: commands. (line 88)
* lock: variables. (line 103)
* locking: Locking. (line 6)
* looking up records: Fetch. (line 6)
* max_failed_buckets of gdbm_recovery: Recovery. (line 67)
* max_failed_keys of gdbm_recovery: Recovery. (line 61)
* max_failures of gdbm_recovery: Recovery. (line 74)
* mmap: variables. (line 109)
* most recent error code: Errors. (line 21)
* NDBM functions: ndbm. (line 6)
* ndbm.h: Compatibility. (line 10)
* next: commands. (line 91)
* nextkey: dbm. (line 57)
* number of records: Count. (line 6)
* open: variables. (line 73)
* open <1>: commands. (line 105)
* opening the database: Open. (line 6)
* options, database: Options. (line 6)
* 'pag' file: Compatibility. (line 21)
* pager: variables. (line 51)
* ps1: variables. (line 14)
* ps2: variables. (line 32)
* quiet: variables. (line 59)
* quit: commands. (line 129)
* read-only mode, 'gdbmtool': gdbmtool. (line 16)
* readline: shell. (line 65)
* record, deleting: Delete. (line 6)
* record, fetching: Fetch. (line 6)
* records, iterating over: Sequential. (line 6)
* records, storing: Store. (line 6)
* records, testing existence: Fetch. (line 37)
* recover: commands. (line 132)
* recovered_buckets of gdbm_recovery: Recovery. (line 86)
* recovered_keys of gdbm_recovery: Recovery. (line 83)
* reorganization, database: Reorganization. (line 6)
* reorganize: commands. (line 158)
* sequential access: Sequential. (line 6)
* sequential access, using 'NDBM': ndbm. (line 79)
* set: variables. (line 138)
* source: commands. (line 161)
* startup file, gdbmtool: startup files. (line 6)
* status: commands. (line 164)
* store: dbm. (line 34)
* store <1>: commands. (line 177)
* storing records: Store. (line 6)
* sync: variables. (line 115)
* synchronization, database: Sync. (line 6)
* unset: variables. (line 175)
* variables, gdbmtool: variables. (line 6)
* version: commands. (line 181)
* version number: Variables. (line 34)
Tag Table:
Node: Top972
Node: Copying3099
Node: Intro4882
Node: List6303
Node: Open7596
Node: Close12115
Node: Count12731
Node: Store13137
Node: Fetch15118
Node: Delete16793
Node: Sequential17560
Node: Reorganization20878
Node: Sync21888
Node: Flat files23138
Ref: gdbm_load function26662
Node: Errors32110
Ref: gdbm_check_syserr33580
Node: Recovery35219
Node: Options39833
Node: Locking45654
Node: Variables46248
Node: Error codes48901
Node: Compatibility55165
Node: ndbm56728
Node: dbm61569
Node: gdbmtool64229
Node: invocation65198
Ref: -q option66778
Node: shell67268
Ref: backslash-interpretation68521
Node: variables70270
Ref: quiet72497
Ref: open parameters72693
Ref: openvar73015
Ref: filemode73878
Node: commands77138
Ref: gdbmtool export78115
Ref: gdbmtool import79336
Node: definitions83481
Node: startup files87673
Node: gdbm_dump88475
Node: gdbm_load89716
Node: Exit codes91593
Node: Bugs92140
Node: Resources93492
Node: GNU Free Documentation License94211
Node: Index119367
End Tag Table
gdbm-1.18.1/doc/gdbm.3 0000644 0001750 0001750 00000040320 13316075672 011207 0000000 0000000 .\" This file is part of GDBM.
.\" Copyright (C) 2011, 2013, 2016-2018 Free Software Foundation, Inc.
.\"
.\" GDBM is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 3, or (at your option)
.\" any later version.
.\"
.\" GDBM is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with GDBM. If not, see . */
.TH GDBM 3 "July 1, 2018" "GDBM" "GDBM User Reference"
.SH NAME
GDBM \- The GNU database manager. Includes \fBdbm\fR and \fBndbm\fR
compatibility.
.SH SYNOPSIS
.nf
.B #include
.sp
.BI "extern gdbm_error" " gdbm_errno";
.br
.BI "extern char *" gdbm_version ;
.br
.BI "GDBM_FILE gdbm_open (const char *" name ", int " block_size ", "
.ti +21
.BI "int " flags ", int " mode ", "
.ti +21
.BI "void (*" fatal_func ")(const char *))";
.br
.BI "int gdbm_close (GDBM_FILE " dbf ");"
.br
.BI "int gdbm_store (GDBM_FILE " dbf ", datum " key ", datum " content ", int " flag );
.br
.BI "datum gdbm_fetch (GDBM_FILE " dbf ", datum " key );
.br
.BI "int gdbm_delete (GDBM_FILE " dbf ", datum " key );
.br
.BI "datum gdbm_firstkey (GDBM_FILE " dbf ");"
.br
.BI "datum gdbm_nextkey (GDBM_FILE " dbf ", datum " key );
.br
.BI "int gdbm_reorganize (GDBM_FILE " dbf ");"
.br
.BI "int gdbm_sync (GDBM_FILE " dbf ");"
.br
.BI "int gdbm_exists (GDBM_FILE " dbf ", datum " key );
.br
.BI "const char *gdbm_strerror (gdbm_error " errno );
.br
.BI "int gdbm_setopt (GDBM_FILE " dbf ", int " option ", int " value ", int " size );
.br
.BI "int gdbm_fdesc (GDBM_FILE " dbf );
.br
.PP
.SS DBM Compatibility routines:
.PP
.B #include
.sp
.BI "int dbminit (const char *" name ");"
.br
.BI "int store (datum " key ", datum " content );
.br
.BI "datum fetch (datum " key );
.br
.BI "int delete (datum " key );
.br
.BI "datum firstkey (void);"
.br
.BI "datum nextkey (datum " key );
.br
.BI "int dbmclose (void);"
.PP
.SS NDBM Compatibility routines:
.PP
.B #include
.sp
.BI "DBM *dbm_open (const char *" name ", int " flags ", int " mode );
.br
.BI "void dbm_close (DBM *" file );
.br
.BI "datum dbm_fetch (DBM *" file ", datum " key );
.br
.BI "int dbm_store (DBM *" file ", datum " key ", datum " content ", int " flags );
.br
.BI "int dbm_delete (DBM *" file ", datum " key );
.br
.BI "datum dbm_firstkey (DBM *" file );
.br
.BI "datum dbm_nextkey (DBM *" file ", datum " key );
.br
.BI "int dbm_error (DBM *" file );
.br
.BI "int dbm_clearerr (DBM *" file );
.br
.BI "int dbm_pagfno (DBM *" file );
.br
.BI "int dbm_dirfno (DBM *" file );
.br
.BI "int dbm_rdonly (DBM *" file );
.SH DESCRIPTION
\fBGNU dbm\fR is a library of routines that manages data files that contain
key/data pairs. The access provided is that of storing,
retrieval, and deletion by key and a non-sorted traversal of all
keys. A process is allowed to use multiple data files at the
same time.
This manpage is a short description of the \fBGDBM\fR library.
For a detailed discussion, including examples of the configuration and
usage recommendations, refer to the \fBGDBM Manual\fR available in
Texinfo format. To access it, run:
\fBinfo gdbm\fR
Should any discrepancies occur between this manpage and the
\fBGDBM Manual\fR, the later shall be considered the authoritative
source.
A process that opens a gdbm file is designated as a "reader" or a
"writer". Only one writer may open a gdbm file and many readers may
open the file. Readers and writers can not open the gdbm file at the
same time. The procedure for opening a gdbm file is:
.BI "GDBM_FILE gdbm_open (const char *" name ", int " block_size ", "
.ti +21
.BI "int " flags ", int " mode ", "
.ti +21
.BI "void (*" fatal_func ")(const char *))";
\fIName\fR is the name of the file (the complete name,
gdbm does not append any characters to this name). \fIBlock_size\fR is
the size of a single transfer from disk to memory. This parameter is
ignored unless the file is a new file. The minimum size is 512. If
it is less than 512, dbm will use the stat block size for the file system.
\fIRead_write\fR can have one of the following values:
.TP
.B GDBM_READER
reader
.TP
.B GDBM_WRITER
writer
.TP
.B GDBM_WRCREAT
writer - if database does not exist create new one
.TP
.B GDBM_NEWDB
writer - create new database regardless if one exists
.PP
The \fBGDBM_NOMMAP\fR added to \fIread_write\fR by bitwise or instructs
\fBgdbm_open\fR to disable the use of
.BR mmap (2).
.PP
For the last three (writers of the database) the following may be added
added to \fIread_write\fR by bitwise or:
.TP
.B GDBM_SYNC
Causes all database operations to be synchronized to the disk,
.TP
.B GDBM_NOLOCK
Prevents the library from performing any locking on the database file.
.PP
The option
.B GDBM_FAST
is now obsolete, since gdbm defaults to no-sync mode.
.PP
\fIMode\fR is the file mode (see \fBchmod(2)\fR and \fBopen(2)\fR) if the
file is created. \fI(*Fatal_func) ()\fR is a function for dbm to call
if it detects a fatal error. The only parameter of this function is a string.
If the value of 0 is provided, \fBgdbm\fR will use a default function.
The return value is the pointer needed by all other routines to
access that gdbm file. If the return is the \fBNULL\fR pointer, \fBgdbm_open\fR
was not successful. The errors can be found in \fIgdbm_errno\fR for gdbm
errors and in \fIerrno\fR for system errors. (For error codes, see
gdbmerrno.h.)
In all of the following calls, the parameter \fIdbf\fR refers to the pointer
returned from \fBgdbm_open\fR.
It is important that every file opened is also closed. This is needed to
update the reader/writer count on the file. This is done by:
.BI "int gdbm_close (GDBM_FILE " dbf ");"
The database is used by 3 primary routines. The first stores data in the
database.
.BI "int gdbm_store (GDBM_FILE " dbf ", datum " key ", datum " content ", int " flag );
\fIDbf\fR is the pointer returned by \fBgdbm_open\fR. \fIKey\fR is the
key data. \fIContent\fR is the data to be associated with the \fIkey\fR.
\fIFlag\fR can have one of the following values:
.TP
.B GDBM_INSERT
Insert only, generate an error if key exists;
.TP
.B GDBM_REPLACE
Replace contents if key exists.
.PP
If a reader calls \fBgdbm_store\fR, the return value will be \-1.
If called with \fBGDBM_INSERT\fR and \fIkey\fR is in the database, the return
value will be 1. Otherwise, the return value is 0.
\fINOTICE: If you store data for a key that is already in the data base,
\fBgdbm\fI replaces the old data with the new data if called with \fBGDBM_REPLACE\fI.
You do not get two data items for the same key and you do not get an
error from \fBgdbm_store\fI.
NOTICE: The size in \fBgdbm\fI is not restricted like in \fBdbm\fI or \fBndbm\fI. Your data
can be as large as you want.\fR
To search for some data, use:
.BI "datum gdbm_fetch (GDBM_FILE " dbf ", datum " key );
\fIDbf\fR is the pointer returned by \fBgdbm_open\fR. \fIKey\fR is
the key data.
If the \fIdptr\fR element of the return value is \fBNULL\fR, the
\fBgdbm_errno\fR variable should be examined. The value of
\fBGDBM_ITEM_NOT_FOUND\fR means no data was found for that \fIkey\fR.
Other value means an error occurred.
Otherwise the return value is a pointer to the found data.
The storage space for the \fIdptr\fR element is allocated using
\fBmalloc(3)\fR. \fBGdbm\fI does not automatically free this data.
It is the programmer's responsibility to free this storage when it is
no longer needed.
To search for some data, without retrieving it:
.BI "int gdbm_exists (GDBM_FILE " dbf ", datum " key );
\fIDbf\fR is the pointer returned by \fBgdbm_open\fR. \fIKey\fR is
the key data to search for.
If the \fIkey\fR is found within the database, the return value
will be true. If nothing appropriate is found, false is returned.
This routine is useful for checking for the existence of a record,
without performing the memory allocation done by \fBgdbm_fetch\fR.
.PP
To remove some data from the database:
.BI "int gdbm_delete (GDBM_FILE " dbf ", datum " key );
\fIDbf\fR is the pointer returned by \fBgdbm_open\fR. \fIKey\fR is the
key data.
The return value is \-1 if the item is not present or the requester is a reader.
The return value is 0 if there was a successful delete.
The next two routines allow for accessing all items in the database. This
access is not key sequential, but it is guaranteed to visit every key in
the database once. (The order has to do with the hash values.)
.BI "datum gdbm_firstkey (GDBM_FILE " dbf ");"
.br
.BI "datum gdbm_nextkey (GDBM_FILE " dbf ", datum " key );
\fIDbf\fR is the pointer returned by \fBgdbm_open\fR. \fIKey\fR is the
key data.
The return values are both of type \fBdatum\fR. If the \fIdptr\fR
element of the return value is \fBNULL\fR, inspect the
\fBgdbm_errno\fR. If it is \fBGDBM_ITEM_NOT_FOUND\fR, there is no
first key or next key. Otherwise, an error occurred.
Again, notice that \fIdptr\fR points to data allocated by \fBmalloc(3)\fR
and \fBgdbm\fR will not free it for you.
These functions were intended to visit the database in read-only algorithms,
for instance, to validate the database or similar operations.
File `visiting' is based on a `hash table'. \fIgdbm_delete\fR re-arranges the
hash table to make sure that any collisions in the table do not leave some item
`un-findable'. The original key order is NOT guaranteed to remain unchanged in
ALL instances. It is possible that some key will not be visited if a loop like
the following is executed:
.sp
.nf
.in +5
key = gdbm_firstkey (dbf);
while (key.dptr)
{
nextkey = gdbm_nextkey (dbf, key);
if (some condition)
gdbm_delete ( dbf, key );
free (key.dptr);
key = nextkey;
}
.in
.fi
.PP
The following routine should be used very infrequently.
.BI "int gdbm_reorganize (GDBM_FILE " dbf ");"
If you have had a lot of deletions and would like to shrink the space
used by the \fBgdbm\fR file, this routine will reorganize the database.
\fBGdbm\fR will not shorten the length of a \fBgdbm\fR file except by
using this reorganization. (Deleted file space will be reused.)
Unless your database was opened with the \fBGDBM_SYNC\fR flag, \fBgdbm\fR does not
wait for writes to be flushed to the disk before continuing.
The following routine can be used to guarantee that the database is
physically written to the disk file.
.BI "int gdbm_sync (GDBM_FILE " dbf ");"
It will not return until the disk file state is syncronized with the
in-memory state of the database.
To convert a \fBgdbm\fR error code into English text, use this routine:
.BI "const char *gdbm_strerror (gdbm_error " errno );
\fBGdbm\fR now supports the ability to set certain options on an
already open database.
.BI "int gdbm_setopt (GDBM_FILE " dbf ", int " option ", int " value ", int " size );
Where \fIdbf\fR is the return value from a previous call to \fBgdbm_open\fR,
and \fIoption\fR specifies which option to set. The valid options are
currently:
.TP
.B GDBM_CACHESIZE
Set the size of the internal bucket cache. This option may only be set once
on each \fIGDBM_FILE\fR descriptor, and is set automatically to 100 upon the
first access to the database.
.TP
.B GDBM_FASTMODE
Set \fBfast mode\fR to either on or off. This allows \fBfast mode\fR to
be toggled on an already open and active database. \fIvalue\fR (see below)
should be set to either TRUE or FALSE. \fIThis option is now obsolete.\fR
.TP
.B GDBM_SYNCMODE
Turn on or off file system synchronization operations. This setting defaults
to off; \fIvalue\fR (see below) should be set to either TRUE or FALSE.
.TP
.B GDBM_CENTFREE
Set \fBcentral free block pool\fR to either on or off.
The default is off, which is how previous versions of \fBGdbm\fR
handled free blocks. If set, this option causes all subsequent free
blocks to be placed in the \fBglobal\fR pool, allowing (in thoery)
more file space to be reused more quickly. \fIvalue\fR (see below) should
be set to either TRUE or FALSE.
\fINOTICE: This feature is still under study.\fR
.TP
.B GDBM_COALESCEBLKS
Set \fBfree block merging\fR to either on or off.
The default is off, which is how previous versions of \fBGdbm\fR
handled free blocks. If set, this option causes adjacent free blocks
to be merged. This can become a CPU expensive process with time, though,
especially if used in conjunction with \fBGDBM_CENTFREE\fR. \fIvalue\fR
(see below) should be set to either TRUE or FALSE.
\fINOTICE: This feature is still under study.\fR
.PP
\fIvalue\fR is the value to set \fIoption\fR to, specified as an integer
pointer. \fIsize\fR is the size of the data pointed to by \fIvalue\fR.
The return value will be \-1 upon failure, or 0 upon success. The global
variable \fIgdbm_errno\fR will be set upon failure.
For instance, to set a database to use a cache of 10, after opening it
with \fBgdbm_open\fR, but prior to accessing it in any way, the following
code could be used:
.sp
.nf
.in +5
int value = 10;
ret = gdbm_setopt( dbf, GDBM_CACHESIZE, &value, sizeof(int));
.in
.fi
.PP
If the database was opened with the \fBGDBM_NOLOCK\fR flag, the user may
wish to perform their own file locking on the database file in order to
prevent multiple writers operating on the same file simultaneously.
In order to support this, the \fIgdbm_fdesc\fR routine is provided.
.BI "int gdbm_fdesc (GDBM_FILE " dbf );
Where \fIdbf\fR is the return value from a previous call to \fBgdbm_open\fR.
The return value will be the file descriptor of the database.
The following two external variables may be useful:
\fIgdbm_errno\fR is the variable that contains more information about
gdbm errors. (gdbm.h has the definitions of the error values and
defines gdbm_errno as an external variable.)
\fIgdbm_version\fR is the string containing the version information.
There are a few more things of interest. First, \fBgdbm\fR files are
not "sparse". You can copy them with the UNIX \fBcp(1)\fR command and
they will not expand in the copying process. Also, there is a
compatibility mode for use with programs that already use UNIX
\fBdbm\fR. In this compatibility mode, no \fRgdbm\fR file pointer is
required by the programmer, and only one file may be opened at a time.
All users in compatibility mode are assumed to be writers. If the
\fBgdbm\fR file is a read only, it will fail as a writer, but will
also try to open it as a reader. All returned pointers in datum
structures point to data that \fBgdbm\fR WILL free. They should be
treated as static pointers (as standard UNIX \fBdbm\fR does).
.SH LINKING
This library is accessed by specifying \fI\-lgdbm\fR as the last
parameter to the compile line, e.g.:
.sp
.nf
.in +5
gcc \-o prog prog.c \-lgdbm
.in
.fi
.PP
If you wish to use the \fBdbm\fR or \fBndbm\fR compatibility routines,
you must link in the \fIgdbm_compat\fR library as well. For example:
.sp
.nf
.in +5
gcc \-o prog proc.c \-lgdbm \-lgdbm_compat
.in
.fi
.\" .SH BUGS
.SH "BUG REPORTS"
Send bug reports to .
.SH "SEE ALSO"
.BR gdbm_dump (1),
.BR gdbm_load (1),
.BR gdbmtool (1).
.SH AUTHORS
by Philip A. Nelson, Jason Downs and Sergey Poznyakoff.
.SH COPYRIGHT
Copyright \(co 1990 - 2016 Free Software Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see
.SH CONTACTS
You may contact the original author by:
.br
e-mail: phil@cs.wwu.edu
.br
us-mail: Philip A. Nelson
.br
Computer Science Department
.br
Western Washington University
.br
Bellingham, WA 98226
You may contact the current maintainers by:
.br
e-mail: downsj@downsj.com
.br
and
e-mail: gray@gnu.org
.\" Local variables:
.\" eval: (add-hook 'write-file-hooks 'time-stamp)
.\" time-stamp-start: ".TH GDBM 3 \""
.\" time-stamp-format: "%:B %:d, %:y"
.\" time-stamp-end: "\""
.\" time-stamp-line-limit: 20
.\" end:
gdbm-1.18.1/doc/version.texi 0000644 0001750 0001750 00000000136 13364776113 012574 0000000 0000000 @set UPDATED 1 July 2018
@set UPDATED-MONTH July 2018
@set EDITION 1.18.1
@set VERSION 1.18.1
gdbm-1.18.1/doc/gdbm_dump.1 0000644 0001750 0001750 00000005454 13237505627 012243 0000000 0000000 .\" This file is part of GDBM.
.\" Copyright (C) 2013, 2017-2018 Free Software Foundation, Inc.
.\"
.\" GDBM is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 3, or (at your option)
.\" any later version.
.\"
.\" GDBM is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with GDBM. If not, see . */
.TH GDBM_DUMP 1 "May 8, 2013" "GDBM" "GDBM User Reference"
.SH NAME
gdbm_dump \- dump a GDBM database to a file
.SH SYNOPSIS
\fBgdbm_dump\fR [\fB\-H \fIFMT\fR] [\fB\-\-format\fR=\fIFMT\fR] \fIDB_FILE\fR [\fIFILE\fR]
.sp
\fBgdbm_dump\fR [\fB\-Vh\fR] [\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-\-version\fR]
.SH DESCRIPTION
The
.B gdbm_dump
utility creates a dump of the specified
.BR gdbm (3)
database file. The name for the output dump file is supplied by the
second argument (\fIFILE\fR). If not specified, the output goes to
the standard error.
.PP
The created dump can be given as argument to the
.BR gdbm_load (1)
utility in order to re-create an exact copy of the \fIDB_FILE\fR.
.SH OPTIONS
.TP
\fB\-H\fR, \fB\-\-format\fR=\fIFMT\fR
Select dump format. The value \fBbinary\fR (or \fB0\fR) instructs
.B gdbm_dump
to produce a binary dump, compatible with earlier
.B gdbm
versions (up to version 1.9). The value \fBascii\fR (or \fB1\fR)
instructs it to create an ASCII dump (this is the default). The
latter is preferred because, apart from the actual data, it also
contains meta-information which will allow
.BR gdbm_load (1)
to recreate an exact copy of the file.
.TP
\fB\-h\fR, \fB\-\-help\fR
Print a short usage summary.
.TP
\fB\-\-usage\fR
Print a list of available options.
.TP
\fB\-V\fR, \fB\-\-version\fR
Print program version
.SH "SEE ALSO"
.BR gdbm_load (1),
.BR gdbmtool (1),
.BR gdbm (3).
.PP
For a detailed description of
.B gdbm_dump
and other
.B gdbm
utilities, refer to the \fBGDBM Manual\fR available in
Texinfo format. To access it, run:
\fBinfo gdbm\fR
.SH "REPORTING BUGS"
Report bugs to .
.SH COPYRIGHT
Copyright \(co 2013 Free Software Foundation, Inc
.br
.na
License GPLv3+: GNU GPL version 3 or later
.br
.ad
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.\" Local variables:
.\" eval: (add-hook 'write-file-hooks 'time-stamp)
.\" time-stamp-start: ".TH GDBM[A-Z_-]* 1 \""
.\" time-stamp-format: "%:B %:d, %:y"
.\" time-stamp-end: "\""
.\" time-stamp-line-limit: 20
.\" end:
gdbm-1.18.1/doc/Makefile.in 0000644 0001750 0001750 00000076533 13364776062 012302 0000000 0000000 # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# This file is part of GDBM. -*- Makefile -*-
# Copyright (C) 2007, 2011, 2014-2018 Free Software Foundation, Inc.
#
# GDBM is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GDBM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GDBM. If not, see . */
# Documentation
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \
$(srcdir)/stamp-vti $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/autoconf.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
am__v_DVIPS_0 = @echo " DVIPS " $@;
am__v_DVIPS_1 =
AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
am__v_MAKEINFO_0 = @echo " MAKEINFO" $@;
am__v_MAKEINFO_1 =
AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
am__v_INFOHTML_0 = @echo " INFOHTML" $@;
am__v_INFOHTML_1 =
AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@;
am__v_TEXI2DVI_1 =
AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@;
am__v_TEXI2PDF_1 =
AM_V_texinfo = $(am__v_texinfo_@AM_V@)
am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
am__v_texinfo_0 = -q
am__v_texinfo_1 =
AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
am__v_texidevnull_0 = > /dev/null
am__v_texidevnull_1 =
INFO_DEPS = $(srcdir)/gdbm.info
TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex
am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux
DVIS = gdbm.dvi
PDFS = gdbm.pdf
PSS = gdbm.ps
HTMLS = gdbm.html
TEXINFOS = gdbm.texi
TEXI2PDF = $(TEXI2DVI) --pdf --batch
MAKEINFOHTML = $(MAKEINFO) --html
AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
DVIPS = dvips
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" \
"$(DESTDIR)$(man3dir)"
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
man1dir = $(mandir)/man1
man3dir = $(mandir)/man3
NROFF = nroff
MANS = $(dist_man_MANS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(dist_man_MANS) $(gdbm_TEXINFOS) \
$(srcdir)/Makefile.in $(top_srcdir)/build-aux/mdate-sh \
$(top_srcdir)/build-aux/texinfo.tex
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOM4TE = @AUTOM4TE@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE64_BIN = @BASE64_BIN@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPATINCLUDEDIR = @COMPATINCLUDEDIR@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CURSES_LIBS = @CURSES_LIBS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GDBM_COUNT_T = @GDBM_COUNT_T@
GDBM_DEBUG_ENABLE = @GDBM_DEBUG_ENABLE@
GDBM_VERSION_MAJOR = @GDBM_VERSION_MAJOR@
GDBM_VERSION_MINOR = @GDBM_VERSION_MINOR@
GDBM_VERSION_PATCH = @GDBM_VERSION_PATCH@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GZIP_BIN = @GZIP_BIN@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LFLAGS_DEBUG = @LFLAGS_DEBUG@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POSUB = @POSUB@
RANLIB = @RANLIB@
READLINE_LIBS = @READLINE_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
YACC = @YACC@
YFLAGS = @YFLAGS@
YFLAGS_DEBUG = @YFLAGS_DEBUG@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
info_TEXINFOS = gdbm.texi
gdbm_TEXINFOS = \
fdl.texi
dist_man_MANS = gdbm.3 gdbm_dump.1 gdbm_load.1 gdbmtool.1
GENDOCS = $(srcdir)/gendocs.sh --no-copy-images --html '--init-file=$(abs_srcdir)/html.init'
TEXI2DVI = texi2dvi -t '@set $(RENDITION)'
all: all-am
.SUFFIXES:
.SUFFIXES: .dvi .html .info .pdf .ps .texi
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnits doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
.texi.info:
$(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
am__cwd=`pwd` && $(am__cd) $(srcdir) && \
rm -rf $$backupdir && mkdir $$backupdir && \
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
done; \
else :; fi && \
cd "$$am__cwd"; \
if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-o $@ $<; \
then \
rc=0; \
$(am__cd) $(srcdir); \
else \
rc=$$?; \
$(am__cd) $(srcdir) && \
$$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
fi; \
rm -rf $$backupdir; exit $$rc
.texi.dvi:
$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
$(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
$<
.texi.pdf:
$(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
$(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
$<
.texi.html:
$(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
$(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-o $(@:.html=.htp) $<; \
then \
rm -rf $@ && mv $(@:.html=.htp) $@; \
else \
rm -rf $(@:.html=.htp); exit 1; \
fi
$(srcdir)/gdbm.info: gdbm.texi $(srcdir)/version.texi $(gdbm_TEXINFOS)
gdbm.dvi: gdbm.texi $(srcdir)/version.texi $(gdbm_TEXINFOS)
gdbm.pdf: gdbm.texi $(srcdir)/version.texi $(gdbm_TEXINFOS)
gdbm.html: gdbm.texi $(srcdir)/version.texi $(gdbm_TEXINFOS)
$(srcdir)/version.texi: $(srcdir)/stamp-vti
$(srcdir)/stamp-vti: gdbm.texi $(top_srcdir)/configure
@(dir=.; test -f ./gdbm.texi || dir=$(srcdir); \
set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/gdbm.texi`; \
echo "@set UPDATED $$1 $$2 $$3"; \
echo "@set UPDATED-MONTH $$2 $$3"; \
echo "@set EDITION $(VERSION)"; \
echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \
(cmp -s vti.tmp$$$$ $(srcdir)/version.texi \
|| (echo "Updating $(srcdir)/version.texi" && \
cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \
mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \
rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$
@cp $(srcdir)/version.texi $@
mostlyclean-vti:
-rm -f vti.tmp* $(srcdir)/version.texi.tmp*
maintainer-clean-vti:
-rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
.dvi.ps:
$(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
$(DVIPS) $(AM_V_texinfo) -o $@ $<
uninstall-dvi-am:
@$(NORMAL_UNINSTALL)
@list='$(DVIS)'; test -n "$(dvidir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
rm -f "$(DESTDIR)$(dvidir)/$$f"; \
done
uninstall-html-am:
@$(NORMAL_UNINSTALL)
@list='$(HTMLS)'; test -n "$(htmldir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
done
uninstall-info-am:
@$(PRE_UNINSTALL)
@if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \
done; \
else :; fi
@$(NORMAL_UNINSTALL)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
(if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
else :; fi); \
done
uninstall-pdf-am:
@$(NORMAL_UNINSTALL)
@list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
done
uninstall-ps-am:
@$(NORMAL_UNINSTALL)
@list='$(PSS)'; test -n "$(psdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
rm -f "$(DESTDIR)$(psdir)/$$f"; \
done
dist-info: $(INFO_DEPS)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; \
for base in $$list; do \
case $$base in \
$(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
if test -f $$base; then d=.; else d=$(srcdir); fi; \
base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \
for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
if test -f $$file; then \
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
test -f "$(distdir)/$$relfile" || \
cp -p $$file "$(distdir)/$$relfile"; \
else :; fi; \
done; \
done
mostlyclean-aminfo:
-rm -rf gdbm.t2d gdbm.t2p
clean-aminfo:
-test -z "gdbm.dvi gdbm.pdf gdbm.ps gdbm.html" \
|| rm -rf gdbm.dvi gdbm.pdf gdbm.ps gdbm.html
maintainer-clean-aminfo:
@list='$(INFO_DEPS)'; for i in $$list; do \
i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
done
install-man1: $(dist_man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(dist_man_MANS)'; \
test -n "$(man1dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.1[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
install-man3: $(dist_man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(dist_man_MANS)'; \
test -n "$(man3dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.3[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
done; }
uninstall-man3:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man3dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.3[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-info
check-am: all-am
check: check-am
all-am: Makefile $(INFO_DEPS) $(MANS)
installdirs:
for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-aminfo clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am: $(DVIS)
html: html-am
html-am: $(HTMLS)
info: info-am
info-am: $(INFO_DEPS)
install-data-am: install-info-am install-man
install-dvi: install-dvi-am
install-dvi-am: $(DVIS)
@$(NORMAL_INSTALL)
@list='$(DVIS)'; test -n "$(dvidir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
$(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
done
install-exec-am:
install-html: install-html-am
install-html-am: $(HTMLS)
@$(NORMAL_INSTALL)
@list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
$(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
$(am__strip_dir) \
d2=$$d$$p; \
if test -d "$$d2"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
$(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
$(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
else \
list2="$$list2 $$d2"; \
fi; \
done; \
test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
done; }
install-info: install-info-am
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
$(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
fi; \
for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
$$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
if test -f $$ifile; then \
echo "$$ifile"; \
else : ; fi; \
done; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
@$(POST_INSTALL)
@if $(am__can_run_installinfo); then \
list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
done; \
else : ; fi
install-man: install-man1 install-man3
install-pdf: install-pdf-am
install-pdf-am: $(PDFS)
@$(NORMAL_INSTALL)
@list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done
install-ps: install-ps-am
install-ps-am: $(PSS)
@$(NORMAL_INSTALL)
@list='$(PSS)'; test -n "$(psdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-vti
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \
mostlyclean-libtool mostlyclean-vti
pdf: pdf-am
pdf-am: $(PDFS)
ps: ps-am
ps-am: $(PSS)
uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
uninstall-man uninstall-pdf-am uninstall-ps-am
uninstall-man: uninstall-man1 uninstall-man3
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-aminfo clean-generic \
clean-libtool cscopelist-am ctags-am dist-info distclean \
distclean-generic distclean-libtool distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-man1 install-man3 \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-vti mostlyclean \
mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool \
mostlyclean-vti pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-dvi-am uninstall-html-am \
uninstall-info-am uninstall-man uninstall-man1 uninstall-man3 \
uninstall-pdf-am uninstall-ps-am
.PRECIOUS: Makefile
# Make sure you set TEXINPUTS.
# TEXINPUTS=/usr/share/texmf/pdftex/plain/misc/ is ok for most distributions
.PHONY: manual
manual:
TEXINPUTS=$(srcdir):$(top_srcdir)/build-aux:$(TEXINPUTS) \
MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
TEXI2DVI="$(TEXI2DVI) -t @finalout" \
$(GENDOCS) --no-copy-images $(PACKAGE) '$(PACKAGE_NAME) manual'
# Checking
check-tabs:
@if test -n "`cat $(info_TEXINFOS) $(gdbm_TEXINFOS) | tr -d -c '\t'`"; then \
echo "Sources contain tabs; run make untabify"; \
false; \
fi
check-sentence-spacing:
@if grep -q '\. [@A-Z]' $(info_TEXINFOS) $(gdbm_TEXINFOS); then \
echo >&2 "Sources contain single-space sentence separators"; \
echo >&2 "Run make fix-sentence-spacing to fix"; \
fi
check-fixmes:
@for file in $(info_TEXINFOS) $(gdbm_TEXINFOS); \
do \
sed -e = $$file | \
sed -n 'N;/@c *FIXME:/{s/\(^[0-9][0-9]*\).*@c *FIXME:\(.*\)/'$$file':\1: \2/gp}'; \
done > $@-t; \
if [ -s $@-t ]; then \
echo "Unresolved FIXMEs:"; \
cat $@-t; \
rm $@-t; \
false; \
else \
rm -f $@-t; \
fi
check-format: check-tabs check-sentence-spacing
check-docs: check-format check-fixmes
untabify:
emacs -batch -l untabify.el $(info_TEXINFOS) $(gdbm_TEXINFOS)
fix-sentence-spacing:
for file in $(info_TEXINFOS) $(gdbm_TEXINFOS); \
do \
if grep -q '\. [@A-Z]' $$file; then \
mv $$file $${file}~; \
sed -r 's/\. ([@A-Z])/. \1/g' $${file}~ > $$file; \
fi; \
done
final: untabify fix-sentence-spacing
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
gdbm-1.18.1/doc/gdbm.texi 0000644 0001750 0001750 00000304167 13316076510 012022 0000000 0000000 \input texinfo @c -*- Texinfo -*-
@comment $Id$
@comment %**start of header (This is for running Texinfo on a region.)
@setfilename gdbm.info
@include version.texi
@settitle GDBM manual
@ifinfo
@dircategory Programming & development tools
@direntry
* GDBM: (gdbm). The GNU database manager.
* gdbm_dump: (gdbm) gdbm_dump. Dump the GDBM database into a flat file.
* gdbm_load: (gdbm) gdbm_load. Load the database from a flat file.
* gdbmtool: (gdbm) gdbmtool. Examine and modify a GDBM database.
@end direntry
@end ifinfo
@c @setchapternewpage odd
@comment %**end of header (This is for running Texinfo on a region.)
@c Use @kwindex for keywords
@defcodeindex kw
@syncodeindex kw cp
@c Use @flindex for files
@defcodeindex fl
@syncodeindex fl cp
@c Use @prindex for programs
@defcodeindex pr
@syncodeindex pr cp
@c Merge all indices into a single one
@syncodeindex fn cp
@syncodeindex vr cp
@syncodeindex ky cp
@syncodeindex pg cp
@syncodeindex tp cp
@iftex
@finalout
@end iftex
@copying
Published by the Free Software Foundation,
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA
Copyright @copyright{} 1989-1999, 2007-2018 Free Software Foundation,
Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover, and no Back-Cover texts.
A copy of the license is included in the section entitled ``GNU Free
Documentation License.''
@end copying
@titlepage
@sp 6
@center @titlefont{GNU dbm}
@sp 2
@center A Database Manager
@sp 2
@center by Philip A. Nelson, Jason Downs and Sergey Poznyakoff
@sp 4
@center Manual by Pierre Gaumond, Philip A. Nelson, Jason Downs
@center and Sergey Poznyakoff
@sp 1
@center Edition @value{EDITION}
@sp 1
@center for GNU @code{dbm}, Version @value{VERSION}
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@ifnothtml
@page
@summarycontents
@page
@end ifnothtml
@contents
@ifnottex
@node Top
@top The GNU database manager.
GNU @code{dbm} is a library of functions implementing a hashed database
on a disk file. This manual documents GNU @code{dbm} Version @value{VERSION}
(@code{gdbm}). The software was originally written by Philip A.@:
Nelson. This document was originally written by Pierre Gaumond from
texts written by Phil.
@end ifnottex
@menu
Introduction:
* Copying:: Your rights.
* Intro:: Introduction to GNU dbm.
* List:: List of functions.
Functions:
* Open:: Opening the database.
* Close:: Closing the database.
* Count:: Counting records in the database.
* Store:: Inserting and replacing records in the database.
* Fetch:: Searching records in the database.
* Delete:: Removing records from the database.
* Sequential:: Sequential access to records.
* Reorganization:: Database reorganization.
* Sync:: Insure all writes to disk have competed.
* Flat files:: Export and import to Flat file format.
* Errors:: Error handling.
* Recovery:: Recovery from fatal errors.
* Options:: Setting internal options.
* Locking:: File locking.
* Variables:: Useful global variables.
* Error codes:: Error codes returned by @code{gdbm} calls.
* Compatibility:: Compatibility with UNIX dbm and ndbm.
Programs
* gdbmtool:: Examine and modify a GDBM database.
* gdbm_dump:: Dump the database into a flat file.
* gdbm_load:: Load the database from a flat file.
* Exit codes:: Exit codes returned by GDBM utilities.
Other topics:
* Bugs:: Problems and bugs.
* Resources:: Additional resources,
* GNU Free Documentation License:: Document license.
* Index:: Index
@end menu
@node Copying
@chapter Copying Conditions.
This library is @dfn{free}; this means that everyone is free to use
it and free to redistribute it on a free basis. GNU @code{dbm} (@code{gdbm})
is not in the public domain; it is copyrighted and there
are restrictions on its distribution, but these restrictions are
designed to permit everything that a good cooperating citizen would want
to do. What is not allowed is to try to prevent others from further
sharing any version of @code{gdbm} that they might get from
you.@refill
Specifically, we want to make sure that you have the right to give
away copies @code{gdbm}, that you receive
source code or else can get it if you want it, that you can change these
functions or use pieces of them in new free programs, and that you know
you can do these things.@refill
To make sure that everyone has such rights, we have to forbid you to
deprive anyone else of these rights. For example, if you distribute
copies @code{gdbm}, you must give the recipients all
the rights that you have. You must make sure that they, too, receive or
can get the source code. And you must tell them their rights.@refill
Also, for our own protection, we must make certain that everyone finds
out that there is no warranty for anything in the @code{gdbm} distribution.
If these functions are modified by someone else and passed on, we want
their recipients to know that what they have is not what we distributed,
so that any problems introduced by others will not reflect on our
reputation.@refill
@code{Gdbm} is currently distributed under the terms of the GNU General
Public License, Version 3. (@emph{NOT} under the GNU General Library
Public License.) A copy the GNU General Public License is included with
the distribution of @code{gdbm}.
@node Intro
@chapter Introduction to GNU @code{dbm}.
GNU @code{dbm} (@code{gdbm}) is a library of database functions that use
extensible hashing and works similar to the standard UNIX @code{dbm}
functions. These routines are provided to a programmer needing to
create and manipulate a hashed database. (@code{gdbm} is @emph{NOT} a
complete database package for an end user.)
The basic use of @code{gdbm} is to store key/data pairs in a data file.
Each key must be unique and each key is paired with only one data item.
The keys can not be directly accessed in sorted order. The basic unit
of data in @code{gdbm} is the structure:
@example
typedef struct @{
char *dptr;
int dsize;
@} datum;
@end example
This structure allows for arbitrary sized keys and data items.
The key/data pairs are stored in a @code{gdbm} disk file, called a
@code{gdbm} database. An application must open a @code{gdbm} database
to be able manipulate the keys and data contained in the database.
@code{gdbm} allows an application to have multiple databases open at the
same time. When an application opens a @code{gdbm} database, it is
designated as a @code{reader} or a @code{writer}. A @code{gdbm}
database can be opened by at most one writer at a time. However, many readers
may open the database simultaneously. Readers and writers can not
open the @code{gdbm} database at the same time.
@node List
@chapter List of functions.
The following is a quick list of the functions contained in the @code{gdbm}
library. The include file @code{gdbm.h}, that can be included by the user,
contains a definition of these functions.
@example
#include
GDBM_FILE gdbm_open(name, block_size, flags, mode, fatal_func);
int gdbm_close(dbf);
int gdbm_store(dbf, key, content, flag);
datum gdbm_fetch(dbf, key);
int gdbm_delete(dbf, key);
datum gdbm_firstkey(dbf);
datum gdbm_nextkey(dbf, key);
int gdbm_reorganize(dbf);
int gdbm_sync(dbf);
int gdbm_exists(dbf, key);
char *gdbm_strerror(errno);
int gdbm_setopt(dbf, option, value, size);
int gdbm_fdesc(dbf);
int gdbm_export (GDBM_FILE, const char *, int, int);
int gdbm_export_to_file (GDBM_FILE dbf, FILE *fp);
int gdbm_import (GDBM_FILE, const char *, int);
int gdbm_import_from_file (GDBM_FILE dbf, FILE *fp, int flag);
int gdbm_count (GDBM_FILE dbf, gdbm_count_t *pcount);
int gdbm_version_cmp (int const a[], int const b[]);
@end example
The @code{gdbm.h} include file is often in the @file{/usr/include}
directory. (The actual location of @code{gdbm.h} depends on your local
installation of @code{gdbm}.)
@node Open
@chapter Opening the database.
@cindex opening the database
@cindex database, opening or creating
@deftypefn {gdbm interface} GDBM_FILE gdbm_open (const char *@var{name}, int @var{block_size}, @
int @var{flags}, int @var{mode}, void (*fatal_func)(const char *))
Initializes @code{gdbm} system. If the file has a size of zero bytes, a file
initialization procedure is performed, setting up the initial structure in the
file.
The arguments are:
@table @var
@item name
The name of the file (the complete name, @code{gdbm} does not append any
characters to this name).
@item block_size
It is used during initialization to determine the size of various
constructs. It is the size of a single transfer from disk to
memory. This parameter is ignored if the file has been previously
initialized. If the value is less than 512, the file system block
size is used instead. The size is adjusted so that the block can hold
exact number of directory entries, so that the effective block size
can be slightly greater than requested. However, if the
@samp{GDBM_BSEXACT} flag is set and the size needs to be adjusted, the
function will return with error status, setting the @samp{gdbm_errno}
variable to @samp{GDBM_BLOCK_SIZE_ERROR}.
@item flags
@kwindex GDBM_READER
@kwindex GDBM_WRITER
@kwindex GDBM_WRCREAT
@kwindex GDBM_NEWDB
If @code{flags} is set to @samp{GDBM_READER}, the user wants to just read the
database and any call to @code{gdbm_store} or @code{gdbm_delete} will fail.
Many readers can access the database at the same time. If @code{flags} is
set to @samp{GDBM_WRITER}, the user wants both read and write access
to the database and requires exclusive access. If @code{flags} is set
to @samp{GDBM_WRCREAT}, the user wants both read and write access to
the database and wants it created if it does not already exist. If
@code{flags} is set to @samp{GDBM_NEWDB}, the user want a new database
created, regardless of whether one existed, and wants read and write
access to the new database.
@kwindex GDBM_SYNC
@kwindex GDBM_NOLOCK
@kwindex GDBM_NOMMAP
The following may also be logically or'd into the database flags:
@samp{GDBM_SYNC}, which causes all database operations to be
synchronized to the disk, @samp{GDBM_NOLOCK}, which prevents the library
from performing any locking on the database file, and @samp{GDBM_NOMMAP},
which disables the memory mapping mechanism. The option @samp{GDBM_FAST} is
now obsolete, since @code{gdbm} defaults to no-sync mode.
@kwindex GDBM_BSEXACT
If this flag is set and the requested @var{block_size} cannot be used
without adjustment, @code{gdbm_open} will refuse to create the
databases. In this case it will set the @samp{gdbm_errno}
variable to @samp{GDBM_BLOCK_SIZE_ERROR} and return @samp{NULL}.
@kwindex GDBM_CLOEXEC
@cindex close-on-exec
If the host @samp{open} call
@ifhtml
(@uref{http://www.manpagez.com/man/2/open, open(2)})
@end ifhtml
@ifnothtml
(@pxref{open,,,open(2),open(2) man page})
@end ifnothtml
supports the @samp{O_CLOEXEC} flag, the @samp{GDBM_CLOEXEC} can be
or'd into the flags, to enable the close-on-exec flag for the
database file descriptor.
@item mode
File mode (see
@ifhtml
@uref{http://www.manpagez.com/man/2/chmod},
@end ifhtml
@ifnothtml
@ref{chmod,,change permissions of a file,chmod(2),
chmod(2) man page},
@end ifnothtml
and
@ifhtml
@uref{http://www.manpagez.com/man/2/open}),
@end ifhtml
@ifnothtml
@pxref{open,,open a file,open(2), open(2) man page}),
@end ifnothtml
which is used if the file is created).
@item fatal_func
A function for @code{gdbm} to call if it detects a fatal error. The only
parameter of this function is a string. If the value of @samp{NULL} is
provided, @code{gdbm} will use a default function.
@end table
The return value, is the pointer needed by all other functions to
access that @code{gdbm} file. If the return is the @samp{NULL} pointer,
@code{gdbm_open} was not successful. The errors can be found in
@code{gdbm_errno} variable (@pxref{Variables, gdbm_errno}). Available
error codes are discussed in @ref{Error codes}.
In all of the following calls, the parameter @var{dbf} refers to the pointer
returned from @code{gdbm_open}.
@end deftypefn
@deftypefn {gdbm interface} GDBM_FILE gdbm_fd_open (int @var{fd},@
const char *@var{name}, int @var{block_size}, @
int @var{flags}, int @var{mode}, void (*fatal_func)(const char *))
Alternative function for opening a GDBM database. The @var{fd}
argument is the file descriptor of the database file obtained by a
call to @code{open}(2), @code{creat}(2) or similar funcionss. The
descriptor is not dup'ed, and will be closed when the returned
GDBM_FILE is closed. Use @code{dup}(2) if that is not desirable.
@end deftypefn
@deftypefn {gdbm interface} int gdbm_copy_meta (GDBM_FILE @var{dst},@
GDBM_FILE @var{src})
Copy file ownership and mode from @var{src} to @var{dst}.
@end deftypefn
@node Close
@chapter Closing the database.
@cindex closing database
@cindex database, closing
It is important that every file opened is also closed. This is needed to
update the reader/writer count on the file:
@deftypefn {gdbm interface} int gdbm_close (GDBM_FILE @var{dbf})
This function closes the @code{gdbm} file and frees all memory
associated with it. The parameter is:
@table @var
@item dbf
The pointer returned by @code{gdbm_open}.
@end table
@code{Gdbm_close} returns 0 on success. On error, it sets
@code{gdbm_errno} and system @code{errno} variables to the codes
describing the error and returns -1.
@end deftypefn
@node Count
@chapter Number of Records
@cindex number of records
@deftypefn {gdbm interface} int gdbm_count (GDBM_FILE @var{dbf}, @
gdbm_count_t *@var{pcount})
Counts number of records in the database @var{dbf}. On success,
stores it in the memory location pointed to by @var{pcount} and return
0. On error, sets @code{gdbm_errno} (if relevant, also @code{errno})
and returns -1.
@end deftypefn
@node Store
@chapter Inserting and replacing records in the database.
@cindex storing records
@cindex records, storing
@deftypefn {gdbm interface} int gdbm_store (GDBM_FILE @var{dbf}, datum @var{key}, @
datum @var{content}, int @var{flag})
The function @code{gdbm_store} inserts or replaces records in the database.
The parameters are:
@table @var
@item dbf
The pointer returned by @code{gdbm_open}.
@item key
The search key.
@item content
The data to be associated with the key.
@item flag
@kwindex GDBM_REPLACE
@kwindex GDBM_INSERT
Defines the action to take when the key is already in the database. The value
@samp{GDBM_REPLACE} (defined in @file{gdbm.h}) asks that the old data
be replaced by the new @var{content}. The value @samp{GDBM_INSERT}
asks that an error be returned and no action taken if the @var{key}
already exists.
@end table
This function can return the following values:
@table @asis
@item -1
The item was not stored in the database because the caller was not an
official writer or either @var{key} or @var{content} have a
@samp{NULL} @samp{dptr} field.
Both @var{key} and @var{content} must have the @samp{dptr} field be a
non-@samp{NULL} value. Since a @samp{NULL} @samp{dptr} field is used by
other functions to indicate an error, it cannot be valid data.
@item +1
The item was not stored because the argument @var{flag} was
@samp{GDBM_INSERT} and the @var{key} was already in the database.
@item 0
No error. The value of @var{content} is keyed by @var{key}. The file
on disk is updated to reflect the structure of the new database before
returning from this function.
@end table
@end deftypefn
If you store data for a @var{key} that is already in the data base,
@code{gdbm} replaces the old data with the new data if called with
@samp{GDBM_REPLACE}. You do not get two data items for the same
@code{key} and you do not get an error from @code{gdbm_store}.
The size in @code{gdbm} is not restricted like @code{dbm} or @code{ndbm}. Your
data can be as large as you want.
@node Fetch
@chapter Searching for records in the database.
@cindex fetching records
@cindex looking up records
@cindex record, fetching
@deftypefn {gdbm interface} datum gdbm_fetch (GDBM_FILE @var{dbf}, datum @var{key})
Looks up a given @var{key} and returns the information associated with it.
The @samp{dptr} field in the structure that is returned points to a
memory block allocated by @code{malloc}. It is the caller's
responsibility to free it when no longer needed.
If the @samp{dptr} is @samp{NULL}, inspect the value of the
@code{gdbm_errno} variable (@pxref{Variables,gdbm_errno}). If it is
@samp{GDBM_ITEM_NOT_FOUND}, no data was found. Any other value means an
error occurred. Use @code{gdbm_strerror} function to convert
@code{gdbm_errno} to a human-readable string.
The parameters are:
@table @var
@item dbf
The pointer returned by @code{gdbm_open}.
@item key
The search key.
@end table
@end deftypefn
An example of using this function:
@example
content = gdbm_fetch (dbf, key);
if (content.dptr == NULL)
@{
fprintf(stderr, "key not found\n");
@}
else
@{
/* do something with content.dptr */
@}
@end example
@cindex records, testing existence
You may also search for a particular key without retrieving it:
@deftypefn {gdbm interface} int gdbm_exists (GDBM_FILE @var{dbf}, datum @var{key})
Checks whether the @var{key} exists in the database @var{dbf}.
If @var{key} is found, returns @samp{true} (@samp{1}). If it is not
found, returns @samp{false} (@samp{0}) and sets @code{gdbm_errno} to
@samp{GDBM_NO_ERROR} (@samp{0}).
On error, returns @samp{0} and sets @code{gdbm_errno} to a
non-@samp{0} error code.
The parameters are:
@table @var
@item dbf
The pointer returned by @code{gdbm_open}.
@item key
The search key.
@end table
@end deftypefn
@node Delete
@chapter Removing records from the database.
@cindex deleting records
@cindex record, deleting
To remove some data from the database, use the @code{gdbm_delete}
function.
@deftypefn {gdbm interface} int gdbm_delete (GDBM_FILE @var{dbf}, datum @var{key})
Deletes the data associated with the given @var{key}, if it exists in
the database @var{dbf}. The file on disk is updated to reflect the
structure of the new database before returning from this function.
The parameters are:
@table @var
@item dbf
The pointer returned by @code{gdbm_open}.
@item datum key
The search key.
@end table
The function returns @samp{-1} if the item is not present or the
requester is a reader. The return of @samp{0} marks a successful delete.
@end deftypefn
@node Sequential
@chapter Sequential access to records.
@cindex sequential access
@cindex iterating over records
@cindex records, iterating over
The next two functions allow for accessing all items in the database. This
access is not @code{key} sequential, but it is guaranteed to visit every
@code{key} in the database once. The order has to do with the hash values.
@code{gdbm_firstkey} starts the visit of all keys in the database.
@code{gdbm_nextkey} finds and reads the next entry in the hash structure for
@code{dbf}.
@deftypefn {gdbm interface} datum gdbm_firstkey (GDBM_FILE @var{dbf})
Initiate sequential access to the database @var{dbf}. The returned
value is the first key accessed in the database. If the @samp{dptr}
field in the returned datum is @samp{NULL}, inspect the
@code{gdbm_errno} variable (@pxref{Variables, gdbm_errno}). The value
of @code{GDBM_ITEM_NOT_FOUND} means that the database contains no
data. Other value means an error occurred.
Otherwise, @samp{dptr} points to a memory block obtained from
@code{malloc}, which holds the key value. The caller is responsible
for freeing this memory block when no longer needed.
@end deftypefn
@deftypefn {gdbm interface} datum gdbm_nextkey (GDBM_FILE @var{dbf}, datum @var{prev})
This function continues the iteration over the keys in @var{dbf},
initiated by @code{gdbm_firstkey}. The parameter @var{prev} holds the
value returned from a previous call to @code{gdbm_nextkey} or
@code{gdbm_firstkey}.
The function returns next key from the database. If the @samp{dptr}
field in the returned datum is @samp{NULL} inspect the
@code{gdbm_errno} variable (@pxref{Variables, gdbm_errno}). The value
of @code{GDBM_ITEM_NOT_FOUND} means that all keys in the database
has been visited. Any other value means an error occurred.
Otherwise, @samp{dptr} points to a memory block obtained from
@code{malloc}, which holds the key value. The caller is responsible
for freeing this memory block when no longer needed.
@end deftypefn
@cindex iteration loop
These functions were intended to visit the database in read-only algorithms,
for instance, to validate the database or similar operations. The
usual algorithm for sequential access is:
@example
@group
key = gdbm_firstkey (dbf);
while (key.dptr)
@{
datum nextkey;
/* do something with the key */
...
/* Obtain the next key */
nextkey = gdbm_nextkey (dbf, key);
/* Reclaim the memory used by the key */
free (key.dptr);
/* Use nextkey in the next iteration. */
key = nextkey;
@}
@end group
@end example
@cindex iteration and @code{gdbm_delete}
@cindex deletion in iteration loops
@cindex @code{gdbm_delete} and sequential access
Care should be taken when the @code{gdbm_delete} function is used in
such a loop. File visiting is based on a @dfn{hash table}. The
@code{gdbm_delete} function re-arranges the hash table to make sure
that any collisions in the table do not leave some item
@dfn{un-findable}. The original key order is @emph{not} guaranteed to
remain unchanged in all instances. So it is possible that some key
will not be visited if a loop like the following is executed:
@example
@group
key = gdbm_firstkey (dbf);
while (key.dptr)
@{
datum nextkey;
if (some condition)
@{
gdbm_delete (dbf, key);
@}
nextkey = gdbm_nextkey (dbf, key);
free (key.dptr);
key = nextkey;
@}
@end group
@end example
@node Reorganization
@chapter Database reorganization.
@cindex database reorganization
@cindex reorganization, database
The following function should be used very seldom.
@deftypefn {gdbm interface} int gdbm_reorganize (GDBM_FILE @var{dbf})
Reorganizes the database.
The parameter is:
@table @var
@item dbf
The pointer returned by @code{gdbm_open}.
@end table
@end deftypefn
If you have had a lot of deletions and would like to shrink the space
used by the @code{gdbm} file, this function will reorganize the database.
This results, in particular, in shortening the length of a @code{gdbm}
file by removing the space occupied by deleted records.
This reorganization requires creating a new file and inserting all the elements
in the old file @var{dbf} into the new file. The new file is then renamed to
the same name as the old file and @var{dbf} is updated to contain all the
correct information about the new file. If an error is detected, the return
value is negative. The value zero is returned after a successful
reorganization.
@node Sync
@chapter Database Synchronization
@cindex database synchronization
@cindex synchronization, database
@kwindex GDBM_SYNC
Unless your database was opened with the @samp{GDBM_SYNC} flag,
@code{gdbm} does not wait for writes to be flushed to the disk before
continuing. This allows for faster writing of databases at the risk
of having a corrupted database if the application terminates in an
abnormal fashion. The following function allows the programmer to
make sure the disk version of the database has been completely updated
with all changes to the current time.
@deftypefn {gdbm interface} int gdbm_sync (GDBM_FILE @var{dbf})
Synchronizes the changes in @var{dbf} with its disk file. The
parameter is a pointer returned by @code{gdbm_open}.
This function would usually be called after a complete set of changes
have been made to the database and before some long waiting time.
The @code{gdbm_close} function automatically calls the equivalent of
@code{gdbm_sync} so no call is needed if the database is to be closed
immediately after the set of changes have been made.
@code{Gdbm_sync} returns 0 on success. On error, it sets
@code{gdbm_errno} and system @code{errno} variables to the codes
describing the error and returns -1.
@end deftypefn
@node Flat files
@chapter Export and Import
@cindex Flat file format
@cindex export
@cindex import
@code{Gdbm} databases can be converted into so-called @dfn{flat
format} files. Such files cannot be used for searching, their sole
purpose is to keep the data from the database for restoring it when
the need arrives. There are two flat file formats, which differ in
the way they represent the data and in the amount of meta-information
stored. Both formats can be used, for example, to migrate between
the different versions of @code{gdbm} databases. Generally speaking,
flat files are safe to send over the network, and can be used to
recreate the database on another machine. The recreated database is
guaranteed to be a byte-to-byte equivalent of the database from which
the flat file was created. This does not necessarily mean, however,
that this file can be used in the same way as the original one. For
example, if the original database contained non-@acronym{ASCII} data
(e.g.@: @acronym{C} structures, integers etc.), the recreated database
can be of any use only if the target machine has the same integer
size and byte ordering as the source one and if its @acronym{C}
compiler uses the same packing conventions as the one which generated
@acronym{C} which populated the original database. In general, such
binary databases are not portable between machines, unless you follow
some stringent rules on what data is written to them and how it is
interpreted.
The GDBM version @value{VERSION} supports two flat file formats. The
@dfn{binary} flat file format was first implemented in GDBM version
1.9.1. This format stores only key/data pairs, it does not keep
information about the database file itself. As its name implies,
files in this format are binary files.
The @dfn{ascii} flat file format encodes all data in base64 and stores
not only key/data pairs, but also the original database file metadata,
such as file name, mode and ownership. Files in this format can be
sent without additional encapsulation over transmission channels that
normally allow only ASCII data, such as, e.g.@: SMTP. Due to additional
metadata they allow for restoring an exact copy of the database,
including file ownership and privileges, which is especially important
if the database in question contained some security-related data.
We call a process of creating a flat file from a database
@dfn{exporting} or @dfn{dumping} this database. The reverse process,
creating the database from a flat file is called @dfn{importing} or
@dfn{loading} the database.
@deftypefn {gdbm interface} int gdbm_dump (GDBM_FILE @var{dbf}, @
const char *@var{filename}, int @var{format}, @
int @var{open_flags}, int @var{mode})
Dumps the database file to the named file in requested format.
Arguments are:
@table @var
@item dbf
A pointer to the source database, returned by a prior call to
@code{gdbm_open}.
@item filename
Name of the dump file.
@item format
Output file format. Allowed values are: @samp{GDBM_DUMP_FMT_BINARY} to
create a binary dump and @samp{GDBM_DUMP_FMT_ASCII} to create an ASCII
dump file.
@item open_flags
How to create the output file. If @var{flag} is @samp{GDBM_WRCREAT}
the file will be created if it does not exist. If it does exist,
the @code{gdbm_dump} will fail.
If @var{flag} is @samp{GDBM_NEWDB}, the function will create a new
output file, replacing it if it already exists.
@item mode
The permissions to use when creating the output file.
@ifhtml
See @uref{http://www.manpagez.com/man/2/open},
@end ifhtml
@ifnothtml
See @ref{open,,open a file,open(2), open(2) man page},
@end ifnothtml
for a detailed discussion.
@end table
@end deftypefn
@anchor{gdbm_load function}
@deftypefn {gdbm interface} int gdbm_load (GDBM_FILE *@var{pdbf}, @
const char *@var{filename}, int @var{flag}, @
int @var{meta_mask}, @
unsigned long *@var{errline})
Loads data from the dump file @var{filename} into the database pointed
to by @var{pdbf}. The latter can point to @samp{NULL}, in which case
the function will try to create a new database. If it succeeds, the
function will return, in the memory location pointed to by @var{pdbf},
a pointer to the newly created database. If the dump file carries no
information about the original database file name, the function will
set @code{gdbm_errno} to @samp{GDBM_NO_DBNAME} and return
@samp{-1}, indicating failure.
The @var{flag} has the same meaning as the @var{flag} argument
to the @code{gdbm_store} function (@pxref{Store}).
The @var{meta_mask} argument can be used to disable restoring certain
bits of file's meta-data from the information in the input dump file.
It is a binary OR of zero or more of the following:
@table @asis
@item GDBM_META_MASK_MODE
Do not restore file mode.
@item GDBM_META_MASK_OWNER
Do not restore file owner.
@end table
The function returns 0 upon successful completion or -1 on fatal
errors and 1 on mild (non-fatal) errors.
If a fatal error occurs, @code{gdbm_errno} will be set to one of the
following values:
@table @asis
@item GDBM_FILE_OPEN_ERROR
Input file (@var{filename}) cannot be opened. The @code{errno}
variable can be used to get more detail about the failure.
@item GDBM_MALLOC_ERROR
Not enough memory to load data.
@item GDBM_FILE_READ_ERROR
Reading from @var{filename} failed. The @code{errno} variable can be
used to get more detail about the failure.
@item GDBM_ILLEGAL_DATA
Input contained some illegal data.
@item GDBM_ITEM_NOT_FOUND
This error can occur only when the input file is in ASCII format. It
indicates that the data part of the record about to be read lacked
length specification. Application developers are advised to treat
this error equally as @samp{GDBM_ILLEGAL_DATA}.
@end table
Mild errors mean that the function was able to successfully load and
restore the data, but was unable to change database file metadata
afterward. The table below lists possible values for @code{gdbm_errno}
in this case. To get more detail, inspect the system @code{errno} variable.
@table @asis
@kwindex GDBM_ERR_FILE_OWNER
@item GDBM_ERR_FILE_OWNER
The function was unable to restore database file owner.
@kwindex GDBM_ERR_FILE_MODE
@item GDBM_ERR_FILE_MODE
The function was unable to restore database file mode (permission bits).
@end table
If an error occurs while loading data from an input file in ASCII
format, the number of line in which the error occurred will be stored
in the location pointed to by the @var{errline} parameter, unless it
is @samp{NULL}.
If the line information is not available or applicable, @var{errline}
will be set to @samp{0}.
@end deftypefn
@deftypefn {gdbm interface} int gdbm_dump_to_file (GDBM_FILE @var{dbf}, @
FILE *@var{fp}, int @var{format})
This is an alternative entry point to @code{gdbm_dump} (which see).
Arguments are:
@table @var
@item dbf
A pointer to the source database, returned by a call to
@code{gdbm_open}.
@item fp
File to write the data to.
@item format
Format of the dump file. See the @var{format} argument to the
@code{gdbm_dump} function.
@end table
@end deftypefn
@deftypefn {gdbm interface} int gdbm_load_from_file (GDBM_FILE *@var{pdbf}, @
FILE *@var{fp}, int @var{replace}, int @var{meta_mask}, @
unsigned long *@var{line})
This is an alternative entry point to @code{gdbm_dump}. It writes the
output to @var{fp} which must be a file open for writing. The rest of
arguments is the same as for @code{gdbm_load} (excepting of course
@var{flag}, which is not needed in this case).
@end deftypefn
@deftypefn {gdbm interface} int gdbm_export (GDBM_FILE @var{dbf}, @
const char *@var{exportfile}, int @var{flag}, int @var{mode})
This function is retained for compatibility with GDBM 1.10 and
earlier. It dumps the database to a file in binary dump format and
is entirely equivalent to
@example
gdbm_dump(@var{dbf}, @var{exportfile}, GDBM_DUMP_FMT_BINARY,
@var{flag}, @var{mode})
@end example
@end deftypefn
@deftypefn {gdbm interface} int gdbm_export_to_file (GDBM_FILE @var{dbf}, FILE *@var{fp})
This is an alternative entry point to @code{gdbm_export}. This
function writes to file @var{fp} a binary dump of the database @var{dbf}.
@end deftypefn
@deftypefn {gdbm interface} int gdbm_import (GDBM_FILE @var{dbf}, @
const char *@var{importfile}, int @var{flag})
This function is retained for compatibility with GDBM 1.10 and
earlier. It loads the file @var{importfile}, which must be a binary
flat file, into the database @var{dbf} and is equivalent to the
following construct:
@example
@var{dbf} = gdbm_open (@var{importfile}, 0,
@var{flag} == GDBM_REPLACE ?
GDBM_WRCREAT : GDBM_NEWDB,
0600, NULL);
gdbm_load (&@var{dbf}, @var{exportfile}, 0, @var{flag}, NULL)
@end example
@end deftypefn
@deftypefn {gdbm interface} int gdbm_import_from_file (GDBM_FILE @var{dbf}, @
FILE *@var{fp}, int @var{flag})
An alternative entry point to @code{gdbm_import}. Reads the binary
dump from the file @var{fp} and stores the key/value pairs to
@var{dbf}. @xref{Store}, for a description of @var{flag}.
This function is equivalent to:
@example
@var{dbf} = gdbm_open (@var{importfile}, 0,
@var{flag} == GDBM_REPLACE ?
GDBM_WRCREAT : GDBM_NEWDB,
0600, NULL);
gdbm_load_from_file (@var{dbf}, @var{fp}, @var{flag}, 0, NULL);
@end example
@end deftypefn
@node Errors
@chapter Error handling.
@cindex gdbm_errno
@cindex error strings
@cindex global error state
The global variable @code{gdbm_errno} (@pxref{Variables, gdbm_errno})
keeps the error code of the most recent error encountered by GDBM
functions.
To convert this code to human-readable string, use the following function:
@deftypefn {gdbm interface} {const char *} gdbm_strerror (gdbm_error @var{errno})
Converts @var{errno} (which is an integer value) into a human-readable
descriptive text. Returns a pointer to a static string. The caller
must not alter or free the returned pointer.
@end deftypefn
Detailed information about the most recent error that occurred while
operating on a GDBM file is stored in the @code{GDBM_FILE} object
itself. To retrieve it, the following functions are provided:
@cindex error code, most recent
@cindex most recent error code
@deftypefn {gdbm interface} {gdbm_error} gdbm_last_errno (GDBM_FILE @var{dbf})
Returns the code of the most recent error encountered when operating
on @var{dbf}.
@end deftypefn
@deftypefn {gdbm interface} {int} gdbm_last_syserr (GDBM_FILE @var{dbf})
Returns the value of the system @code{errno} variable associated with
the most recent error.
Notice, that not all GDBM errors have an associated system error
code. The following are the ones that have:
@itemize @bullet
@item GDBM_FILE_OPEN_ERROR
@item GDBM_FILE_WRITE_ERROR
@item GDBM_FILE_SEEK_ERROR
@item GDBM_FILE_READ_ERROR
@item GDBM_FILE_STAT_ERROR
@item GDBM_BACKUP_FAILED
@end itemize
For other errors, @code{gdbm_last_syserr} will return 0.
@end deftypefn
@anchor{gdbm_check_syserr}
@deftypefn {gdbm interface} {int} gdbm_check_syserr (gdbm_errno @var{err})
Returns @code{1}, if system errno value should be checked to get more
info on the error described by GDBM code @var{err}.
@end deftypefn
To get a human-readable description of the recent error for a
particular database file, use the @code{gdbm_db_strerror} function:
@deftypefn {gdbm interface} {const char *} gdbm_db_strerror (GDBM_FILE @var{dbf})
Returns textual description of the most recent error encountered when
operating on the database @var{dbf}. The resulting string is often
more informative than what would be returned by
@samp{gdbm_strerror(gdbm_last_errno(@var{dbf}))}. In particular, if
there is a system error associated with the recent failure, it will be
described as well.
@end deftypefn
@deftypefn {gdbm interface} void gdbm_clear_error (GDBM_FILE @var{dbf})
Clears the error state for the database @var{dbf}. Normally, this
function is called upon the entry to any GDBM function.
@end deftypefn
Certain errors (such as write error when saving stored key) can leave
database file in inconistent state. When such a critical error
occurs, the database file is marked as needing recovery. Subsequent
calls to any GDBM functions for that database file (except
@code{gdbm_recover}), will return immediately with GDBM error value
@code{GDBM_NEED_RECOVERY}. Additionally, the following
function can be used to check the state of the database file:
@deftypefn {gdbm interface} int gdbm_needs_recovery (GDBM_FILE @var{dbf})
Returns @code{1} if the database file @var{dbf} is in inconsistent
state and needs recovery.
@end deftypefn
The only way to bring the database back to operational state is to
call the @code{gdbm_recover} function (@pxref{Recovery}).
@node Recovery
@chapter Recovery
Certain errors (such as write error when saving stored key) can leave
database file in @dfn{inconistent state}. When such a critical error
occurs, the database file is marked as needing recovery. Subsequent
calls to any GDBM functions for that database file (except
@code{gdbm_recover}), will return immediately with GDBM error value
@code{GDBM_NEED_RECOVERY}.
To escape from this state and bring the database back to operational
state, use the following function:
@deftypefn {gdbm interface} int gdbm_recover (GDBM_FILE @var{dbf},@
gdbm_recovery *@var{rcvr}, int @var{flags})
Check the database file @var{dbf} and fix eventual errors. The
@var{rcvr} argument points to a structure that has @dfn{input
members}, providing additional information to alter the behavior of
@code{gdbm_recover}, and @dfn{output members}, used to return
additional statistics about the recovery process (@var{rcvr} can be
@code{NULL} if no such information is needed).
Each input member has a corresponding flag bit, which must be set in
the @var{flags} in order to instruct the function to use it.
The @code{gdbm_recover} type is defined as:
@example
typedef struct gdbm_recovery_s
@{
/* Input members.
These are initialized before call to gdbm_recover.
The flags argument specifies which of them are initialized. */
void (*errfun) (void *data, char const *fmt, ...);
void *data;
size_t max_failed_keys;
size_t max_failed_buckets;
size_t max_failures;
/* Output members.
The gdbm_recover function fills these before returning. */
size_t recovered_keys;
size_t recovered_buckets;
size_t failed_keys;
size_t failed_buckets;
char *backup_name;
@} gdbm_recovery;
@end example
The @dfn{input members} modify the behavior of @code{gdbm_recover}:
@deftypeop {input member} gdbm_recovery void (*errfun) (void *@var{data},@
char const *@var{fmt}, ...)
@kwindex GDBM_RCVR_ERRFUN
If the @code{GDBM_RCVR_ERRFUN} flag bit is set, @code{errfun} points
to a function that will be called upon each recoverable or non-fatal
error that occurred during the recovery.
@end deftypeop
@deftypecv {input member} gdbm_recovery {void *} data
Supplies first argument for the @code{errfun} invocations.
@end deftypecv
@deftypecv {input member} gdbm_recovery size_t max_failed_keys
@kwindex GDBM_RCVR_MAX_FAILED_KEYS
If @code{GDBM_RCVR_MAX_FAILED_KEYS} is set, this member sets the limit
on the number of keys that cannot be retrieved. If the number of
failed keys grows bigger than @code{max_failed_keys}, recovery is
aborted and error is returned.
@end deftypecv
@deftypecv {input member} gdbm_recovery size_t max_failed_buckets
@kwindex GDBM_RCVR_MAX_FAILED_BUCKETS
If @code{GDBM_RCVR_MAX_FAILED_BUCKETS} is set, this member sets the limit
on the number of buckets that cannot be retrieved or that contain
bogus information. If the number of failed buckets grows bigger than
@code{max_failed_buckets}, recovery is aborted and error is returned.
@end deftypecv
@deftypecv {output member} gdbm_recovery size_t max_failures
@kwindex GDBM_RCVR_MAX_FAILURES
If @code{GDBM_RCVR_MAX_FAILURES} is set, this member sets the limit
of failures that are tolerated during recovery. If the number of
errors grows bigger than @code{max_failures}, recovery is aborted and
error is returned.
@end deftypecv
The following members are filled on output, upon successful return
from the function:
@deftypecv {output member} gdbm_recovery size_t recovered_keys
Number of recovered keys.
@end deftypecv
@deftypecv {output member} gdbm_recovery size_t recovered_buckets
Number of recovered buckets.
@end deftypecv
@deftypecv {output member} gdbm_recovery size_t failed_keys
Number of key/data pairs that cannot be retrieved.
@end deftypecv
@deftypecv {output member} gdbm_recovery size_t failed_buckets
Number of buckets that cannot be retrieved.
@end deftypecv
@deftypecv {output member} gdbm_recovery {char *} backup_name
@kwindex GDBM_RCVR_BACKUP
Name of the file keeping the copy of the original database, in the
state prior to recovery. It is filled if the @var{GDBM_RCVR_BACKUP}
flag is set. The string is allocated using the @code{malloc} call.
The caller is responsible for freeing that memory when no longer needed.
@end deftypecv
@end deftypefn
@kwindex GDBM_RCVR_FORCE
By default, @code{gdbm_recovery} first checks the database fo
inconsistencies and attempts recovery only if some were found.
The special flag bit @code{GDBM_RCVR_FORCE} instructs
@code{gdbm_recovery} to omit this check and to force recovery
unconditionally.
@node Options
@chapter Setting options
@cindex database options
@cindex options, database
@code{Gdbm} supports the ability to set certain options on an already
open database.
@deftypefn {gdbm interface} int gdbm_setopt (GDBM_FILE @var{dbf}, int @var{option}, @
void *@var{value}, int @var{size})
Sets an option on the database or returns the value of an option.
The parameters are:
@table @var
@item dbf
The pointer returned by @code{gdbm_open}.
@item option
The option to be set or retrieved.
@item value
A pointer to the value to which @var{option} will be set or where to
place the option value (depending on the option).
@item size
The length of the data pointed to by @var{value}.
@end table
@end deftypefn
The valid options are:
@table @asis
@kwindex GDBM_CACHESIZE
@kwindex GDBM_SETCACHESIZE
@item GDBM_SETCACHESIZE
@itemx GDBM_CACHESIZE
Set the size of the internal bucket cache. This option may only be
set once on each GDBM_FILE descriptor, and is set automatically to 100
upon the first access to the database. The @var{value} should point
to a @code{size_t} holding the desired cache size.
The @samp{GDBM_CACHESIZE} option is provided for compatibility with
earlier versions.
@kwindex GDBM_GETCACHESIZE
@item GDBM_GETCACHESIZE
Return the size of the internal bucket cache. The @var{value} should
point to a @code{size_t} variable, where the size will be stored.
@kwindex GDBM_GETFLAGS
@item GDBM_GETFLAGS
Return the flags describing the state of the database. The @var{value} should
point to a @code{int} variable where to store the flags. The return
is the same as the flags used when opening the database (@pxref{Open,
gdbm_open}), except that it reflects the current state (which may have
been altered by another calls to @code{gdbm_setopt}.
@kwindex GDBM_FASTMODE
@item GDBM_FASTMODE
Enable or disable the @dfn{fast writes mode}, i.e.@: writes without
subsequent synchronization. The @var{value} should point
to an integer: @samp{TRUE} to enable fast mode, and @samp{FALSE} to
disable it.
This option is retained for compatibility with previous versions of
@code{gdbm}. Its effect is the reverse of @code{GDBM_SETSYNCMODE}
(see below).
@kwindex GDBM_SETSYNCMODE
@kwindex GDBM_SYNCMODE
@item GDBM_SETSYNCMODE
@itemx GDBM_SYNCMODE
Turn on or off file system synchronization operations. This
setting defaults to off. The @var{value} should point
to an integer: @samp{TRUE} to turn synchronization on, and @samp{FALSE} to
turn it off.
Note, that this option is a reverse of @code{GDBM_FASTMODE},
i.e.@: calling @code{GDBM_SETSYNCMODE} with @samp{TRUE} has the same effect
as calling @code{GDBM_FASTMODE} with @samp{FALSE}.
The @samp{GDBM_SYNCMODE} option is provided for compatibility with
earlier versions.
@kwindex GDBM_GETSYNCMODE
@item GDBM_GETSYNCMODE
Return the current synchronization status. The @var{value} should
point to an @code{int} where the status will be stored.
@kwindex GDBM_SETCENTFREE
@kwindex GDBM_CENTFREE
@item GDBM_SETCENTFREE
@itemx GDBM_CENTFREE
@emph{NOTICE: This feature is still under study.}
Set central free block pool to either on or off. The default is off,
which is how previous versions of @code{gdbm} handled free blocks. If
set, this option causes all subsequent free blocks to be placed in the
@emph{global} pool, allowing (in theory) more file space to be reused
more quickly. The @var{value} should point to an integer: @samp{TRUE} to
turn central block pool on, and @samp{FALSE} to turn it off.
The @samp{GDBM_CENTFREE} option is provided for compatibility with
earlier versions.
@kwindex GDBM_SETCOALESCEBLKS
@kwindex GDBM_COALESCEBLKS
@item GDBM_SETCOALESCEBLKS
@itemx GDBM_COALESCEBLKS
@emph{NOTICE: This feature is still under study.}
Set free block merging to either on or off. The default is off, which
is how previous versions of @code{gdbm} handled free blocks. If set,
this option causes adjacent free blocks to be merged. This can become
a @acronym{CPU} expensive process with time, though, especially if
used in conjunction with GDBM_CENTFREE. The @var{value} should point
to an integer: @samp{TRUE} to turn free block merging on, and @samp{FALSE} to
turn it off.
@kwindex GDBM_GETCOALESCEBLKS
@item GDBM_GETCOALESCEBLKS
Return the current status of free block merging. The @var{value} should
point to an @code{int} where the status will be stored.
@kwindex GDBM_SETMAXMAPSIZE
@item GDBM_SETMAXMAPSIZE
Sets maximum size of a memory mapped region. The @var{value} should
point to a value of type @code{size_t}, @code{unsigned long} or
@code{unsigned}. The actual value is rounded to the nearest page
boundary (the page size is obtained from
@code{sysconf(_SC_PAGESIZE)}).
@kwindex GDBM_GETMAXMAPSIZE
@item GDBM_GETMAXMAPSIZE
Return the maximum size of a memory mapped region. The @var{value} should
point to a value of type @code{size_t} where to return the data.
@kwindex GDBM_SETMMAP
@item GDBM_SETMMAP
Enable or disable memory mapping mode. The @var{value} should point
to an integer: @samp{TRUE} to enable memory mapping or @samp{FALSE} to
disable it.
@kwindex GDBM_GETMMAP
@item GDBM_GETMMAP
Check whether memory mapping is enabled. The @var{value} should point
to an integer where to return the status.
@kwindex GDBM_GETDBNAME
@item GDBM_GETDBNAME
Return the name of the database disk file. The @var{value} should
point to a variable of type @code{char**}. A pointer to the newly
allocated copy of the file name will be placed there. The caller is
responsible for freeing this memory when no longer needed. For
example:
@example
char *name;
if (gdbm_setopt (dbf, GDBM_GETDBNAME, &name, sizeof (name)))
@{
fprintf (stderr, "gdbm_setopt failed: %s\n",
gdbm_strerror (gdbm_errno));
@}
else
@{
printf ("database name: %s\n", name);
free (name);
@}
@end example
@kwindex GDBM_GETBLOCKSIZE
@item GDBM_GETBLOCKSIZE
Return the block size in bytes. The @var{value} should point to @code{int}.
@end table
The return value will be @samp{-1} upon failure, or @samp{0} upon
success. The global variable @code{gdbm_errno} will be set upon failure.
For instance, to set a database to use a cache of 10, after opening it
with @code{gdbm_open}, but prior to accessing it in any way, the following
code could be used:
@example
@group
int value = 10;
ret = gdbm_setopt (dbf, GDBM_CACHESIZE, &value, sizeof (int));
@end group
@end example
@node Locking
@chapter File Locking.
@cindex locking
@kwindex GDBM_NOLOCK
With locking disabled (if @code{gdbm_open} was called with @samp{GDBM_NOLOCK}),
the user may want to perform their own file locking on the database file
in order to prevent multiple writers operating on the same file
simultaneously.
In order to support this, the @code{gdbm_fdesc} routine is provided.
@deftypefn {gdbm interface} int gdbm_fdesc (GDBM_FILE @var{dbf})
Returns the file descriptor of the database @var{dbf}. This value
can be used as an argument to @code{flock}, @code{lockf} or similar
calls.
@end deftypefn
@node Variables
@chapter Useful global variables.
The following global variables and constants are available:
@deftypevar gdbm_error gdbm_errno
This variable contains error code from the last failed @code{gdbm}
call. @xref{Error codes}, for a list of available error codes and
their descriptions.
Use @code{gdbm_strerror} (@pxref{Errors}) to convert it to a
descriptive text.
@end deftypevar
@deftypevar {const char *} gdbm_errlist[]
This variable is an array of error descriptions, which is used by
@code{gdbm_strerror} to convert error codes to human-readable text
(@pxref{Errors}). You can access it directly, if you wish so. It
contains @code{_GDBM_MAX_ERRNO + 1} elements and can be directly
indexed by the error code to obtain a corresponding descriptive
text.
@end deftypevar
@deftypevar {int const} gdbm_syserr[]
Array of boolean values indicating, for each GDBM error code, whether
the value of @code{errno}(3) variable is meaningful for this error
code. @xref{gdbm_check_syserr}.
@end deftypevar
@defvr {Constant} _GDBM_MIN_ERRNO
The minimum error code used by @code{gdbm}.
@end defvr
@defvr {Constant} _GDBM_MAX_ERRNO
The maximum error code used by @code{gdbm}.
@end defvr
@cindex version number
@deftypevar {const char *} gdbm_version
A string containing the version information.
@end deftypevar
@deftypevar {int const} gdbm_version_number[3]
This variable contains the @code{gdbm} version numbers:
@multitable @columnfractions 0.4 0.5
@headitem Index @tab Meaning
@item 0 @tab Major number
@item 1 @tab Minor number
@item 2 @tab Patchlevel number
@end multitable
Additionally, the following constants are defined in the @file{gdbm.h}
file:
@table @asis
@kwindex GDBM_VERSION_MAJOR
@item GDBM_VERSION_MAJOR
Major number.
@kwindex GDBM_VERSION_MINOR
@item GDBM_VERSION_MINOR
Minor number.
@kwindex GDBM_VERSION_PATCH
@item GDBM_VERSION_PATCH
Patchlevel number.
@end table
These can be used to verify whether the header file matches the library.
@end deftypevar
To compare two split-out version numbers, use the following function:
@deftypefn {gdbm interface} int gdbm_version_cmp (int const @var{a}[3], @
int const @var{b}[3])
Compare two version numbers. Return @samp{-1} if @var{a} is less than
@var{b}, @samp{1} if @var{a} is greater than @var{b} and @samp{0} if
they are equal.
Comparison is done from left to right, so that:
@example
a = @{ 1, 8, 3 @};
b = @{ 1, 8, 3 @};
gdbm_version_cmp (a, b) @result{} 0
a = @{ 1, 8, 3 @};
b = @{ 1, 8, 2 @};
gdbm_version_cmp (a, b) @result{} 1
a = @{ 1, 8, 3 @};
b = @{ 1, 9. 0 @};
gdbm_version_cmp (a, b) @result{} -1
@end example
@end deftypefn
@node Error codes
@chapter Error codes
@cindex error codes
This chapter summarizes error codes which can be set by the
functions in @code{gdbm} library.
@table @asis
@kwindex GDBM_NO_ERROR
@item GDBM_NO_ERROR
No error occurred.
@kwindex GDBM_MALLOC_ERROR
@item GDBM_MALLOC_ERROR
Memory allocation failed. Not enough memory.
@kwindex GDBM_BLOCK_SIZE_ERROR
@kwindex GDBM_BSEXACT
@item GDBM_BLOCK_SIZE_ERROR
This error is set by the @code{gdbm_open} function (@pxref{Open}), if
the value of its @var{block_size} argument is incorrect and the
@samp{GDBM_BSEXACT} flag is set.
@kwindex GDBM_FILE_OPEN_ERROR
@item GDBM_FILE_OPEN_ERROR
The library was not able to open a disk file. This can be set by
@code{gdbm_open} (@pxref{Open}), @code{gdbm_export} and
@code{gdbm_import} functions (@pxref{Flat files}).
Inspect the value of the system @code{errno} variable to get more
detailed diagnostics.
@kwindex GDBM_FILE_WRITE_ERROR
@item GDBM_FILE_WRITE_ERROR
Writing to a disk file failed. This can be set by
@code{gdbm_open} (@pxref{Open}), @code{gdbm_export} and
@code{gdbm_import} functions.
Inspect the value of the system @code{errno} variable to get more
detailed diagnostics.
@kwindex GDBM_FILE_SEEK_ERROR
@item GDBM_FILE_SEEK_ERROR
Positioning in a disk file failed. This can be set by
@code{gdbm_open} (@pxref{Open}) function.
Inspect the value of the system @code{errno} variable to get a more
detailed diagnostics.
@kwindex GDBM_FILE_READ_ERROR
@item GDBM_FILE_READ_ERROR
Reading from a disk file failed. This can be set by
@code{gdbm_open} (@pxref{Open}), @code{gdbm_export} and
@code{gdbm_import} functions.
Inspect the value of the system @code{errno} variable to get a more
detailed diagnostics.
@kwindex GDBM_BAD_MAGIC_NUMBER
@item GDBM_BAD_MAGIC_NUMBER
The file given as argument to @code{gdbm_open} function is not a valid
@code{gdbm} file: it has a wrong magic number.
@kwindex GDBM_EMPTY_DATABASE
@item GDBM_EMPTY_DATABASE
The file given as argument to @code{gdbm_open} function is not a valid
@code{gdbm} file: it has zero length.
@kwindex GDBM_CANT_BE_READER
@item GDBM_CANT_BE_READER
This error code is set by the @code{gdbm_open} function if it is not
able to lock file when called in @samp{GDBM_READER} mode (@pxref{Open,
GDBM_READER}).
@kwindex GDBM_CANT_BE_WRITER
@item GDBM_CANT_BE_WRITER
This error code is set by the @code{gdbm_open} function if it is not
able to lock file when called in writer mode (@pxref{Open}).
@kwindex GDBM_READER_CANT_DELETE
@item GDBM_READER_CANT_DELETE
Set by the @code{gdbm_delete} (@pxref{Delete}) if it attempted to
operate on a database that is open in read-only mode (@pxref{Open,
GDBM_READER}).
@kwindex GDBM_READER_CANT_STORE
@item GDBM_READER_CANT_STORE
Set by the @code{gdbm_store} (@pxref{Store}) if it attempted to
operate on a database that is open in read-only mode (@pxref{Open,
GDBM_READER}).
@kwindex GDBM_READER_CANT_REORGANIZE
@item GDBM_READER_CANT_REORGANIZE
Set by the @code{gdbm_reorganize} (@pxref{Reorganization}) if it attempted to
operate on a database that is open in read-only mode (@pxref{Open,
GDBM_READER}).
@kwindex GDBM_ITEM_NOT_FOUND
@item GDBM_ITEM_NOT_FOUND
Requested item was not found. This error is set by @code{gdbm_delete}
(@pxref{Delete}) and @code{gdbm_fetch} (@pxref{Fetch}) when the requested
@var{key} value is not found in the database.
@kwindex GDBM_REORGANIZE_FAILED
@item GDBM_REORGANIZE_FAILED
The @code{gdbm_reorganize} function is not
able to create a temporary database. @xref{Reorganization}.
@kwindex GDBM_CANNOT_REPLACE
@item GDBM_CANNOT_REPLACE
Cannot replace existing item. This error is set by the
@code{gdbm_store} if the requested @var{key} value is found in the
database and the @var{flag} parameter is not @samp{GDBM_REPLACE}.
@xref{Store}, for a detailed discussion.
@kwindex GDBM_ILLEGAL_DATA
@item GDBM_ILLEGAL_DATA
Either @var{key} or @var{content} parameter was wrong in a call to
to @code{gdbm_store} (@pxref{Store}).
@kwindex GDBM_OPT_ALREADY_SET
@item GDBM_OPT_ALREADY_SET
Requested option can be set only once and was already set. This error
is returned by the @code{gdbm_setopt} function. @xref{Options,
GDBM_CACHESIZE}.
@kwindex GDBM_OPT_ILLEGAL
@item GDBM_OPT_ILLEGAL
The @var{option} argument is not valid or the @var{value} argument
points to an invalid value in a call to @code{gdbm_setopt} function.
@xref{Options}.
@kwindex GDBM_BYTE_SWAPPED
@item GDBM_BYTE_SWAPPED
The @code{gdbm_open} function (@pxref{Open}) attempts to open a
database which is created on a machine with different byte ordering.
@kwindex GDBM_BAD_FILE_OFFSET
@item GDBM_BAD_FILE_OFFSET
The @code{gdbm_open} function (@pxref{Open}) sets this error code if
the file it tries to open has a wrong magic number.
@kwindex GDBM_BAD_OPEN_FLAGS
@item GDBM_BAD_OPEN_FLAGS
Set by the @code{gdbm_export} function if supplied an invalid
@var{flags} argument. @xref{Flat files}.
@kwindex GDBM_FILE_STAT_ERROR
@item GDBM_FILE_STAT_ERROR
Getting information about a disk file failed. The system @code{errno}
will give more details about the error.
This error can be set by the following functions: @code{gdbm_open},
@code{gdbm_reorganize}.
@kwindex GDBM_FILE_EOF
@item GDBM_FILE_EOF
End of file was encountered where more data was expected to be
present. This error can occur when fetching data from the database
and usually means that the database is truncated or otherwise corrupted.
This error can be set by any GDBM function that does I/O. Some of
these functions are: @code{gdbm_delete}, @code{gdbm_exists},
@code{gdbm_fetch}, @code{gdbm_export}, @code{gdbm_import},
@code{gdbm_reorganize}, @code{gdbm_firstkey}, @code{gdbm_nextkey},
@code{gdbm_store}.
@kwindex GDBM_NO_DBNAME
@item GDBM_NO_DBNAME
Output database name is not specified. This error code is set by
@code{gdbm_load} (@pxref{gdbm_load function,,gdbm_load}) if the first
argument points to @samp{NULL} and the input file does not specify the
database name.
@kwindex GDBM_ERR_FILE_OWNER
@item GDBM_ERR_FILE_OWNER
This error code is set by @code{gdbm_load} if it is unable to restore
database file owner. It is a mild error condition, meaning that the
data have been restored successfully, only changing the target file
owner failed. Inspect the system @code{errno} variable to get a more
detailed diagnostics.
@kwindex GDBM_ERR_FILE_MODE
@item GDBM_ERR_FILE_MODE
This error code is set by @code{gdbm_load} if it is unable to restore
database file mode. It is a mild error condition, meaning that the data
have been restored successfully, only changing the target file owner
failed. Inspect the system @code{errno} variable to get a more
detailed diagnostics.
@kwindex GDBM_NEED_RECOVERY
@item GDBM_NEED_RECOVERY
Database is in inconsistent state and needs recovery. Call
@code{gdbm_recover} if you get this error. @xref{Recovery}, for a
detailed description of recovery functions.
@kwindex GDBM_BACKUP_FAILED
@item GDBM_BACKUP_FAILED
The GDBM engine is unable to create backup copy of the file.
@kwindex GDBM_DIR_OVERFLOW
@item GDBM_DIR_OVERFLOW
Bucket directory would overflow the size limit during an attempt to split
hash bucket. This error can occur while storing a new key.
@end table
@node Compatibility
@chapter Compatibility with standard @code{dbm} and @code{ndbm}.
@cindex compatibility layer
@code{Gdbm} includes a compatibility layer, which provides traditional
@samp{ndbm} and older @samp{dbm} functions. The layer is compiled and
installed if the @option{--enable-libgdbm-compat} option is used when
configuring the package.
@findex ndbm.h
@findex dbm.h
@findex libgdbm_compat
The compatibility layer consists of two header files: @file{ndbm.h}
and @file{dbm.h} and the @file{libgdbm_compat} library.
Older programs using @code{ndbm} or @code{dbm} interfaces can
use @file{libgdbm_compat} without any changes. To link a program with
the compatibility library, add the following two options to the
@command{cc} invocation: @option{-lgdbm -lgdbm_compat}. The @option{-L}
option may also be required, depending on where @code{gdbm} is
installed, e.g.:
@example
cc ... -lgdbm -lgdbm_compat
@end example
@cindex @samp{dir} file
@cindex @samp{pag} file
Databases created and manipulated by the compatibility interfaces
consist of two different files: @file{@var{file}.dir} and
@file{@var{file}.pag}. This is required by the @acronym{POSIX}
specification and corresponds to the traditional usage. Note,
however, that despite the similarity of the naming convention,
actual data stored in these files has not the same format as
in the databases created by other @code{dbm} or @code{ndbm}
libraries. In other words, you cannot access a standard UNIX
@code{dbm} file with GNU @code{dbm}!
GNU @code{dbm} files are not @code{sparse}. You can copy them with
the usual @code{cp} command and they will not expand in the copying
process.
@menu
* ndbm:: NDBM interface functions.
* dbm:: DBM interface functions.
@end menu
@node ndbm
@section NDBM interface functions.
@cindex NDBM functions
The functions below implement the @acronym{POSIX} @samp{ndbm} interface:
@deftypefn {ndbm} {DBM *} dbm_open (char *@var{file}, int @var{flags}, int @var{mode})
Opens a database. The @var{file} argument is the full name of the
database file to be opened. The function opens two files:
@file{@var{file}.pag} and @file{@var{file}.dir}. The @var{flags} and
@var{mode} arguments have the same meaning as the second and third
arguments of
@ifhtml
@uref{http://www.manpagez.com/man/2/open,,open(2)},
@end ifhtml
@ifnothtml
@code{open} (@pxref{open,,open a file,open(2), open(2) man page}),
@end ifnothtml
except that a database opened for write-only access opens the files
for read and write access and the behavior of the @code{O_APPEND} flag is
unspecified.
The function returns a pointer to the @code{DBM} structure describing
the database. This pointer is used to refer to this database in all
operations described below.
Any error detected will cause a return value of @samp{NULL} and an
appropriate value will be stored in @code{gdbm_errno}
(@pxref{Variables}).
@end deftypefn
@deftypefn {ndbm} void dbm_close (DBM *@var{dbf})
Closes the database. The @var{dbf} argument must be a pointer
returned by an earlier call to @code{dbm_open}.
@end deftypefn
@deftypefn {ndbm} datum dbm_fetch (DBM *@var{dbf}, datum @var{key})
Reads a record from the database with the matching key. The @var{key}
argument supplies the key that is being looked for.
If no matching record is found, the @code{dptr} member of the returned
datum is @samp{NULL}. Otherwise, the @code{dptr} member of the
returned datum points to the memory managed by the compatibility
library. The application should never free it.
@end deftypefn
@deftypefn {ndbm} int dbm_store (DBM *@var{dbf}, datum @var{key}, @
datum @var{content}, int @var{mode})
Writes a key/value pair to the database. The argument @var{dbf} is a
pointer to the @code{DBM} structure returned from a call to
@code{dbm_open}. The @var{key} and @var{content} provide the values
for the record key and content. The @var{mode} argument controls
the behavior of @code{dbm_store} in case a matching record already
exists in the database. It can have one of the following two values:
@table @code
@kwindex DBM_REPLACE
@item DBM_REPLACE
Replace existing record with the new one.
@kwindex DBM_INSERT
@item DBM_INSERT
The existing record is left unchanged, and the function returns
@samp{1}.
@end table
If no matching record exists in the database, new record will be
inserted no matter what the value of the @var{mode} is.
@end deftypefn
@deftypefn {ndbm} int dbm_delete (DBM *@var{dbf}, datum @var{key})
Deletes the record with the matching key from the database. If the
function succeeds, @samp{0} is returned. Otherwise, if no matching
record is found or if an error occurs, @samp{-1} is returned.
@end deftypefn
@deftypefn {ndbm} datum dbm_firstkey (DBM *@var{dbf})
Initializes iteration over the keys from the database and returns
the first key. Note, that the word @samp{first} does not imply any
specific ordering of the keys.
If there are no records in the database, the @code{dptr} member of the
returned datum is @samp{NULL}. Otherwise, the @code{dptr} member of
the returned datum points to the memory managed by the compatibility
library. The application should never free it.
@end deftypefn
@deftypefn {ndbm} datum dbm_nextkey (DBM *@var{dbf})
Continues the iteration started by @code{dbm_firstkey}. Returns the
next key in the database. If the iteration covered all keys in the
database, the @code{dptr} member of the returned datum is @samp{NULL}.
Otherwise, the @code{dptr} member of the returned datum points to the
memory managed by the compatibility library. The application should
never free it.
@cindex sequential access, using @samp{NDBM}
@cindex iteration loop, using @samp{NDBM}
The usual way of iterating over all the records in the database is:
@example
for (key = dbm_firstkey (dbf);
key.ptr;
key = dbm_nextkey (dbf))
@{
/* do something with the key */
@}
@end example
The loop above should not try to delete any records from the database,
otherwise the iteration is not guaranteed to cover all the keys.
@xref{Sequential}, for a detailed discussion of this.
@end deftypefn
@deftypefn {ndbm} int dbm_error (DBM *@var{dbf})
Returns the error condition of the database: @samp{0} if no errors
occurred so far while manipulating the database, and a non-zero value
otherwise.
@end deftypefn
@deftypefn {ndbm} void dbm_clearerr (DBM *@var{dbf})
Clears the error condition of the database.
@end deftypefn
@deftypefn {ndbm} int dbm_dirfno (DBM *@var{dbf})
Returns the file descriptor of the @samp{dir} file of the database.
It is guaranteed to be different from the descriptor returned by
the @code{dbm_pagfno} function (see below).
The application can lock this descriptor to serialize accesses to the
database.
@end deftypefn
@deftypefn {ndbm} int dbm_pagfno (DBM *@var{dbf})
Returns the file descriptor of the @samp{pag} file of the database.
See also @code{dbm_dirfno}.
@end deftypefn
@deftypefn {ndbm} int dbm_rdonly (DBM *@var{dbf})
Returns @samp{1} if the database @var{dbf} is open in a read-only mode
and @samp{0} otherwise.
@end deftypefn
@node dbm
@section DBM interface functions.
@cindex DBM functions
The functions below are provided for compatibility with the old
UNIX @samp{DBM} interface. Only one database at a time can be
manipulated using them.
@deftypefn {dbm} int dbminit (char *@var{file})
Opens a database. The @var{file} argument is the full name of the
database file to be opened. The function opens two files:
@file{@var{file}.pag} and @file{@var{file}.dir}. If any of
them does not exist, the function fails. It never attempts to create
the files.
The database is opened in the read-write mode, if its disk permissions
permit.
The application must ensure that the functions described below in
this section are called only after a successful call to @code{dbminit}.
@end deftypefn
@deftypefn {dbm} int dbmclose (void)
Closes the database opened by an earlier call to @code{dbminit}.
@end deftypefn
@deftypefn {dbm} datum fetch (datum @var{key})
Reads a record from the database with the matching key. The @var{key}
argument supplies the key that is being looked for.
If no matching record is found, the @code{dptr} member of the returned
datum is @samp{NULL}. Otherwise, the @code{dptr} member of the
returned datum points to the memory managed by the compatibility
library. The application should never free it.
@end deftypefn
@deftypefn {dbm} int store (datum @var{key}, datum @var{content})
Stores the key/value pair in the database. If a record with the
matching key already exists, its content will be replaced with the new
one.
Returns @samp{0} on success and @samp{-1} on error.
@end deftypefn
@deftypefn {dbm} int delete (datum @var{key})
Deletes a record with the matching key.
If the function succeeds, @samp{0} is returned. Otherwise, if no
matching record is found or if an error occurs, @samp{-1} is
returned.
@end deftypefn
@deftypefn {dbm} datum firstkey (void)
Initializes iteration over the keys from the database and returns
the first key. Note, that the word @samp{first} does not imply any
specific ordering of the keys.
If there are no records in the database, the @code{dptr} member of the
returned datum is @samp{NULL}. Otherwise, the @code{dptr} member of
the returned datum points to the memory managed by the compatibility
library. The application should never free it.
@end deftypefn
@deftypefn {dbm} datum nextkey (datum @var{key})
Continues the iteration started by a call to @code{firstkey}. Returns
the next key in the database. If the iteration covered all keys in the
database, the @code{dptr} member of the returned datum is @samp{NULL}.
Otherwise, the @code{dptr} member of the returned datum points to the
memory managed by the compatibility library. The application should
never free it.
@end deftypefn
@node gdbmtool
@chapter Examine and modify a GDBM database.
@prindex gdbmtool
The @command{gdbmtool} utility allows you to view and modify an
existing @acronym{GDBM} database or to create a new one.
@cindex default database, @command{gdbmtool}
@flindex junk.gdbm
When invoked without arguments, it tries to open a database file called
@file{junk.gdbm}, located in the current working directory. You can
change this default by supplying the name of the database as
argument to the program, e.g.:
@example
$ gdbmtool file.db
@end example
@cindex read-only mode, @command{gdbmtool}
@cindex @option{-r}, @command{gdbmtool} option
@cindex @option{--read-only}, @command{gdbmtool} option
The database will be opened in read-write mode, unless the
@option{-r} (@option{--read-only}) option is specified, in which case
it will be opened only for reading.
@cindex creating a database, @command{gdbmtool}
@cindex @option{-n}, @command{gdbmtool} option
@cindex @option{--newdb}, @command{gdbmtool} option
If the database does not exist, @command{gdbmtool} will create it.
There is a special option @option{-n} (@option{--newdb}, which
instructs the utility to create a new database. If it is used and if
the database already exists, it will be deleted, so use it sparingly.
@menu
* invocation::
* shell::
@end menu
@node invocation
@section gdbmtool invocation
@cindex command line options, @command{gdbmtool}
When started without additional arguments, @command{gdbmtool} operates
on the default database @file{junk.gdbm}. Otherwise, the first
argument supplies the name of the database to operate upon. If neither
any additional arguments nor the @option{-f} (@option{--file}) option
are given, @command{gdbmtool} opens starts interactive shell and
receives commands directly from the human operator.
If more than one arguments are given, all arguments past the database
name are parsed as @command{gdbmtool} commands (@pxref{shell}, for a
description of available commands) and executed in turn. All commands,
except the last one, should be terminated with semicolons. Semicolon
after the last command is optional. Note, that semicolons should be
escaped in order to prevent them from being interpreted by the shell.
Finally, if the @option{-f} (@option{--file}) option is supplied, its
argument specifies the name of the disk file with @command{gdbmtool}
script. The program will open that file and read commands from it.
The following table summarizes all @command{gdbmtool} command line
options:
@table @option
@item -b @var{size}
@itemx --block-size=@var{size}
Set block size.
@item -c @var{size}
@itemx --cache-size=@var{size}
Set cache size.
@item -f @var{file}
@item --file @var{file}
Read commands from @var{file}, instead of the standard input.
@item -h
@itemx --help
Print a concise help summary.
@item -N
@itemx --norc
Don't read startup files (@pxref{startup files}).
@item -n
@itemx --newdb
Create the database.
@item -l
@itemx --no-lock
Disable file locking.
@item -m
@itemx --no-mmap
Disable mmap.
@anchor{-q option}
@item -q
@itemx --quiet
Don't print the usual welcome banner at startup. This is the same as
setting the variable @samp{quiet} in the startup file. @xref{quiet}.
@item -r
@itemx --read-only
Open the database in read-only mode.
@item -s
@itemx --synchronize
Synchronize to the disk after each write.
@item -V
@itemx --version
Print program version and licensing information and exit.
@item --usage
Print a terse invocation syntax summary along with a list of available
command line options.
@end table
@node shell
@section gdbmtool interactive mode
@cindex interactive mode, @command{gdbmtool}
After successful startup, @command{gdbmtool} starts a loop, in which
it reads commands from the standard input, executes them and prints
results on the standard output. If the standard input is attached
to a console, @command{gdbmtool} runs in interactive mode, which is
indicated by its @dfn{prompt}:
@example
gdbmtool> _
@end example
The utility finishes when it reads the @samp{quit} command (see below) or
detects end-of-file on its standard input, whichever occurs first.
A @command{gdbmtool} command consists of a @dfn{command verb},
optionally followed by @dfn{arguments}, separated by any
amount of white space and terminated with a newline or semicolon.
A command verb can be entered either in full or in an abbreviated
form, as long as that abbreviation does not match any other verb. For
example, @samp{co} can be used instead of @samp{count} and @samp{ca}
instead of @samp{cache}.
Any sequence of non-whitespace characters appearing after the command
verb forms an argument. If the argument contains whitespace or
unprintable characters it must be enclosed in double quotes. Within
double quotes the usual @dfn{escape sequences} are understood, as
shown in the table below:
@float Table, backslash-interpretation
@caption{Backslash escapes}
@multitable @columnfractions 0.30 .5
@item Sequence @tab Replaced with
@item \a @tab Audible bell character (@acronym{ASCII} 7)
@item \b @tab Backspace character (@acronym{ASCII} 8)
@item \f @tab Form-feed character (@acronym{ASCII} 12)
@item \n @tab Newline character (@acronym{ASCII} 10)
@item \r @tab Carriage return character (@acronym{ASCII} 13)
@item \t @tab Horizontal tabulation character (@acronym{ASCII} 9)
@item \v @tab Vertical tabulation character (@acronym{ASCII} 11)
@item \\ @tab Single slash
@item \" @tab Double quote
@end multitable
@end float
In addition, a backslash immediately followed by the end-of-line
character effectively removes that character, allowing to split long
arguments over several input lines.
Command parameters may be optional or mandatory. If the number of
actual arguments is less than the number of mandatory parameters,
@command{gdbmtool} will prompt you to supply missing arguments. For
example, the @samp{store} command takes two mandatory parameters, so
if you invoked it with no arguments, you would be prompted twice to
supply the necessary data, as shown in example below:
@example
gdbmtool> @kbd{store}
key? @kbd{three}
data? @kbd{3}
@end example
However, such prompting is possible only in interactive mode. In
non-interactive mode (e.g.@: when running a script), all arguments must
be supplied with each command, otherwise @command{gdbmtool} will report an
error and exit immediately.
@cindex readline
@cindex GNU Readline
If the package is compiled with GNU Readline, the input line can be
edited (@pxref{Command Line Editing, ,
Command Line Editing, readline, GNU Readline Library}).
@menu
* variables:: shell variables.
* commands:: shell commands.
* definitions:: how to define structured data.
* startup files::
@end menu
@node variables
@subsection Shell Variables
@cindex variables, gdbmtool
A number of @command{gdbmtool} parameters is kept in its internal
variables.
@deftypevr {gdbmtool variable} bool confirm
Whether to ask for confirmation before certain destructive operations,
such as truncating the existing database.
Default is @samp{true}.
@end deftypevr
@deftypevr {gdbmtool variable} string ps1
Primary prompt string. Its value can contain @dfn{conversion
specifiers}, consisting of the @samp{%} character followed by another
character. These specifiers are expanded in the resulting prompt as
follows:
@multitable @columnfractions 0.4 0.5
@headitem Sequence @tab Expansion
@item %f @tab name of the current database file
@item %p @tab program invocation name
@item %P @tab package name (@samp{GDBM})
@item %v @tab program version
@item %_ @tab single space character
@item %% @tab %
@end multitable
The default value is @samp{%p>%_}, i.e. the program name, followed by
a ``greater than'' sign, followed by a single space.
@end deftypevr
@deftypevr {gdbmtool variable} string ps2
Secondary prompt. See @samp{ps1} for a description of its value.
This prompt is displayed before reading the second and subsequent
lines of a multi-line command.
The default value is @samp{%_>%_}.
@end deftypevr
@deftypevr {gdbmtool variable} string delim1
A string used to delimit fields of a structured datum on output
(@pxref{definitions}).
Default is @samp{,} (a comma). This variable cannot be unset.
@end deftypevr
@deftypevr {gdbmtool variable} string delim2
A string used to delimit array items when printing a structured datum
(@pxref{definitions}).
Default is @samp{,} (a comma). This variable cannot be unset.
@end deftypevr
@deftypevr {gdbmtool variable} string pager
The name and command line of the pager program to pipe output to.
This program is used in interactive mode when the estimated number of
output lines is greater then the number of lines on your screen.
The default value is inherited from the environment variable
@env{PAGER}. Unsetting this variable disables paging.
@end deftypevr
@anchor{quiet}
@deftypevr {gdbmtool variable} bool quiet
Whether to display a welcome banner at startup. This variable should
be set in a startup script file (@pxref{startup files}).
@xref{-q option}.
@end deftypevr
@anchor{open parameters}
The following variables control how the database is opened:
@deftypevr {gdbmtool variable} numeric blocksize
Sets the block size. @xref{Open, block_size}. Unset by default.
@end deftypevr
@deftypevr {gdbmtool variable} numeric cachesize
Sets the cache size. @xref{Options, GDBM_SETCACHESIZE}.
By default this variable is not set.
@end deftypevr
@anchor{openvar}
@deftypevr {gdbmtool variable} string open
Open mode. The following values are allowed:
@table @asis
@item newdb
Truncate the database if it exists or create a new one. Open it in
read-write mode.
Technically, this sets the @samp{GDBM_NEWDB} flag in call to @samp{gdbm_open}.
@xref{Open, GDBM_NEWDB}.
@item wrcreat
@itemx rw
Open the database in read-write mode. Create it if it does not
exist. This is the default.
Technically speaking, it sets the @samp{GDBM_WRCREAT} flag in call to
@code{gdbm_open}. @xref{Open, GDBM_WRCREAT}.
@item reader
@itemx readonly
Open the database in read-only mode. Signal an error if it does not
exist.
This sets the @samp{GDBM_READER} flag (@pxref{Open, GDBM_READER}).
@end table
Attempting to set any other value or to unset this variable produces
an error.
@end deftypevr
@anchor{filemode}
@deftypevr {gdbmtool variable} number filemode
File mode (in octal) for creating new database files and database
dumps.
@end deftypevr
@deftypevr {gdbmtool variable} bool lock
Lock the database. This is the default.
Setting this variable to false or unsetting it results in passing
@samp{GDBM_NOLOCK} flag to @code{gdbm_open} (@pxref{Open, GDBM_NOLOCK}).
@end deftypevr
@deftypevr {gdbmtool variable} bool mmap
Use memory mapping. This is the default.
Setting this variable to false or unsetting it results in passing
@samp{GDBM_NOMMAP} flag to @code{gdbm_open} (@pxref{Open, GDBM_NOMMAP}).
@end deftypevr
@deftypevr {gdbmtool variable} bool sync
Flush all database writes on disk immediately. Default is false.
@xref{Open, GDBM_SYNC}.
@end deftypevr
@deftypevr {gdbmtool variable} bool coalesce
Enables the @emph{coalesce} mode, i.e. merging of the freed blocks of
GDBM files with entries in available block lists. This provides for
effective memory management at the cost of slight increase in
execution time when calling @code{gdbm_delete}. @xref{Options,
GDBM_SETCOALESCEBLKS}.
This variable affects the @command{open} command and should be set
before invoking it.
@end deftypevr
@deftypevr {gdbmtool variable} bool centfree
Set to @samp{true}, enables the use of central free block pool in
newly opened databases. @xref{Options, GDBM_SETCENTFREE}.
This variable affects the @command{open} command and should be set
before invoking it.
@end deftypevr
The following commands are used to list or modify the variables:
@deffn {command verb} set [@var{assignments}]
When used without arguments, lists all variables and their values.
Unset variables are shown after a comment sign (@samp{#}). For string
and numeric variables, values are shown after an equals sign. For
boolean variables, only the variable name is displayed if the variable
is @samp{true}. If it is @samp{false}, its name is prefixed with
@samp{no}.
For example:
@example
@group
ps1="%p>%_"
ps2="%_>%_"
delim1=","
delim2=","
confirm
# cachesize is unset
# blocksize is unset
open="wrcreat"
lock
mmap
nosync
pager="less"
# quiet is unset
@end group
@end example
If used with arguments, the @code{set} command alters the specified
variables. In this case, arguments are variable assignments in the
form @samp{@var{name}=@var{value}}. For boolean variables, the
@var{value} is interpreted as follows: if it is numeric, @samp{0}
stands for @samp{false}, any non-zero value stands for @samp{true}.
Otherwise, the values @samp{on}, @samp{true}, and @samp{yes} denote
@samp{true}, and @samp{off}, @samp{false}, @samp{no} stand for
@samp{false}. Alternatively, only the name of a boolean variable can be
supplied to set it to @samp{true}, and its name prefixed with
@samp{no} can be used to set it to false. For example, the following
command sets the @samp{delim2} variable to @samp{;} and the
@samp{confirm} variable to @samp{false}:
@example
set delim2=";" noconfirm
@end example
@end deffn
@deffn {command verb} unset @var{variables}
Unsets the listed variables. The effect of unsetting depends on the
variable. Unless explicitly described in the discussion of the
variables above, unsetting a boolean variable is equivalent to setting it to
@samp{false}. Unsetting a string variable is equivalent to assigning it
an empty string.
@end deffn
@node commands
@subsection Gdbmtool Commands
@deffn {command verb} avail
Print the @dfn{avail list}.
@end deffn
@deffn {command verb} bucket @var{num}
Print the bucket number @var{num} and set it as the current one.
@end deffn
@deffn {command verb} cache
Print the bucket cache.
@end deffn
@deffn {command verb} close
Close the currently open database.
@end deffn
@deffn {command verb} count
Print the number of entries in the database.
@end deffn
@deffn {command verb} current
Print the current bucket.
@end deffn
@deffn {command verb} debug [[+-]@var{token}...]
If @command{GDBM} is configured with additional debugging, this
statement queries or sets @command{GDBM} internal debugging level.
This is intended for debugging and testing purposes and requires
good knowledge of @command{GDBM} internals. The use of this command is
not recommended.
@end deffn
@deffn {command verb} delete @var{key}
Delete record with the given @var{key}
@end deffn
@deffn {command verb} dir
Print hash directory.
@end deffn
@anchor{gdbmtool export}
@deffn {command verb} export @var{file-name} [truncate] [binary|ascii]
Export the database to the flat file @var{file-name}. @xref{Flat files},
for a description of the flat file format and its purposes. This
command will not overwrite an existing file, unless the
@samp{truncate} parameter is also given. Another optional argument
determines the type of the dump (@pxref{Flat files}). By default, ASCII
dump is created.
The global variable @code{filemode} specifies the permissions to use
for the created output file.
@end deffn
@deffn {command verb} fetch @var{key}
Fetch and display the record with the given @var{key}.
@end deffn
@deffn {command verb} first
Fetch and display the first record in the database. Subsequent
records can be fetched using the @code{next} command (see below).
@xref{Sequential}, for more information on sequential access.
@end deffn
@deffn {command verb} hash @var{key}
Compute and display the hash value for the given @var{key}.
@end deffn
@deffn {command verb} header
Print file header.
@end deffn
@deffn {command verb} help
@deffnx {command verb} ?
Print a concise command summary, showing each command verb
with its parameters and a short description of what it does. Optional
arguments are enclosed in square brackets.
@end deffn
@anchor{gdbmtool import}
@deffn {command verb} import @var{file-name} [replace] [nometa]
Import data from a flat dump file @var{file-name}
(@pxref{Flat files}). If the word @samp{replace} is given
as an argument, any records with the same keys as the already
existing ones will replace them. The word @samp{nometa} turns off
restoring meta-information from the dump file.
@end deffn
@deffn {command verb} history
@deffnx {command verb} history @var{count}
@deffnx {command verb} history @var{n} @var{count}
Shows the command history list with line numbers. When used without
arguments, shows entire history. When used with one argument,
displays @var{count} last commands from the history. With two
arguments, displays @var{count} commands starting from @var{n}th
command. Command numbering starts with 1.
This command is available only if GDBM was compiled with GNU Readline.
The history is saved in file @file{.gdbmtool_history} in the user's
home directory. If this file exists upon startup, it is read to
populate the history. Thus, command history is preserved between
@command{gdbmtool} invocations.
@end deffn
@deffn {command verb} list
List the contents of the database.
@end deffn
@deffn {command verb} next [@var{key}]
Sequential access: fetch and display the next record. If the @var{key} is
given, the record following the one with this key will be fetched.
Issuing several @code{next} commands in row is rather common. A
shortcut is provided to facilitate such use: if the last entered
command was @command{next}, hitting the @kbd{Enter} key repeats it
without arguments.
See also @code{first}, above.
@xref{Sequential}, for more information on sequential access.
@end deffn
@deffn {command verb} open @var{filename}
Open the database file @var{filename}. If successful, any previously
open database is closed. Otherwise, if the operation fails, the
currently opened database remains unchanged.
This command takes additional information from the following
variables:
@table @samp
@item open
The database access mode. @xref{openvar,, The @var{open} variable},
for a list of its values.
@item lock
Whether or not to lock the database. Default is @samp{on}.
@item mmap
Use the memory mapping. Default is @samp{on}.
@item sync
Synchronize after each write. Default is @samp{off}.
@item filemode
Specifies the permissions to use in case a new file is created.
@end table
@xref{open parameters}, for a detailed description of these variables.
@end deffn
@deffn {command verb} quit
Close the database and quit the utility.
@end deffn
@deffn {command verb} recover [@var{options}]
Run database recovery. The following @var{options} are understood:
@table @option
@item backup
Create a backup copy of the original database.
@item max-failed-buckets=@var{n}
Abort recovery process if @var{n} buckets could not be recovered.
@item max-failed-keys=@var{n}
Abort recovery process if @var{n} keys could not be recovered.
@item max-failures=@var{n}
Abort recovery process after @var{n} failures. A @dfn{failure} in this
context is either a key or a bucket that failed to be recovered.
@item summary
Print the recovery statistics at the end of the run. The statistics
includes number of successfully recovered, failed and duplicate keys
and the number of recovered and failed buckets.
@item verbose
Verbosely list each error encountered.
@end table
@end deffn
@deffn {command verb} reorganize
Reorganize the database (@pxref{Reorganization}).
@end deffn
@deffn {command verb} source @var{filename}
Read @command{gdbmtool} commands from the file @var{filename}.
@end deffn
@deffn {command verb} status
Print current program status. The following example shows the
information displayed:
@example
Database file: junk.gdbm
Database is open
define key string
define content string
@end example
The two @samp{define} strings show the defined formats for key and
content data. @xref{definitions}, for a detailed discussion of their
meaning.
@end deffn
@deffn {command verb} store @var{key} @var{data}
Store the @var{data} with @var{key} in the database. If @var{key}
already exists, its data will be replaced.
@end deffn
@deffn {command verb} version
Print the version of @command{gdbm}.
@end deffn
@node definitions
@subsection Data Definitions
GDBM databases are able to keep data of any type, both in the key and
in the content part of a record. Quite often these data are
structured, i.e. they consist of several fields of various types.
@command{Gdbmtool} provides a mechanism for handling such kind of
records.
The @code{define} command defines a record structure. The general
syntax is:
@example
define @var{what} @var{definition}
@end example
@noindent
where @var{what} is @samp{key} to defining the structure of key data and
@samp{content} to define the structure of the content records.
The @var{definition} can be of two distinct formats. In the simplest
case it is a single data type. For example,
@example
define content int
@end example
@noindent
defines content records consisting of a single integer field.
Supported data types are:
@table @asis
@item char
Single byte (signed).
@item short
Signed short integer.
@item ushort
Unsigned short integer.
@item int
Signed integer.
@item unsigned
@itemx uint
Unsigned integer.
@item long
Signed long integer.
@item ulong
Unsigned long integer.
@item llong
Signed long long integer.
@item ullong
Unsigned long long integer.
@item float
A floating point number.
@item double
Double-precision floating point number.
@item string
Array of bytes.
@item stringz
Null-terminated string, trailing null being part of the string.
@end table
All numeric data types (integer as well as floating point) have the
same respective widths as in C language on the host where the database
file resides.
The @samp{string} and @samp{stringz} are special. Both define a
string of bytes, similar to @samp{char x[]} in C. The former
defines an array of bytes, the latter - a null-terminated string.
This makes a difference, in particular, when the string is the only
part of datum. Consider the following two definitions:
@enumerate 1
@item @code{define key string}
@item @code{define key stringz}
@end enumerate
@noindent
Now, suppose we want to store the string "ab" in the key. Using the
definition (1), the @code{dptr} member of GDBM @code{datum} will
contain two bytes: @samp{a}, and @samp{b}. Consequently, the
@code{dsize} member will have the value 2. Using the definition (2),
the @code{dptr} member will contain three bytes: @samp{a}, @samp{b},
and ASCII 0. The @code{dsize} member will have the value 3.
The definition (1) is the default for both key and content.
The second form of the @code{define} statement is similar to the C
@code{struct} statement and allows for defining structural data. In
this form, the @var{definition} part is a comma-separated list of data
types and variables enclosed in curly braces. In contrast to the
rest of @command{gdbm} commands, this command is inherently
multiline and is terminated with the closing curly brace. For
example:
@example
define content @{
int status,
pad 8,
char id[3],
string name
@}
@end example
@noindent
This defines a structure consisting of three members: an integer
@code{status}, an array of 8 bytes @code{id}, and a null-terminated
string @code{name}. Notice the @code{pad} statement: it allows to
introduce padding between structure members. Another useful statement
is @code{offset}: it specifies that the member following it begins at
the given offset in the structure. Assuming the size of @code{int} is
8 bytes, the above definition can also be written as
@example
define content @{
int status,
offset 16,
char id[3],
string name
@}
@end example
@emph{NOTE}: The @samp{string} type can reasonably be used only if it
is the last or the only member of the data structure. That's because it
provides no information about the number of elements in the array, so
it is interpreted to contain all bytes up to the end of the datum.
When displaying the structured data, @command{gdbmtool} precedes each
value with the corresponding field name and delimits parts of the
structure with the string defined in the @samp{delim1} variable
(@pxref{variables}). Array elements are delimited using the string from
@samp{delim2}. For example:
@example
gdbmtool> fetch foo
status=2,id=@{ a, u, x @},name="quux"
@end example
To supply a structured datum as an argument to a @command{gdbmtool}
command, use the same notation, but without field names, e.g.:
@example
gdbmtool> hash @{ 2, @{a,u,x@}, "quux" @}
hash value = 13089969.
@end example
@node startup files
@subsection Startup Files
@cindex startup file, gdbmtool
@cindex init file, gdbmtool
@flindex .gdbmtoolrc
Upon startup @command{gdbmtool} looks for a file named
@samp{.gdbmtoolrc} first in the current working directory and, if not
found, in the home directory of the user who started the command.
If found, this file is read and interpreted as a list of
@command{gdbmtool} commands. This allows you to customize the
program behavior.
Following is an example startup file which disables the welcome
banner, sets command line prompt to contain the name of the database
file in parentheses and defines the structure of the database content
records:
@example
@group
set quiet
set ps1="(%f) "
define key stringz
define content @{
int time,
pad 4,
int status
@}
@end group
@end example
@node gdbm_dump
@chapter The @command{gdbm_dump} utility
@prindex gdbm_dump
The @command{gdbm_dump} utility creates a flat file dump of a GDBM
database (@pxref{Flat files}). It takes one mandatory argument: the
name of the source database file. The second argument, if given,
specifies the name of the output file. If not given,
@command{gdbm_dump} will produce the dump on the standard output.
For example, the following invocation creates a dump of the database
@file{file.db} in the file @file{file.dump}:
@example
$ gdbm_dump file.db file.dump
@end example
By default the utility creates dumps in ASCII format (@pxref{Flat
files,ASCII}). Another format can be requested using the
@option{--format} (@option{-H}) option.
The @command{gdbm_dump} utility understands the following command line
options:
@table @option
@item -H @var{fmt}
@itemx --format=@var{fmt}
Select output format. Valid values for @var{fmt} are: @samp{binary}
or @samp{0} to select binary dump format, and @samp{ascii} or @samp{1}
to select ASCII format.
@item -h
@itemx --help
Print a concise help summary.
@item -V
@itemx --version
Print program version and licensing information and exit.
@item --usage
Print a terse invocation syntax summary along with a list of available
command line options.
@end table
@node gdbm_load
@chapter The @command{gdbm_load} utility
@prindex gdbm_load
The @command{gdbm_load} utility restores a GDBM database from a flat
file. The utility requires at least one argument: the name of the
input flat file. If it is @samp{-}, the standard input will be read.
The format of the input file is detected automatically.
By default the utility attempts to restore the database under its
original name, as stored in the input file. It will fail to do so if
the input is in binary format. In that case, the name of the database
must be given as the second argument.
In general, if two arguments are given the second one is treated as
the name of the database to create, overriding the file name specified
in the flat file.
The utility understands the following command line arguments:
@table @option
@item -b @var{num}
@itemx --block-size=@var{num}
Sets block size. @xref{Open, block_size}.
@item -c @var{num}
@itemx --cache-size=@var{num}
Sets cache size. @xref{Options, GDBM_SETCACHESIZE}.
@item -M
@itemx --mmap
Use memory mapping.
@item -m @var{mode}
@item --mode=@var{mode}
Sets the file mode. The argument is the desired file mode in octal.
@item -n
@itemx --no-meta
Do not restore file meta-data (ownership and mode) from the flat file.
@item -r
@itemx --replace
Replace existing keys.
@item -u @var{user}[:@var{group}]
@itemx --user=@var{user}[:@var{group}]
Set file owner. The @var{user} can be either a valid user name or
UID. Similarly, the @var{group} is either a valid group name or GID.
If @var{group} is not given, the main group of @var{user} is used.
User and group parts can be separated by a dot, instead of the colon.
@item -h
@itemx --help
Print a concise help summary.
@item -V
@itemx --version
Print program version and licensing information and exit.
@item --usage
Print a terse invocation syntax summary along with a list of available
command line options.
@end table
@node Exit codes
@chapter Exit codes
@cindex exit code
All GDBM utilities return uniform exit codes. These are summarized in
the table below:
@multitable @columnfractions 0.3 0.7
@headitem Code @tab Meaning
@item 0 @tab Successful termination.
@item 1 @tab A fatal error occurred.
@item 2 @tab Program was unable to restore file ownership or mode.
@item 3 @tab Command line usage error.
@end multitable
@node Bugs
@chapter Problems and bugs.
If you have problems with GNU @code{dbm} or think you've found a bug,
please report it. Before reporting a bug, make sure you've actually
found a real bug. Carefully reread the documentation and see if it
really says you can do what you're trying to do. If it's not clear
whether you should be able to do something or not, report that too; it's
a bug in the documentation!
Before reporting a bug or trying to fix it yourself, try to isolate it
to the smallest possible input file that reproduces the problem. Then
send us the input file and the exact results @code{gdbm} gave you. Also
say what you expected to occur; this will help us decide whether the
problem was really in the documentation.
Once you've got a precise problem, send e-mail to
@email{bug-gdbm@@gnu.org}.
Please include the version number of GNU @code{dbm} you are using. You can get
this information by printing the variable @code{gdbm_version}
(@pxref{Variables}).
Non-bug suggestions are always welcome as well. If you have questions
about things that are unclear in the documentation or are just obscure
features, please report them too.
You may contact the authors and maintainers by e-mail:
@example
@email{phil@@cs.wwu.edu}, @email{downsj@@downsj.com}, @email{gray@@gnu.org.ua}
@end example
@node Resources
@chapter Additional resources
For the latest updates and pointers to additional resources, visit
@uref{http://www.gnu.org/@/software/@/gdbm}.
In particular, a copy of @code{gdbm} documentation in various formats
is available online at @uref{http://www.gnu.org/@/software/@/gdbm/@/manual.html}.
Latest versions of @code{gdbm} can be downloaded from anonymous FTP:
@uref{ftp://ftp.gnu.org/@/gnu/@/gdbm}, or via HTTP from
@uref{http://ftp.gnu.org/@/gnu/@/gdbm}, or from any
@ifhtml
@uref{http://www.gnu.org/order/ftp.html,,GNU mirror} worldwide.
@end ifhtml
@ifnothtml
GNU mirror worldwide. See @uref{http://www.gnu.org/@/order/@/ftp.html},
for a list of mirrors.
@end ifnothtml
To track @code{gdbm} development, visit
@uref{http://puszcza.gnu.org.ua/@/projects/@/gdbm}.
@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include fdl.texi
@node Index
@unnumbered Index
@printindex cp
@bye
gdbm-1.18.1/doc/gdbm_load.1 0000644 0001750 0001750 00000006406 13237505627 012213 0000000 0000000 .\" This file is part of GDBM. -*- nroff -*-
.\" Copyright (C) 2011, 2013, 2017-2018 Free Software Foundation, Inc.
.\"
.\" GDBM is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 3, or (at your option)
.\" any later version.
.\"
.\" GDBM is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with GDBM. If not, see . */
.TH GDBM_LOAD 1 "December 25, 2013" "GDBM" "GDBM User Reference"
.SH NAME
gdbm_load \- re-create a GDBM database from a dump file.
.SH SYNOPSIS
\fBgdbm_load\fR [\fB\-Mnr\fR] [\fB\-b\fR \fINUM\fR] [\fB\-c\fR \fINUM]\
[\fB\-m\fR \fIMODE\fR]\
[\fB\-u\fR \fINAME\fR|\fIUID\fR[:\fINAME\fR|\fIGID\fR]]
[\fB\-\-block\-size\fR=\fINUM\fR] [\fB\-\-cache\-size\fR=\fINUM\fR]\
[\fB\-\-mmap\fR=\fINUM\fR]
[\fB\-\-mode\fR=\fIMODE\fR]\
[\fB\-\-no\-meta\fR] [\fB\-\-replace\fR]
[\fB\-\-user\fR=\fINAME\fR|\fIUID\fR[:\fINAME\fR|\fIGID\fR]]\
\fIFILE\fR [\fIDB_FILE\fR]
.sp
\fBgdbm_load\fR [\fB\-Vh\fR] [\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-\-version\fR]
.SH DESCRIPTION
Create a
.B gdbm
database file
.I DB_FILE
from the dump file
.IR FILE .
If the
.I FILE
argument is not supplied, output the created database to the standard error.
.PP
If the input file is in ASCII dump format, the mode and ownership of
the created database are restored from the information in the dump.
This can be overridden using the command line options (see below).
.SH OPTIONS
.TP
\fB\-b\fR, \fB\-\-block\-size\fR=\fINUM\fR
Sets block size.
.TP
\fB\-c\fR, \fB\-\-cache\-size\fR=\fINUM\fR
Sets cache size.
.TP
\fB\-M\fR, \fB\-\-mmap\fR
Use memory mapping.
.TP
\fB\-m\fR, \fB\-\-mode\fR=\fIMODE\fR
Set database file mode (octal number).
.TP
\fB\-n\fR, \fB\-\-no\-meta\fR
Do not attempt to restore database meta-data (mode and ownership).
.TP
\fB\-r\fR, \fB\-\-replace\fR
If the database exists, replace records in it.
.TP
\fB\-u\fR, \fB\-\-user\fR=\fINAME\fR|\fIUID\fR[:\fINAME\fR|\fIGID\fR]
Set file ownership.
.TP
\fB\-h\fR, \fB\-\-help\fR
Print a short usage summary.
.TP
\fB\-\-usage\fR
Print a list of available options.
.TP
\fB\-V\fR, \fB\-\-version\fR
Print program version
.SH "SEE ALSO"
.BR gdbm_dump (1),
.BR gdbmtool (1),
.BR gdbm (3).
.PP
For a detailed description of
.B gdbm_load
and other
.B gdbm
utilities, refer to the \fBGDBM Manual\fR available in
Texinfo format. To access it, run:
\fBinfo gdbm\fR
.SH "REPORTING BUGS"
Report bugs to .
.SH COPYRIGHT
Copyright \(co 2013 Free Software Foundation, Inc
.br
.na
License GPLv3+: GNU GPL version 3 or later
.br
.ad
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.\" Local variables:
.\" eval: (add-hook 'write-file-hooks 'time-stamp)
.\" time-stamp-start: ".TH GDBM[A-Z_-]* 1 \""
.\" time-stamp-format: "%:B %:d, %:y"
.\" time-stamp-end: "\""
.\" time-stamp-line-limit: 20
.\" end:
gdbm-1.18.1/ChangeLog 0000644 0001750 0001750 00000273026 13364776737 011247 0000000 0000000 2018-10-27 Sergey Poznyakoff
Version 1.18.1
2018-10-18 Sergey Poznyakoff
Restore backward compatibility with older databases
* src/gdbmopen.c (validate_header): Silently accept databases with next_block
pointing beyond end of file.
Attempt recovery in case of invalid next_block header field
* src/gdbmopen.c (validate_header): Return GDBM_NEED_RECOVERY
if next_block is invalid.
(_gdbm_validate_header): New function.
(gdbm_fd_open): Set need_recovery depending on return from validate_header.
(gdbm_open): Bail out on invalid value of GDBM_OPENMASK bits.
* src/proto.h (_gdbm_validate_header): New proto.
* src/recover.c (check_db): Re-validate the header.
* src/gdbmtool.c (export_handler): Fix option processing.
2018-08-31 Sergey Poznyakoff
Various bugfixes.
* compat/dbmopen.c (ndbm_open_dir_file0): Ignore ENOENT.
* src/falloc.c (push_avail_block): Free temporary storage no matter
what return status.
* src/gdbm.h.in (GDBM_FILE_TRUNCATE_ERROR): New error code.
* src/gdbmdump.c (_gdbm_dump_ascii): Initialize rc.
* src/gdbmerrno.c: Handle new error.code
* src/gdbmload.c (gdbm_load_bdb_dump): Initialize rc
* src/gdbmopen.c (_gdbm_ftruncate): New function.
(gdbm_fd_open): Use _gdbm_ftruncate. Check its return.
* src/gdbmseq.c (gdbm_firstkey): Initialize dsize
* src/gdbmtool.c (command_generator): Check if cmd is NULL.
(shouldn't happen, but anyways).
* src/mmap.c (_gdbm_mapped_lseek): Check for vailidity of the 'whence'
parameter.
* src/systems.h (TRUNCATE): Remove macro.
* src/util.c (vgetyn): Remove unnecessary assignment.
2018-08-21 Sergey Poznyakoff
Version 1.18
2018-08-19 Sergey Poznyakoff
Fix directory entry validation.
Bug reported by Miroslav Lichvar and Marek Skalický
* src/bucket.c (gdbm_dir_entry_valid_p): Fix lower limit for
the allowed bucket address. Initial allocation of second block
for the directory can be eventually returned to the available
list when the directory is expanded during bucket splitting.
2018-08-12 Sergey Poznyakoff
Bugfix
* src/gdbmdump.c (_gdbm_dump_ascii): Clear the GDBM_ITEM_NOT_FOUND error.
* src/gdbmexp.c (gdbm_export_to_file): Likewise.
* NEWS: Update.
2018-08-03 Sergey Poznyakoff
Bugfix
* src/gdbmopen.c (gdbm_avail_table_valid_p): Fix improper use of
the GDBM_DEBUG macro.
2018-07-31 Sergey Poznyakoff
Bugfix
* src/gdbmsync.c (gdbm_sync): Always return a meaningful value
2018-07-30 Sergey Poznyakoff
Version 1.17
2018-07-02 Sergey Poznyakoff
Bugfixes
* src/recover.c (backup_name): Fix memory overwrite.
* src/gdbmtool.c (recover_handler): New option "force".
2018-07-01 Sergey Poznyakoff
Change return value of gdbm_close and gdbm_sync
* src/gdbm.h.in (gdbm_close, gdbm_sync): Return int
(GDBM_FILE_CLOSE_ERROR, GDBM_FILE_SYNC_ERROR): New error codes.
* src/gdbmclose.c (gdbm_close): Return 0 on success, -1 on failure.
Set gdbm_errno and errno.
* src/gdbmsync.c (gdbm_sync): Likewise.
* src/gdbmerrno.c: Handle new error codes.
* src/mmap.c (_gdbm_mapped_sync): Set gdbm_errno.
* src/proto.h (gdbm_file_sync): Set gdbm_errno.
* doc/gdbm.3: Document changes.
* doc/gdbm.texi: Document changes.
* NEWS: Document changes.
* configure.ac: Set patchlevel.
* tests/Makefile.am: Add new test.
* tests/testsuite.at: Add new test.
* tests/closerr.at: New test case.
* tests/closerr.c: New test program.
* tests/gtdel.c: Check gdbm_close return.
* tests/gtdump.c: Likewise.
* tests/gtfetch.c: Likewise.
* tests/gtload.c: Likewise.
* tests/gtopt.c: Likewise.
* tests/gtrecover.c: Likewise.
2018-06-27 Sergey Poznyakoff
Version 1.16
Fix typo
New gdbmtool variables: coalesce and centfree
The two boolean variables control the use of free block coalescing and
central free block modes in newly opened databases.
Coalesce mode: take into account both left- and right-adjacent slots.
* src/falloc.c (avail_lookup): Remove the start parameter.
(avail_move): Take pointer to the count of entries in av_table.
Update the pointed to value after performing the move.
All uses changed.
(_gdbm_put_av_elem): Rewrite the "can_merge" loop.
2018-06-25 Sergey Poznyakoff
Optimize operations on avail lists.
Use binary search for look-ups.
* src/falloc.c (avail_lookup, avail_move): New functions.
(get_elem): Use avail_lookup to search.
(_gdbm_put_av_elem): Use avail_lookup and avail_move to handle the
avail table. In coalesce mode, store the index of the greater than
or equal entry to avoid extra lookup in case no suitable entry is
found.
2018-06-23 Sergey Poznyakoff
Bugfixes. Consistently use the coalesce_blocks flag.
* src/bucket.c (_gdbm_split_bucket): Take into account coalesce_blocks
* src/falloc.c (_gdbm_put_av_elem): Change to void return. All uses changed.
* src/proto.h: Likewise.
Fix the previous patch
Silently restore sorting order of avail array when checking it.
* src/gdbmdefs.h (gdbm_avail_table_valid_p): Remove const qualifier from
the AV parameter.
* src/gdbmopen.c (gdbm_avail_table_valid_p): Don't insist on proper
ordering of the array. Restore it if neccessary.
Maintain correct ordering of the avail table after coalescing.
* src/falloc.c (_gdbm_put_av_elem): Float the merged entry to its
proper position to preserve the sorting order.
* THANKS: Thanks Adam Sampson
Fix typo
2018-06-16 Sergey Poznyakoff
Version 1.5
* configure.ac: Version 1.5
* NEWS: Update.
* src/Makefile.am (VI_CURRENT): Increment to 6
* src/bucket.c (_gdbm_get_bucket): Fix the upper limit for
bucket_bits.
* src/falloc.c (push_avail_block): Fill the allocated block
with 0s.
2018-05-30 Sergey Poznyakoff
More error checking
* src/bucket.c (_gdbm_get_bucket): Check if bucket_bits value is valid.
* src/gdbmtool.c (_gdbm_print_avail_list): Reverse the sense of the
conditional (fix regression).
Avoid unnecessary memory reallocations during caching
* src/findkey.c (_gdbm_read_entry): Reallocate cache_entry->ca_data.dptr only
if necessary.
* src/gdbmdefs.h (data_cache_elem): New member: dsize
* src/gdbmdelete.c: Don't free cache_entry->ca_data.dptr
* src/gdbmopen.c (_gdbm_init_cache): Initialize ca_data.dsize
Rewrite gdbm_file_write etc. as inline functions.
Fix the legacy operation (--disable-mmapped-io)
* src/mmap.c (_gdbm_file_extend): Move to ...
* src/fullio.c: ... here
* src/proto.h (_gdbm_file_extend): New proto.
* src/gdbmopen.c (gdbm_fd_open): Make sure the file size equals
header->next_block.
* src/gdbmsetopt.c [!HAVE_MMAP]: Don't disable GDBM_GETFLAGS.
* src/update.c (_gdbm_end_update): Make sure disk file ends on
header->next_block.
Namespace cleanup
Rename: __read to gdbm_file_read
__write to gdbm_file_write
__lseek to gdbm_file_seek
__fsync to gdbm_file_sync
Drop debugging hooks
The hooks were introduced as a temporary tool in de7834e9. They did
their job and are not necessary any more.
gdbmtool: bugfixes
* src/gdbmtool.c (print_bucket_begin): Check return value from _gdbm_get_bucket.
(source_handler): Don't gtry to push NULL stream.
Fix memory leak in _gdbm_get_bucket
Fix memory leaks in handling history (gdbmtool) and in gdbm_recover
2018-05-29 Sergey Poznyakoff
Minor changes
* src/gdbmtool.c: Reduce memory consuption in -random mode. Some
minor bugfixes as well.
2018-05-28 Sergey Poznyakoff
Improve num2word
* tests/num2word.c: New options: -revert and -random
2018-05-27 Sergey Poznyakoff
Additional validation of avail_table.
Verify that avail_table is sorted by size and that each element's
size falls within allowed range.
* src/bucket.c (gdbm_get_bucket): Fix bucket validation. Validate
bucket_avail.
(_gdbm_split_bucket): Check return from _gdbm_free.
* src/falloc.c (adjust_bucket_avail,_gdbm_free): Return error code.
All uses updated.
(pop_avail_block): Fix eventual memory leak. Use gdbm_avail_block_validate.
* src/gdbmdefs.h (gdbm_avail_table_valid_p): Change signature.
* src/gdbmopen.c (gdbm_avail_table_valid_p): Traverse the array verifying
address and size of each element.
(gdbm_avail_block_validate)
(gdbm_bucket_avail_table_validate): New functions.
(validate_header): Remove call to gdbm_avail_block_valid_p. Avail_block
is validated later, after it's been loaded.
Bail out if header->next_block does not equal the file size.
(gdbm_fd_open): Validate avail_block.
* src/gdbmstore.c (_gdbm_store): Check return from _gdbm_free. Avoid
endless loop in case of inconsistent h_table.
* src/gdbmtool.c (_gdbm_print_avail_list): Use gdbm_avail_block_validate.
* src/proto.h: Update.
* tests/gtload.c: Improve error diagnostics.
2018-05-26 Sergey Poznyakoff
gdbmtool: quote special characters in command line input
2018-05-25 Sergey Poznyakoff
configure: emit a notice if --enable-gdbmtool-debug is used
More database consistency checks
* NEWS: Update.
* THANKS: Update.
* src/bucket.c (_gdbm_get_bucket): Check if directory entry is
valid. Don't cache invalid buckets.
* src/gdbm.h.in (GDBM_BAD_DIR_ENTRY): New error code.
* src/gdbmerrno.c: Likewise.
* src/gdbmopen.c (validate_header): Compute expected
number of bucket elements based on the bucket size, not on
the block size.
(_gdbm_init_cache_entry): New function.
* src/proto.h (_gdbm_init_cache_entry): New proto.
* src/recover.c (gdbm_recover): Clear error state after return
from check_db indicating failure.
2018-05-24 Sergey Poznyakoff
Various fixes
* src/input-std.c: Bugfix
* doc/gdbm.texi: Document changes.
* README: Update.
* configure.ac: New option --enable-gdbmtool-debug.
* src/Makefile.am: Conditionally augment AM_YFLAGS and
AM_LFLAGS with options that enable debugging.
* src/gdbmtool.c: Conditionally enable --lex-trace and
--gram-trace options.
* src/gram.y: Likewise.
* src/lex.l: Likewise.
* tests/Makefile.am: Remove architecure-dependent tests.
* tests/testsuite.at: Likewise.
More input checking fixes
* src/gdbmdefs.h (gdbm_avail_block_valid_p): Minimal capacity
of an avail_block is 1 (one entry is stored in the block itself).
* src/gdbmopen.c (gdbm_avail_table_valid_p): New function.
(validate_header): Fix verification of dir_size and dir_bits.
Verify avail.size.
* src/falloc.c (pop_avail_block): Use gdbm_avail_table_valid_p
* src/gdbmtool.c (_gdbm_print_avail_list): Likewise.
Bugfix
* tests/Makefile.am (EXTRA_DIST): Add missing file.
More error checking; improve gdbm_recover
* Makefile.am (set-dist-date): New rule
(dist-hook): Catch FIXMEs in NEWS.
* NEWS: Updated.
* src/findkey.c (gdbm_bucket_element_valid_p): New function.
(_gdbm_read_entry): Validate the retrieved bucket element.
* src/gdbm.h.in (gdbm_recovery): New member: duplicate_keys.
(GDBM_BAD_HASH_TABLE): New error code.
* src/gdbmdefs.h (TYPE_WIDTH,SIGNED_TYPE_MAXIMUM)
(OFF_T_MAX): New defines.
(off_t_sum_ok): New function.
(gdbm_bucket_element_valid_p): New prototype.
* src/gdbmerrno.c: Support for GDBM_BAD_HASH_TABLE code.
* src/gdbmtool.c (recover_handler): Fix argument counting.
New argument 'summary' prints statistics summary at the end
of the run.
(export_handler,import_handler): Fix argument counting.
* src/mmap.c (SUM_FILE_SIZE): Rewrite as inlined function.
Add error checking.
(_gdbm_mapped_remap): More error checking.
* src/recover.c (run_recovery): Don't bail out on GDBM_CANNOT_REPLACE.
(gdbm_recover): Initialize duplicate_keys
* src/systems.h: Include limits.h
Fix the use of return code from _gdbm_full_(read|write) functions
error checking: check for avail_block consistency before using it
* src/gdbmdefs.h (gdbm_avail_block_valid_p): New function.
* src/gdbm.h.in (GDBM_BAD_AVAIL): New error code.
* src/gdbmerrno.c: Support new error code.
* src/falloc.c (pop_avail_block): Validate the avail_block
* src/gdbmopen.c (validate_header): Validate the avail_block.
* src/gdbmtool.c (_gdbm_avail_list_size)
(_gdbm_print_avail_list): Validate the avail_block.
Add new test
gdbmtool: fix data conversion when storing structured content.
* src/datconv.c (DEFNSCAN): Use proper target type to store in
datum.
(datum_scan_notag): Accept C-like initialization
of array of characters by a quoted string.
2018-05-23 Sergey Poznyakoff
gdbmtool: accept commands from command line as well as from file
Commands can be supplied to gdbmtool in three ways:
1. From a file, using the --file (-f) option:
gdbmtool -f comfile
2. From the command line, if first argument is the database name:
gdbmtool test.db count \; fetch mykey \; avail
Note the use of semicolon to delimit commands.
3. From the interactive shell, if neither of the above is used.
* src/Makefile.am: Add new sources.
* src/gdbmtool.c: Use new stream functions for input.
* src/gdbmtool.h (setsource): Remove proto.
(instream_t): New data type.
(instream_name, instream_read)
(instream_close, instream_interactive)
(instream_eq): New functions.
(instream_stdin_create)
(instream_argv_create)
(instream_file_create)
(interactive, input_context_push): New protos.
* src/gram.y: Accept ; in place of newline.
* src/input-argv.c: New file.
* src/input-file.c: New file.
* src/input-rl.c: Rewrite to provide instream_t API.
* src/input-std.c: Likewise.
* src/lex.l: Rewrite.
* tests/.gitignore: Update.
* tests/Makefile.am: Add new tests. Incorporate
DejaGNU tests.
* tests/config/default.exp: New file.
* tests/gdbmtool/base.exp: New file.
* tests/gdbmtool00.at: New file.
* tests/gdbmtool01.at: New file.
* tests/gdbmtool02.at: New file.
* tests/testsuite.at: Include new tests.
2018-05-19 Sergey Poznyakoff
Remove gdbm-1.8.3 compatibility layer
* configure.ac: Remove gdbm-1.8.3 compatibility layer.
Version 1.14.90
* Makefile.am (ACLOCAL_AMFLAGS): Remove deprecated variable.
(MAYBE_EXPORT): Remove variable and conditional.
* NEWS: Update.
* NOTE-WARNING: Update.
* README: Update.
* doc/gdbm.texi: Update.
* export/.gitignore: Remove.
* export/Makefile.am: Remove.
* export/export.c: Remove.
Catch more errors
* src/gdbmdump.c (_gdbm_dump_ascii): Break on errors
* src/gdbmopen.c (compute_directory_size): Remove unused argument.
(validate_header): Catch dir_size and dir_bits mismatches.
* src/mmap.c (_gdbm_mapped_lseek): Bail out on negative offsets.
* tests/dump03.at: New test.
* tests/dump04.at: New test.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Add new tests.
Add new tests
* src/gdbm_dump.c: Fix exit code.
* configure.ac: Determine presence of gzip and base64
(GZIP_BIN,BASE64_BIN): New variables.
* tests/atlocal.in (GZIP_BIN,BASE64_BIN): New variables.
* tests/dump00.at: New file.
* tests/dump01.at: New file.
* tests/dump02.at: New file.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Add new tests.
Improve error checking
* src/bucket.c (_gdbm_get_bucket): Improve validation.
* src/fullio.c (_gdbm_full_read,_gdbm_full_write): Don't overwrite
an already set error.
* src/gdbm.h.in (GDBM_WRONG_OFF_T): Merge with GDBM_BAD_FILE_OFFSET.
(GDBM_BAD_HEADER): New error code.
* src/gdbmdump.c (_gdbm_dump_ascii): Check for database error code.
* src/gdbmerrno.c (gdbm_errlist): Add GDBM_BAD_HEADER
* src/gdbmopen.c (validate_header: Imporve logic.
(_gdbm_init_cache): Initialize bucket_cache
* src/gdbmseq.c (gdbm_firstkey): Check return value
from _gdbm_get_bucket.
* src/mmap.c (_gdbm_mapped_remap): Bail out if current position is bigger
than file size.
Fix typo
2018-05-16 Sergey Poznyakoff
Improve database file safety checks.
* src/bucket.c (_gdbm_get_bucket): Verify bucket consistency.
* src/gdbm.h.in (GDBM_BAD_BUCKET, GDBM_WRONG_ARCH): New error
codes.
* src/gdbmerrno.c (gdbm_errlist): New error codes.
* src/gdbmopen.c (gdbm_fd_open): Improve header consistency checks.
2018-01-03 Sergey Poznyakoff
Bump library current version number
2018-01-01 Sergey Poznyakoff
Version 1.14
Happy GNU Year
2017-12-23 Sergey Poznyakoff
Fix build with --enable-gdbm-export
* THANKS: Add Jakub Bogusz
* export/export.c: Define GDBM_EXPORT_18 prior to
including gdbmexp.c
* src/gdbmexp.c [GDBM_EXPORT_18]: Define GDBM_SET_ERRNO and
GDBM_ASSERT_CONSISTENCY.
Bugfix
* src/gdbmsetopt.c: Ignore NULL entries
Complement c175231e
* configure.ac: Check whether __thread qualifier is supported
* src/gdbmerrno.c (gdbm_errno_storage): Use GDBM_THREAD_LOCAL instead
of __thread.
2017-12-21 Sergey Poznyakoff
Improve database reproducibility
* src/gdbmopen.c (gdbm_fd_open): Fill allocated memory with 0's
where necessary.
Check return value from fstat.
* src/mmap.c (_gdbm_file_size): Set errno here, instead of delegating
that to the caller.
(_gdbm_file_extend): New function.
(_gdbm_mapped_remap): Call _gdbm_file_extend instead of leaving the
newly allocated space filled with garbage.
* src/gdbmload.c (_set_gdbm_meta_info): Additional error checking.
* NEWS: Update.
2017-12-19 Sergey Poznyakoff
Make gdbm_error thread-safe
* src/gdbm.h.in (gdbm_errno_location): New extern
(gdbm_errno): Change to a define.
* src/gdbmerrno.c (gdbm_errno_location): New function.
(gdbm_errno_storage): Thread-safe storage for the last errno.
2017-10-28 Sergey Poznyakoff
Fix manpage formatting.
2017-07-24 Sergey Poznyakoff
Fix handling of group headers in --help output.
* src/parseopt.c (print_option_descr): Return if descr is NULL
or empty. Translate it using gettext.
All callers changed.
2017-04-14 Sergey Poznyakoff
Fix a typo
2017-03-11 Sergey Poznyakoff
Fix GENDOCS command line
Version 1.13
2017-03-07 Sergey Poznyakoff
Fix parralel builds
* src/Makefile.am: Add dependency for gram.h
Reported by Petr Ovtchenkov
2017-01-02 Sergey Poznyakoff
Happy GNU Year
2016-12-21 Sergey Poznyakoff
Minor fix
* src/mmap.c (_gdbm_internal_remap): Avoid munmapping NULL pointer.
Make sure mapped_region isn't a dangling pointer.
2016-08-06 Sergey Poznyakoff
Fix typos
2016-07-27 Sergey Poznyakoff
Remove obsolete error code.
* doc/gdbm.texi: Remove description of GDBM_UNKNOWN_UPDATE.
Document GDBM_DIR_OVERFLOW.
* src/gdbm.h.in (GDBM_ERR_DIR_OVERFLOW): Rename to GDBM_DIR_OVERFLOW.
(GDBM_UNKNOWN_ERROR): New error code.
(GDBM_UNKNOWN_UPDATE): Define to GDBM_UNKNOWN_ERROR for
backward compatibility.
* src/gdbmerrno.c (gdbm_strerror, gdbm_db_strerror): Simplify a bit
Avoid range error when doubling directory size.
* src/bucket.c (_gdbm_split_bucket): Avoid range error
when doubling directory size.
* src/gdbm.h.in (GDBM_ERR_DIR_OVERFLOW): New error code.
* src/gdbmerrno.c (gdbm_errlist): Describe GDBM_ERR_DIR_OVERFLOW.
2016-07-26 Sergey Poznyakoff
Update gdbm.magic
* src/gdbm.magic: Explicitly handle big- and little-endian databases.
Minor changes
* src/bucket.c (_gdbm_read_bucket_at): Remove unused variable.
* src/debug.c: Include ctype.h
(datbuf_format): Don't use sprintf; Precede each output line
with data offset.
Fix remaining uses of gdbm_set_errno function.
Use the GDBM_SET_ERRNO and GDBM_SET_ERRNO2 macros to make
sure the error gets reported in debug output.
* src/fullio.c (_gdbm_full_read)
(_gdbm_full_write): Return -1 and set gdbm_errno
on error.
* src/bucket.c: Use GDBM_SET_ERRNO(2?) or
GDBM_DEBUG where necessary.
* src/falloc.c: Likewise.
* src/findkey.c: Likewise.
* src/gdbmdefs.h: Likewise.
* src/gdbmopen.c: Likewise.
* src/gdbmstore.c: Likewise.
* src/mmap.c: Likewise.
* src/recover.c: Likewise.
* src/update.c: Likewise.
2016-07-25 Sergey Poznyakoff
Improve debugging and error tracing.
* src/gdbmdefs.h (GDBM_SET_ERRNO)
(GDBM_SET_ERRNO2): New macros.
* src/base64.c: Use new macros to set error state.
* src/bucket.c: Likewise.
* src/falloc.c: Likewise.
* src/findkey.c: Likewise.
* src/gdbm_load.c: Likewise.
* src/gdbmdelete.c: Likewise.
* src/gdbmdump.c: Likewise.
* src/gdbmexp.c: Likewise.
* src/gdbmfetch.c: Likewise.
* src/gdbmimp.c: Likewise.
* src/gdbmload.c: Likewise.
* src/gdbmopen.c: Likewise.
* src/gdbmseq.c: Likewise.
* src/gdbmsetopt.c: Likewise.
* src/gdbmstore.c: Likewise.
* src/gdbmtool.c: Fix preprocessor conditional.
Fix distribution
* src/Makefile.am: Mark gdbm.h as noinst
* compat/Makefile.am (AM_CPPFLAGS): Make sure we pick up
../src/gdbm.h
Improve the "next" shortcut.
* src/gdbmtool.c (open_handler): Close the previously
opened database.
(close_handler): Free the file name.
(print_dir_handler): Print the number of buckets.
(command_repeat_type): New enum.
(command) : Change type to enum command_repeat_type.
(command_tab): Update accordingly. Mark "next" with REPEAT_NOARG.
(run_last_command): Handle REPEAT_NOARG separately.
* NEWS: Document the shortcut.
* doc/gdbm.texi: Likewise.
* src/debug.c (datbuf_format): Don't represent
bytes after the end of datum as zeros.
(gdbm_debug_datum): Print datum size.
Add debug info.
* configure.ac: Fix description wording.
* src/Makefile.am [GDBM_COND_DEBUG_ENABLE]: Don't
define GDBM_DEBUG_ENABLE.
* tests/Makefile.am: Likewise.
* src/debug.c (gdbm_debug_printer)
(gdbm_debug_flags): New globals.
(gdbm_debug_token, gdbm_debug_parse_state)
(gdbm_debug_datum): New functions.
* src/gdbm.h.in [@GDBM_DEBUG_ENABLE@]: Define GDBM_DEBUG_ENABLE.
(gdbm_debug_printer_t): New typedef.
(gdbm_debug_printer, gdbm_debug_flags): New externs.
(GDBM_DEBUG_ERR,GDBM_DEBUG_OPEN)
(GDBM_DEBUG_READ,GDBM_DEBUG_STORE)
(GDBM_DEBUG_LOOKUP,GDBM_DEBUG_ALL): New defines.
(gdbm_debug_token,gdbm_debug_parse_state)
(gdbm_debug_datum): New protos.
* src/gdbmdefs.h (GDBM_DEBUG,GDBM_DEBUG_DATUM): New macros.
* src/findkey.c: Add debugging info.
* src/gdbmfetch.c: Likewise.
* src/gdbmopen.c: Likewise.
* src/gdbmseq.c: Likewise.
* src/gdbmstore.c: Likewise.
* src/gdbmtool.c (open_handler): Allow the use of ~/
(command) : New members.
(run_command): Handle variadic functions.
(run_last_command): New command. In interactive mode,
repeats the last command if it was marked
with repeat=1 (currently, only "next").
New command: "debug".
(all functions): Use terror instead of fprintf(stderr,...);
* src/gdbmtool.h (handler_param) : New member.
(run_last_command): New proto.
* src/gram.y: Call run_last_command) on empty input.
* tests/gtload.c: New option: -debug=
2016-07-20 Sergey Poznyakoff
Introduce debug hooks.
* configure.ac: New option --enable-debug
Print feature summary at the end of the run.
* src/debug.c: New file.
* src/Makefile.am [GDBM_COND_DEBUG_ENABLE]: Build debug.o
Define GDBM_DEBUG_ENABLE.
* src/gdbmdefs.h [GDBM_DEBUG_ENABLE] (_gdbm_debug_hook_install)
(_gdbm_debug_hook_remove,_gdbm_debug_hook_check)
(_gdbm_debug_hook_val): New protos.
(GDBM_DEBUG_HOOK, GDBM_DEBUG_OVERRIDE)
(GDBM_DEBUG_ALLOC): New defines.
* src/gdbm.h.in (GDBM_RCVR_FORCE): New flag.
* src/recover.c (gdbm_recover): Check database before attempting
recovery, unless GDBM_RCVR_FORCE flag is set.
* doc/gdbm.texi: Document GDBM_RCVR_FORCE
* src/gdbmreorg.c (gdbm_reorganize): Use GDBM_RCVR_FORCE.
* src/gdbmtool.c (main): Always allocate file_name.
* src/bucket.c: Put GDBM_DEBUG_OVERRIDE and GDBM_DEBUG_ALLOC
in critical places.
* src/falloc.c: Likewise.
* src/findkey.c: Likewise.
* src/gdbmopen.c: Likewise.
* src/gdbmstore.c: Likewise.
* src/update.c: Likewise.
* tests/Makefile.am [GDBM_COND_DEBUG_ENABLE]: Define GDBM_DEBUG_ENABLE.
* tests/gtload.c: New options -hook, -recover, -verbose,
-backup, -max-failures, -max-failed-keys,
and -max-failed-buckets.
Attempt recovery after errors.
Fix typo
2016-07-19 Sergey Poznyakoff
Improve docs. Minor changes.
* NEWS: Document new features.
* doc/gdbm.texi: Likewise.
* src/gdbm.h.in (gdbm_last_errno): Fix return value.
(gdbm_check_syserr): New proto.
* src/gdbmdefs.h (gdbm_file_info) : Fix data type.
* src/gdbmerrno.c (gdbm_last_errno): Fix return value.
(gdbm_check_syserr): New function.
Implement gdbm_recover function
* configure.ac: Don't check for rename.
* src/Makefile.am (libgdbm_la_SOURCES): Add recover.c
* src/recover.c: New file.
* src/bucket.c (_gdbm_get_bucket): Remove extra space before [
* src/err.c (prerror): Take additional argument
(gdbm_perror): Print system errno if necessary.
* src/gdbm.h.in (GDBM_CLOERROR): New flag.
(gdbm_fd_open, gdbm_copy_meta): New proto.
(gdbm_last_syserr,gdbm_db_strerror,gdbm_recover): New proto.
(gdbm_syserr): New extern.
(gdbm_recovery): New struct.
(GDBM_RCVR_DEFAULT,GDBM_RCVR_ERRFUN)
(GDBM_RCVR_MAX_FAILED_KEYS)
(GDBM_RCVR_MAX_FAILED_BUCKETS)
(GDBM_RCVR_MAX_FAILURES)
(GDBM_RCVR_BACKUP): New flags.
(GDBM_BACKUP_FAILED): New error code.
* src/gdbmclose.c (gdbm_close): Work correctly if dbf->desc == -1.
* src/gdbmcount.c (gdbm_count): Remove spurious sorting.
Use _gdbm_next_bucket_dir for iterating over the buckets.
* src/gdbmdefs.h (struct gdbm_file_info)
: New members.
* src/gdbmerrno.c (gdbm_set_errno): Set last_syserror as well.
(gdbm_clear_error): Reset last_syserror.
(gdbm_last_syserr): New function.
(gdbm_errlist): New entry for GDBM_BACKUP_FAILED.
(gdbm_db_strerror): New function.
(gdbm_syserr): New global.
* src/gdbmload.c (get_parms): Buffer can be NULL.
* src/gdbmopen.c (gdbm_fd_open): New function.
(gdbm_open): Rewrite as a wrapper over gdbm_fd_open.
* src/gdbmreorg.c (gdbm_reorganize): Rewrite as a wrapper
over gdbm_recover.
* src/proto.h (_gdbm_next_bucket_dir): New proto.
* src/gdbmtool.c: New command: recover.
* tests/.gitignore: Add gtrecover
* tests/gtrecover.c: New test program.
* tests/Makefile.am: Build gtrecover
2016-07-16 Sergey Poznyakoff
Bugfix
2016-07-15 Sergey Poznyakoff
New gdbm_setopt option to get the actual block size value
* src/gdbm.h.in (GDBM_GETBLOCKSIZE): New option.
* src/gdbmcount.c (gdbm_count): Fix memory leak on
error.
* src/gdbmsetopt.c (gdbm_setopt): Rewrite.
Handle GDBM_GETBLOCKSIZE.
* NEWS: Document GDBM_GETBLOCKSIZE
* doc/gdbm.texi: Likewise.
* tests/gtload.c: New options -bsexact and -verbose.
* tests/Makefile.am: Add new testcases.
* tests/testsuite.at: Likewise.
* tests/blocksize00.at: New testcase.
* tests/blocksize01.at: Likewise.
* tests/blocksize02.at: Likewise.
gdbm_open adjusts requested block size to accomodate integer number of directory offsets.
* src/gdbm.h.in (GDBM_BSEXACT): New flag.
* src/gdbmopen.c (compute_directory_size): New function.
(gdbm_open): When creating new database, adjust the requested
block size so that the block holds integer number of directory
indices. Disable this behavior if GDBM_BSEXACT flag is set
(this reverts to old behavior). Always unset GDBM_BSEXACT if
using block size returned by stat(2). This makes sure gdbm_open
succeeds on file systems reporting block sizes not divisible by
512.
* src/gdbmconst.h (GDBM_MIN_BLOCK_SIZE): New constant.
* src/gdbmimp.c (gdbm_import_from_file): Use GDBM_MIN_BLOCK_SIZE
instead of the hardcoded value.
* NEWS: Document GDBM_BSEXACT.
* doc/gdbm.texi: Likewise.
2016-07-14 Sergey Poznyakoff
Don't use hardcoded constant
* src/gdbmconst.h (GDBM_HASH_BITS): New constant.
* src/bucket.c: Use GDBM_HASH_BITS instead of the
hardcoded value.
* src/findkey.c (_gdbm_findkey): Use _gdbm_hash_key.
* src/gdbmtool.c (hash_handler): Use _gdbm_hash_key if the
database is open.
* src/hash.c (_gdbm_bucket_dir, _gdbm_hash_key): New functions.
* src/proto.h (_gdbm_bucket_dir, _gdbm_hash_key): New protos.
* src/systems.h (STATBLKSIZE): Take a struct stat as argument.
* src/gdbmopen.c (STATBLKSIZE): Takes argument now.
gdbmtool: improve bucket dump and hash calculator
* src/gdbmtool.c (format_key_start): New function.
(print_bucket): Take variadic arguments, use mesg
as prinf-style format.
Display first bytes of each non-empty key.
(print_current_bucket_begin): Avoid coredump if
gdbm_file is not initialized.
(print_current_bucket_handler): Change header depending on the
invoking command.
(hash_handler): In presence of a database, print also the
bucket number and offset within the bucket.
2016-07-13 Sergey Poznyakoff
Bugfix
Bugfix
Update magic file
* src/gdbm.magic: Recognize dumpfiles.
Update NEWS
Provide the gdbm.magic file for file(1).
* src/gdbm.magic: New file.
* README: Document existence of the magic file.
* src/Makefile.am (EXTRA_DIST): Add gdbm.magic.
gdbmtool: define macros for accessing typed handler arguments.
* src/gdbmtool.h (PARAM_STRING, PARAM_DATUM)
(PARAM_KVPAIR): New defines.
* src/gdbmtool.c: Use above for accessing handler arguments.
2016-07-12 Sergey Poznyakoff
Line-editing support in gdbmtool
* configure.ac: Check if GNU Readline is available.
* src/Makefile.am: Add new files.
* src/input-rl.c: New file.
* src/input-std.c: New file.
* src/gdbmtool.c (handler_param): Move declaration to
the header file.
(quit_handler): Call input_done.
(command_tab): Add the "history" command.
(command_generator): New function.
(slist_new_s, slist_new_l)
(slist_insert): New functions.
(main): Call input_init and input_done.
* src/gdbmtool.h: New protos.
* src/gram.y: Use slist_insert to construct string lists.
* src/lex.l (read_input): Remove. Use input_read instead.
(print_prompt_at_bol): New function.
(print_prompt): Remove.
(make_prompt): New function.
* NEWS: Document changes.
* README: Document readline support.
* doc/gdbm.texi: Document line editing in gdbmtool.
* doc/gdbmtool.1: Likewise.
2016-07-09 Sergey Poznyakoff
Don't bail out on fatal errors, unless the user defines the fatal_err function
* src/bucket.c (_gdbm_get_bucket)
(_gdbm_split_bucket, _gdbm_write_bucket): Return error code. All callers
updated.
* src/proto.h (_gdbm_get_bucket)
(_gdbm_split_bucket, _gdbm_write_bucket): Update declarations
* src/falloc.c (push_avail_block)
(pop_avail_block): Return error code. All callers
updated.
* src/update.c (_gdbm_fatal): Exit only if the user defined
fatal_err function.
* src/gdbmerrno.c (gdbm_needs_recovery): New function.
* src/gdbm.h.in (gdbm_needs_recovery): New proto.
* compat/dbminit.c: Set gdbm_errno on fatal errors.
* compat/dbmopen.c: Likewise.
* src/findkey.c: Likewise.
* src/gdbm_load.c: Likewise.
* src/gdbmcount.c: Likewise.
* src/gdbmdefs.h: Likewise.
* src/gdbmdelete.c: Likewise.
* src/gdbmdump.c: Likewise.
* src/gdbmexists.c: Likewise.
* src/gdbmexp.c: Likewise.
* src/gdbmfetch.c: Likewise.
* src/gdbmimp.c: Likewise.
* src/gdbmload.c: Likewise.
* src/gdbmopen.c: Likewise.
* src/gdbmreorg.c: Likewise.
* src/gdbmseq.c: Likewise.
* src/gdbmsetopt.c: Likewise.
* src/gdbmstore.c: Likewise.
* src/gdbmsync.c: Likewise.
* src/mmap.c: Likewise.
All gdbm functions return immediately if the DB is in inconsistent sate (needs recovery).
* src/gdbm.h.in (GDBM_NEED_RECOVERY): New error code.
* src/gdbmdefs.h (GDBM_ASSERT_CONSISTENCY): New macro.
* src/gdbmerrno.c: Update.
* src/gdbmopen.c (gdbm_open): Initialize need_recovery
and last_error.
* src/gdbmcount.c (gdbm_count): Return immediately if the
database needs recovery.
* src/gdbmdelete.c (gdbm_delete): Likewise.
* src/gdbmdump.c (gdbm_dump_to_file, gdbm_dump): Likewise.
* src/gdbmexists.c (gdbm_exists): Likewise.
* src/gdbmexp.c (gdbm_export_to_file): Likewise.
* src/gdbmfetch.c (gdbm_fetch): Likewise.
* src/gdbmimp.c (gdbm_import_from_file): Likewise.
* src/gdbmreorg.c (gdbm_reorganize): Likewise.
* src/gdbmseq.c (gdbm_firstkey): Likewise.
* src/gdbmsetopt.c (gdbm_nextkey): Likewise.
* src/gdbmstore.c (gdbm_store): Likewise.
* src/gdbmsync.c (gdbm_sync): Likewise.
Fix indentation
Per-database error state.
Last error code is stored in the database file structure as
well as in the global gdbm_errno. Special functions are provided
for retrieving and clearing the last error state.
* src/gdbmdefs.h (gdbm_file_info): New member: last_error
* src/gdbm.h.in (gdbm_last_errno, gdbm_set_errno)
(gdbm_clear_error): New protos.
* src/gdbmerrno.c (gdbm_last_errno, gdbm_set_errno)
(gdbm_clear_error): New functions
* NEWS: Update.
* compat/dbminit.c: Use gdbm_set_errno to set error state.
* compat/dbmopen.c: Likewise.
* src/bucket.c: Likewise.
* src/findkey.c: Likewise.
* src/gdbm_load.c: Likewise.
* src/gdbmcount.c: Likewise.
* src/gdbmdelete.c: Likewise.
* src/gdbmdump.c: Likewise.
* src/gdbmexists.c: Likewise.
* src/gdbmexp.c: Likewise.
* src/gdbmfetch.c: Likewise.
* src/gdbmimp.c: Likewise.
* src/gdbmload.c: Likewise.
* src/gdbmopen.c: Likewise.
* src/gdbmreorg.c: Likewise.
* src/gdbmseq.c: Likewise.
* src/gdbmsetopt.c: Likewise.
* src/gdbmstore.c: Likewise.
* src/gdbmsync.c: Likewise.
* src/mmap.c: Likewise.
2016-07-08 Sergey Poznyakoff
Use C99 array initializers in src/gdbmerrno.c
Improve _gdbm_findkey interface.
* doc/gdbm.texi: Document gdbm_exists in detail.
* src/findkey.c (_gdbm_findkey): return parameters can be
NULL.
* src/gdbmexists.c (gdbm_exists): Remove unnecessary
local variables. Reset gdbm_errno to 0 if the key was
not found.
* src/gdbmdelete.c (gdbm_delete): Remove unnecessary
local variables.
* src/gdbmfetch.c: Likewise.
* src/gdbmseq.c: Likewise.
* src/gdbmstore.c: Likewise.
Fix error handling in gdbm_fetch, gdbm_firstkey, and gdbm_nextkey.
* src/gdbmfetch.c: Hanlde out of memory error.
* src/findkey.c: Set gdbm_errno to GDBM_ITEM_NOT_FOUND
if nothing was found.
* src/gdbmdelete.c: Don't set gdbm_errno after
_gdbm_findkey returns -1. It's been done already.
* src/gdbmexp.c (gdbm_export_to_file): Return -1 if
gdbm_fetch fails.
* src/gdbmseq.c (get_next_key): Set gdbm_errno to
GDBM_ITEM_NOT_FOUND if there's no next key.
Don't call _gdbm_fatal on out of memory condition.
(gdbm_nextkey): Set gdbm_errno to
GDBM_ITEM_NOT_FOUND if there's no next key.
* src/gdbmtool.c (fetch_handler)
(firstkey_handler,nextkey_handler): Check gdbm_errno.
* src/gdbmstore.c: Handle error return from _gdbm_findkey.
* tests/gtdump.c: Likewise.
* tests/gtfetch.c: Likewise.
* doc/gdbm.texi: Document changes.
* doc/gdbm.3: Likewise.
* configure.ac: Version 1.12.90
* NEWS: Update.
* .gitignore: Update.
2016-07-07 Sergey Poznyakoff
Switch to Git repository
* .cvsignore: Rename to .gitignore
* compat/.cvsignore: Likewise.
* doc/.cvsignore: Likewise.
* export/.cvsignore: Likewise.
* po/.cvsignore: Likewise.
* src/.cvsignore: Likewise.
* tests/.cvsignore: Likewise.
* doc/gdbm.texinfo: Rename to doc/gdbm.texi
* doc/Makefile.am: Update
Generate ChangeLog from Git log
* ChangeLog: Rename to ChangeLog.cvs
* Makefile.am: Recreate ChangeLog
* bootstrap: Create a ChangeLog placeholder.
* git2chg.awk: New file.
2016-07-06 Sergey Poznyakoff
* doc/gdbm.texinfo: Normal installation prefix is /usr.
* doc/gdbm.3: Spell fixes.
2016-05-16 Sergey Poznyakoff
Version 1.12
2016-05-16 Sergey Poznyakoff
* src/gdbmtool.c (_gdbm_print_bucket_cache): Use %zu to print
size_t.
* src/gdbmtool.h (variable_unset): New proto.
(yyerror): Argument is char const *.
* src/gram.y: Likewise.
* src/lex.l: Add option noinput
* src/parseopt.c (print_option_descr): Use fwrite instead of
printf.
* src/var.c: Fix initializers to suppress warnings.
2015-12-05 Sergey Poznyakoff
* doc/gendocs_template: Add references to manpages.
2015-12-05 Harald Hoyer
* doc/gdbmtool.1: Minor change.
* doc/gdbm.3: Fix typo.
2015-11-02 Sergey Poznyakoff
Tiny fix
* var.c: Use ISO C99 initializers. Thanks to
Brad Forschinger
2015-08-14 Sergey Poznyakoff
Fix doc generation.
* doc/Config: Rename to doc/html.init.
* doc/gdbm.texinfo: Fix sectioning.
2015-08-13 Sergey Poznyakoff
Minor fix in docs
* doc/gdbm.texinfo: Fix direntry records.
2014-07-03 Sergey Poznyakoff
Bugfix.
* src/lex.l (expand_char): Don't return any value.
2014-02-14 Sergey Poznyakoff
Optionally install compatibility headers into a separate directory.
* configure.ac: Version 1.11.90
(COMPATINCLUDEDIR): New substitution variable.
* compat/Makefile.am (compatincludedir): New variable.
(include_HEADERS): Rename to compatinclude_HEADERS.
* NEWS: Document COMPATINCLUDEDIR.
* README: Likewise.
2014-02-12 Sergey Poznyakoff
* src/gdbmimp.c (gdbm_import_from_file): Read record sizes as
unsigned long, as they are stored by gdbm_export_to_file.
Improve error reporting.
2014-02-06 Sergey Poznyakoff
* doc/Makefile.am: Use dist_man_MANS
2013-12-25 Sergey Poznyakoff
Version 1.11
2013-12-25 Sergey Poznyakoff
Minor changes.
* src/gdbm_load.c: New options: --mmap, --cache-size and
--block-size.
* doc/gdbm.texinfo: Document new gdbm_load options.
* doc/gdbm_load.1: Likewise.
* src/gdbmdelete.c: Stylistic changes.
* src/gdbmstore.c: Likewise.
2013-05-21 Sergey Poznyakoff
New function gdbm_count.
* configure.ac: Check for unsigned long long, define
substitution variable GDBM_COUNT_T.
* src/gdbmcount.c: New file.
* src/Makefile.am (libgdbm_la_SOURCES): Add gdbmcount.c.
* src/bucket.c (_gdbm_read_bucket_at): New function.
* src/gdbm.h.in (gdbm_count_t): New typedef.
(gdbm_count): New proto.
* src/gdbmdefs.h (GDBM_DIR_COUNT): New define.
* src/proto.h (_gdbm_read_bucket_at): New proto.
* src/var.c: New variable "filemode".
* src/gdbmtool.c: Use gdbm_count. Various bugfixes.
* NEWS: Update.
* doc/gdbm.texinfo: Update.
2013-05-17 Sergey Poznyakoff
Update the docs.
* NEWS: Update.
* doc/gdbm.texinfo: Update.
* doc/gdbmtool.1: Document the "define" statement.
* src/datconv.c: Rename string datatypes to reflect their
meaning.
(dsprint): Improve output presentation.
2013-05-16 Sergey Poznyakoff
Provide support for a simplified "define" construct.
* doc/gdbm.texinfo: Document the "define" statement.
* src/datconv.c: Support short and ushort data types.
* src/gdbmtool.c: Don't call checkdb prior to handling
the "hash" command.
* src/gram.y: Support simplified definition construct:
"define key|content type".
2013-05-16 Sergey Poznyakoff
Improve handling of the variables.
* src/gdbmtool.c (opendb): Allow for unset variables.
* src/gram.y: Improve error detection.
* src/lex.l: Handle multiline strings.
(pe_file_name): file_name can be NULL.
* src/var.c (VARF_PROT): New flag. Protects the variable
from being unset.
(vartab): Use VARF_PROT if needed.
(s2b): Fix return values.
(variable_set, variable_unset): Return error if attempting
to unset a variable marked with VARF_PROT.
* doc/gdbm.info: Update.
* doc/gdbmtool.1: Update.
2013-05-15 Sergey Poznyakoff
Minor change
* src/gdbmtool.c (command_tab): Change variable names
in docstrings to uppercase.
2013-05-15 Sergey Poznyakoff
Implement the "quiet" variable.
* src/var.c (vartab) : New variable.
(variable_is_true): Return 0 if the value cannot be
retrieved.
* src/gdbmtool.c (optab): New option --file (-f).
(main): Handle the --file option.
Retrieve the "quiet" setting from the variable.
* src/lex.l (context_pop): Clear both point.file
and yylloc.
2013-05-15 Sergey Poznyakoff
Add "pager" variable and "unset" command.
* src/gdbmtool.c (command_tab) : New command.
(run_command): Get pager value from the variable.
* src/gdbmtool.h (VAR_ERR_NOTSET): New error code.
(variable_is_true): New function. Replaces variable_is_set,
which changed semantics.
* src/gram.y: Implement the unset command.
* src/var.c: Support the "unset variable" notion.
(VARF_INIT): New flag.
(VAR_IS_SET): New define.
(vartab): Mark initialized variables with VARF_INIT.
New variable "pager".
(open_hook): v can be NULL.
(variable_set): NULL value unsets the variable.
(variable_unset): New function.
(variable_get): Return VAR_ERR_NOTSET if the variable is
not set.
(variable_is_true): Renamed from variable_is_set.
(variable_is_set): New function.
* src/gdbmdefs.h: Fix some typos.
2013-05-14 Sergey Poznyakoff
Change variable handling.
* src/util.c: New file.
* src/Makefile.am: Add new files.
* src/gdbmtool.c (open_mode): New variable.
(terror): Remove.
(mkfilename, tildexpand): Move to util.c
(opendb): Use open_mode.
(import_handler): Likewise.
(optab): New option -N (--norc).
* src/gdbmtool.h (vparse_error): Rename to vlerror.
(parse_error): Rename to lerror.
(syntax_error): Rename tp terror.
All uses updated.
(VAR_ERR_FAILURE): Remove.
(VAR_ERR_BADVALUE): New error code.
(variable_mode_name): Remove.
(mkfilename, tildexpand)
(vgetyn, getyn): New protos.
* src/lex.l (initialized): New static.
(setsource): Set initialized.
(vlerror): Print locus only if the lexer has been
initialized.
* src/var.c: Rewrite.
2013-05-14 Sergey Poznyakoff
Provide "open" and "close" commands; implement new variables.
* src/datconv.c (datum_format): Don't print field delimiter
after the last field.
(dsprint): Bugfix.
* src/gdbmload.c (gdbm_load_from_file): Return GDBM_NO_DBNAME
when loading from bdb dump and the database pointer is NULL.
* src/gdbmtool.c (opendb, checkdb): New auxiliary functions.
(begin handlers): call checkdb.
(import_handler): Special handling for GDBM_NO_DBNAME.
(status_handler): Print more info.
(command_tab): Call checkdb prior to handlers that expect an
open database.
New commands: open, close
(gdbmarg_string, gdbmarg_datum)
(gdbmarg_kvpair): Take pointer to locus as the 2nd argument.
All uses changed.
(coerce): Include locus info in the diagnostic message.
(main): Don't open database right away.
* src/gdbmtool.h (GDBMTOOL_DEFFILE): New define.
(gdbmarg) : New member.
(VART_INT): New variable typ.e
(VAR_ERR_FAILURE): New error code.
(variable_is_set, varible_mode_name): New protos.
* src/gram.y: Provide printable token names for error messages.
Pass locus to gdbmarg initialization functions.
* src/lex.l (vparse_error): Fix output.
* src/var.c (variable) : New members.
(vartab): Define more variables.
(variable_set): Accept value of any valid datatype.
(variable_mode_name, variable_is_set): New functions.
2013-05-14 Sergey Poznyakoff
Cleanup.
* src/datconv.c (s_float): Use strtod.
(datum_scan_notag, datum_scan_tag): Made static.
(dsprint): New function.
* src/gdbmtool.c (status_handler): Print key and
content definitions.
(slist_new): Bugfix (missing return statement).
* src/gdbmtool.h: Add new prototypes.
* src/lex.l: Remove unused variables, set option
nounput.
2013-05-14 Sergey Poznyakoff
Implement rc files and "source" command; improve lexical analyzer.
* src/gdbmtool.c (interactive): Move to lex.l;
(mkfilename, tildexpand): New functions.
(command_tab) : New command.
(main): Source rc file, if present.
* src/gdbmtool.h (setsource): Change return type
and signature.
* src/lex.l: Implement context stack.
Change DEF to be an exclusive state.
* src/gdbmapp.h (estrdup): Argument is const.
* src/mem.c: Likewise.
2013-05-14 Sergey Poznyakoff
Add support for Berkeley dump format version 3 (read-only).
* src/gdbmapp.h: Include gettext.h and locale.h.
* src/gdbmload.c: Support for Berkeley dump format,
version 3.
2013-05-13 Sergey Poznyakoff
Remove the "read" command. Use "import" instead.
2013-05-13 Sergey Poznyakoff
Add "set" and "define" to the main command table.
* src/gdbmtool.c: Include gram.h
(command) : New member.
(command_tab): List "define" and "set".
(find_command): Rewrite as command_lookup, with different
return type and signature.
(run_command): Take struct command * as its first argument.
* src/gdbmtool.h (command_lookup): New proto.
(run_command): Change signature.
(datadef_locate): Rename to datadef_lookup. All uses changed.
* src/gram.y: Update.
* src/lex.l: Change handling of IDENT rules.
2013-05-13 Sergey Poznyakoff
Implement shell variables in gdbmtool.
* src/var.c: New file.
* src/Makefile.am: Add var.c
* src/datconv.c (datum_format): Remove the "delim"
parameter, use "delim1" and "delim2" shell variables
instead.
* src/gdbmtool.c: Remove "prompt" command. Use "set ps[12]"
instead.
(print_prompt): Move to lex.l
* src/gdbmtool.h (variable_set)
(variable_get, variable_print_all): New protos.
* src/gram.y: Handle the "set" command.
* src/lex.l: Update.
2013-05-13 Sergey Poznyakoff
Handle structured key and content data in gdbmtool.
* src/datconv.c: New file.
* src/Makefile.am (gdbmtool_SOURCES): Add datconv.c.
* src/gdbmtool.h (slist, kvpair): New structures.
(gdbmarg): Keep various types of data depending on the
value of the type member.
(slist_new, slist_free)
(kvpair_string, kvpair_list): New protos.
(gdbmarg_new): Remove.
(gdbmarg_string, gdbmarg_datum)
(gdbmarg_kvpair, gdbmarg_free)
(gdbmarg_destroy): New protos.
(xd_expand, xd_store, datadef_locate): New protos.
(field, dsegm): New structs.
(dsegm_new, dsegm_new_field, dsegm_free_list): New protos.
* src/gdbmtool.c: Rewrite.
* src/gram.y: Change grammar to allow for defining key and
content structure and for supplying structured data as arguments
to fetch, store and similar functions.
* src/lex.l: Handle new token types.
* tests/dtload.c (main): Fix parser.
* tests/gtload.c: Likewise.
2013-05-11 Sergey Poznyakoff
Rewrite gdbmtool parser.
* src/testgdbm.c: Remove.
* src/gdbmtool.c: New file.
* src/gdbmtool.h: New file.
* src/gram.y: New file.
* src/lex.l: New file.
* src/Makefile.am: Update.
2013-05-09 Sergey Poznyakoff
Add new prompt escapes.
* src/testgdbm.c: New prompt escapes: %p, %P, %v, %_.
Change default prompt to %p>%_.
* doc/gdbmtool.1: Document new prompt escapes.
2013-05-08 Sergey Poznyakoff
Rename testgdbm to gdbmtool. Improve documentation.
* configure.ac: Fix a typo.
* src/.cvsignore: Add gdbmtool
* src/Makefile.am: Rename testgdbm to gdbmtool. Source
file not renamed because of CVS deficiency.
* src/gdbm_dump.c: Enable NLS.
* src/gdbm_load.c: Likewise.
* src/testgdbm.c: New option -q (--quiet).
New command: prompt.
* doc/Makefile.am (man_MANS): Add new manpages.
* doc/gdbmtool.1: New file.
* doc/gdbm_load.1: New file.
* doc/gdbm_dump.1: New file.
* doc/gdbm.3: Update.
* doc/gdbm.texinfo: Update.
2013-05-08 Sergey Poznyakoff
* configure.ac: (AC_INIT): Add webpage URL.
2013-05-08 Sergey Poznyakoff
Improve testgdbm; install some more bugfixes.
* src/gdbmdefs.h: Fix typo in a comment.
* src/gdbmdump.c (gdbm_dump_to_file): Improve error
checking.
* src/testgdbm.c: Improve interactive usage.
(command) : Rename to len.
(command_tab): Initialize len.
(set_minimal_abbreviations): Remove.
(sort_commands): New function.
(find_command): Print possible alternatives in case of
ambiguous input.
(main): Reset param.argc after freeing previous arguments.
Continue silently if find_command returns NULL.
2013-05-07 Sergey Poznyakoff
Bugfix.
* src/gdbmreorg.c: Call _gdbm_mapped_init when the database
structure is fully initialized (Puszcza bug #171).
2013-05-07 Sergey Poznyakoff
Minor change
* configure.ac: Require autoconf 2.69 or newer (in response
to Puszcza bug #171).
2012-03-21 Sergey Poznyakoff
* tests/create00.at: Use cmp -s || diff -u instead of plain
diff, because the latter produces extra output on some systems
(notably Solaris).
* tests/dbmcreate00.at: Likewise.
* THANKS: Add Bill Jones
2011-11-16 Sergey Poznyakoff
Improve testgdbm
* src/mem.c (ealloc_die): Return EXIT_FATAL to the shell.
* src/testgdbm.c: Use emalloc, erealloc and estrdup for memory
allocation.
(syntax_error): New function.
(handler_param): New struct.
(all handlers): Change signature. Take a pointer to struct
handler_param as argument.
(export_handler,import_handler): Handle new formats.
(main): Take first argument to be the file name.
(optab): Remove -f argument. Hide -g, but retain it for
backward compatibility.
* doc/gdbm.texinfo: Update.
2011-11-15 Sergey Poznyakoff
Version 1.10.90
Update the docs. Improve dump/load utilities.
* doc/gdbm.texinfo: Reorganize the material. Document gdbm_load
and gdbm_dump utilities.
* src/gdbm.h.in (GDBM_META_MASK_MODE)
(GDBM_META_MASK_OWNER): New constant.
(gdbm_load,gdbm_load_from_file): Take an additional argument:
meta_flags, which masks out restoring certain meta-data.
* src/gdbm_dump.c: Remove -b option. The -H option takes symbolic
format names. Use the standard exit codes.
* src/gdbm_load.c: New options: --mode, --user and --no-meta.
Use the standard exit codes.
* src/gdbmapp.h (EXIT_OK, EXIT_FATAL, EXIT_MILD)
(EXIT_USAGE): New constants.
* src/gdbmload.c (gdbm_load,gdbm_load_from_file): Take an
additional argument, which masks out restoring certain meta-data.
2011-11-15 Sergey Poznyakoff
Return a meaningful error code if failed to restore file's metadata.
* src/gdbm.h.in (GDBM_ERR_FILE_OWNER)
(GDBM_ERR_FILE_MODE): New error codes.
(_GDBM_MAX_ERRNO): Update.
* src/gdbmerrno.c (gdbm_errlist): Add new error codes.
* src/gdbmload.c (_set_gdbm_meta_info): Set gdbm_errno and
return 1 in case of errors.
(_gdbm_load_file): Propagate the return value from
_set_gdbm_meta_info.
* src/gdbm_load.c (main): Handle mild error conditions.
* export/export.c (usage): Print the GDBM version the program is
linked with.
* doc/gdbm.texinfo: Document changes.
2011-11-14 Sergey Poznyakoff
* doc/gdbm.texinfo (Error codes): Document new flat format and
related functions.
* po/POTFILES.in: Update
2011-11-13 Sergey Poznyakoff
Implement new dump format. Add new utilities: gdbm_dump and gdbm_load.
* configure.ac (AC_CHECK_HEADERS): Don't check for files that must
always be present. Check for getopt.h.
(AC_CHECK_FUNCS): Add getopt_long
* src/systems.h: Include useless #if's.
* src/flatfile.c: Split into two files:
* src/gdbmexp.c: ... this and ...
* src/gdbmimp.c: .., this
* src/mem.c: New file.
* src/base64.c: New file.
* src/gdbm_dump.c: New file.
* src/gdbm_load.c: New file.
* src/gdbmapp.h: New file.
* src/gdbmdump.c: New file.
* src/gdbmload.c: New file.
* src/parseopt.c: New file.
* src/progname.c: New file.
* src/.cvsignore: Update.
* src/Makefile.am (libgdbm_la_SOURCES): Add new files.
(noinst_LIBRARIES): New variable. Build libgdbmapp.a.
(libgdbmapp_a_SOURCES): New variable.
(bin_PROGRAMS): Add gdbm_load and gdbm_dump
(testgdbm_LDADD, gdbm_load_LDADD)
(gdbm_dump_LDADD): Add ./libgdbmapp.a
* src/gdbm.h.in: Include
(gdbm_export_to_file)
(gdbm_import_from_file): New prototypes.
(GDBM_DUMP_FMT_BINARY,GDBM_DUMP_FMT_ASCII): New constants.
(gdbm_dump,gdbm_load)
(gdbm_dump_to_file,gdbm_load_from_file): New prototypes.
(GDBM_NO_DBNAME): New error code.
(_GDBM_MAX_ERRNO): Update.
* src/gdbmdefs.h (_GDBM_MAX_DUMP_LINE_LEN): New constant.
* src/gdbmerrno.c (gdbm_errlist): Add entry for GDBM_NO_DBNAME.
* src/proto.h (_gdbm_base64_encode,_gdbm_base64_decode)
(_gdbm_load,_gdbm_dump): New prototypes.
* src/testgdbm.c: Use gdbmapp interface for option parsing.
* export/export.c: Include gdbmexp.c
* export/.cvsignore: Update.
* doc/gdbm.texinfo: Update.
2011-11-13 Sergey Poznyakoff
Version 1.10
* NEWS: Raise version number.
* configure.ac: Raise version number.
2011-11-11 Sergey Poznyakoff
Implement cloexec in gdbm_reorganize. Add test cases.
* compat/dbmopen.c: Apply O_CLOEXEC to newly created dir
file, if requested.
* src/gdbmdefs.h (gdbm_file_info) : New member.
* src/gdbmopen.c (gdbm_open): Initialize cloexec member.
* src/gdbmreorg.c (gdbm_reorganize): Propagate cloexec bit
to the new database.
* tests/.cvsignore: Update.
* tests/cloexec00.at: New test case.
* tests/cloexec01.at: Likewise.
* tests/cloexec02.at: Likewise.
* tests/cloexec03.at: Likewise.
* fdop.c: New auxiliary program.
* g_open_ce: New test program.
* g_reorg_ce: New test program.
* d_creat_ce: New test program.
* tests/Makefile.am: Add new test cases and test programs.
* tests/testsuite.at: Include new test cases.
* doc/gdbm.texinfo: Minor change.
2011-11-11 Sergey Poznyakoff
Use SEEK_SET instead of L_SET in all sources.
2011-11-11 Sergey Poznyakoff
Support close-on-exec flag for gdbm_open call.
* src/gdbm.h.in (GDBM_CLOEXEC): New flag.
* src/systems.h [O_CLOEXEC]: Provide a placeholder definition.
* src/gdbmopen.c (gdbm_open): Honor the GDBM_CLOEXEC flag.
* compat/dbmopen.c (ndbm_open_dir_file0): Mask out open mode
before comparing with GDBM_READER.
Support GDBM_CLOEXEC.
(dbm_open): Translate O_CLOEXEC to GDBM_CLOEXEC.
* doc/gdbm.texinfo: Document GDBM_CLOEXEC.
* NEWS: Update.
2011-11-11 Sergey Poznyakoff
Fix handling of NDBM databases in read-only mode.
* compat/dbmopen.c (ndbm_open_dir_file0): Open dir file in
read-only mode if the database is being opened as GDBM_READER.
* tests/dbmcvt.at: New file.
* tests/dbmfetch02.at: New file.
* tests/dbmfetch03.at: New file.
* tests/Makefile.am (TESTSUITE_AT): Add new files.
* tests/testsuite.at: Include new testcases.
2011-10-05 Sergey Poznyakoff
Fix bug #150.
Tolerate I/O operations returning less bytes than expected. Retry I/O
if possible.
* src/fullio.c: New file.
* src/Makefile.am (libgdbm_la_SOURCES): Add fullio.c
* src/proto.h (_gdbm_full_read)
(_gdbm_full_write): New protos.
* src/gdbmerrno.c (gdbm_errlist): Add entry for GDBM_FILE_EOF.
* src/bucket.c: Use _gdbm_full_{read|write}.
* src/falloc.c: Likewise.
* src/findkey.c: Likewise.
* src/gdbmopen.c: Likewise.
* src/gdbmstore.c: Likewise.
* src/testgdbm.c: Likewise.
* src/update.c: Likewise.
2011-10-05 Sergey Poznyakoff
* src/gdbmopen.c (gdbm_open): Initialize memory used for file
header. This fixes bug #151.
2011-08-24 Sergey Poznyakoff
Implement multi-character commands in testgdbm.
* bootstrap (get_po): Discard output from cmp.
* src/testgdbm.c: Implement multi-character commands.
* doc/gdbm.texinfo: Update.
2011-08-18 Sergey Poznyakoff
* bootstrap: Get PO files; create LINGUAS list
* po/.cvsignore: Add LINGUAS.
2011-08-17 Sergey Poznyakoff
Make sure errno is preserved, if it can contain details about the
gdbm error.
* src/gdbmdefs.h (SAVE_ERRNO): New macro.
* src/gdbmopen.c: Use SAVE_ERRNO where it is important to
preserve system errno.
* src/mmap.c: Likewise.
* doc/gdbm.texinfo: Document which gdbm errors can
be detailed by inspecting the system errno.
2011-08-17 Sergey Poznyakoff
Introduce new error code.
* configure.ac, NEWS: Raise patchlevel to 90.
* src/gdbm.h.in: Enclose entire file in conditional
extern "C".
(GDBM_FILE_STAT_ERROR): New error code.
(_GDBM_MAX_ERRNO): Update.
* src/gdbmerrno.c (gdbm_errlist): Update.
* src/gdbmopen.c: Set GDBM_FILE_STAT_ERROR on fstat
failure.
* src/gdbmreorg.c: Likewise.
* src/mmap.c: Likewise.
* src/systems.h: Include errno.h
* gdbm.texinfo: Document GDBM_FILE_STAT_ERROR.
2011-08-16 Sergey Poznyakoff
Minor housekeeping for Gnits compliance.
* README-alpha: New file.
* README-hacking: New file.
* bootstrap: Update.
2011-08-16 Sergey Poznyakoff
Internationalization.
* Makefile.am (SUBDIRS): Add po.
(EXTRA_DIST): Add build-aux/config.rpath.
* configure.ac (AC_CONFIG_FILES): Add po/Makefile.in.
* bootstrap: New file.
* src/Makefile.am (AM_CPPFLAGS): Define LOCALEDIR
(noinst_HEADERS): Add gettext.h
(LIBADD): New variable.
* src/gettext.h: New file.
* po/.cvsignore: New file.
* po/Makevars: New file.
* po/POTFILES.in: New file.
* src/gdbmdefs.h: Define DEFAULT_TEXT_DOMAIN, _, N_
Include gettext.h
* src/bucket.c: Add NLS markers.
* src/falloc.c: Likewise.
* src/findkey.c: Likewise.
* src/gdbmerrno.c: Likewise.
* src/gdbmfetch.c: Likewise.
* src/gdbmseq.c: Likewise.
* src/gdbmstore.c: Likewise.
* src/update.c: Likewise.
* src/testgdbm.c: Add NLS markers.
(main): Initialize I18N.
2011-08-14 Sergey Poznyakoff
* compat/Makefile.am (libgdbm_compat_la_LIBADD): Link against
libgdbm. Suggested by Adam Sampson.
2011-08-13 Sergey Poznyakoff
Improve release checking: use gnits.
* configure.ac (AM_INIT_AUTOMAKE): Use gnits.
(AC_INIT): Remove extra quoting from around version number
to pacify gnits.
* THANKS: New file.
2011-08-13 Sergey Poznyakoff
Verify preprocessor directives. Pass them through cppi to
reflect their nesting level. Affected files:
* src/flatfile.c
* src/gdbmconst.h
* src/gdbm.h.in
* src/gdbmconst.h
* src/gdbmopen.c
* src/gdbmreorg.c
* src/lock.c
* src/mmap.c
* src/systems.h
* src/testgdbm.c
2011-08-13 Sergey Poznyakoff
* NEWS, configure.ac: Version 1.9.1
2011-08-12 Sergey Poznyakoff
Bugfixes (pointed out by Matthew Burgess
).
* src/gdbmopen.c: Fix a typo.
* tests/Makefile.am ($(srcdir)/package.m4): Fix improper
dependency.
2011-08-11 Sergey Poznyakoff
Release 1.9
2011-08-11 Sergey Poznyakoff
Add testcases for gdbm_setopt.
* tests/gtopt.c: New file
* tests/.cvsignore: Update.
* tests/setopt00.at: New testcase.
* tests/setopt01.at: New testcase.
* tests/Makefile.am: Build gtopt. Add setopt00.at and setopt01.at.
* tests/testsuite.at: Include setopt00.at and setopt01.at.
2011-08-11 Sergey Poznyakoff
New option GDBM_GETDBNAME.
* src/gdbm.h.in (GDBM_GETDBNAME): New option.
* src/gdbmsetopt.c (gdbm_setopt): Handle GDBM_GETDBNAME.
* doc/gdbm.texinfo (Options): Document GDBM_GETDBNAME.
2011-08-11 Sergey Poznyakoff
Improve gdbm_setopt interface.
* src/gdbm.h.in (GDBM_OPENMASK): New constant.
* src/gdbmconst.h: Remove constants duplicated in
gdbm.h.in.
* src/gdbmdefs.h (gdbm_file_info)
: Replace with a single member: memory_mapping.
All callers updated.
(GDBM_SETCACHESIZE,GDBM_SETSYNCMODE)
(GDBM_SETCENTFREE,GDBM_SETCOALESCEBLKS): New option names.
(GDBM_SETMMAP,GDBM_GETMMAP,GDBM_GETFLAGS)
(GDBM_GETCACHESIZE,GDBM_GETSYNCMODE,GDBM_GETCENTFREE)
(GDBM_GETCOALESCEBLKS,GDBM_GETMAXMAPSIZE): New option codes.
* src/gdbmsetopt.c: Implement new options.
* doc/gdbm.texinfo: Document new options.
2011-08-11 Sergey Poznyakoff
Improve memory mapping support.
The new code is more flexible and performs better when
lots of inserts are being made (e.g. when populating the
database with new data).
* src/gdbm.h.in (GDBM_SETMAXMAPSIZE): New constant.
* src/gdbmconst.h (SIZE_T_MAX): New define.
* src/gdbmdefs.h (gdbm_file_info) : Change type
to size_t.
: New member.
: Remove.
* src/gdbmopen.c: Fix a typo.
(gdbm_open): Initialize new members.
(_gdbm_init_cache): Second argument is size_t.
* src/gdbmsetopt.c (gdbm_setopt): Optval argument is void*.
Handle GDBM_SETMAXMAPSIZE.
Improve error checking.
* src/mmap.c (_GDBM_IN_MAPPED_REGION_P): Fix comparison with
the lower bound.
(_GDBM_NEED_REMAP): Return true if mapped_region is NULL.
(SUM_FILE_SIZE): Rewrite.
(_gdbm_mapped_unmap): Don't call msync.
(_gdbm_internal_remap): Take 2 arguments, the second one
giving the new mapped size.
Unmap the region prior to remapping it.
Always pass NULL as the argument to mmap.
(_gdbm_mapped_remap): Rewrite the logic. Change semantics of the
third argument. All uses updated.
(_gdbm_mapped_init): Reflect the above changes.
(_gdbm_mapped_read,_gdbm_mapped_write): Use mmap_inited to decide
whether to use mmap, because mapped_region can be reset to zero
by another functions (namely, _gdbm_mapped_lseek).
Reset mmap_inited to FALSE, if _gdbm_mapped_remap fails.
(_gdbm_mapped_lseek): Rewrite offset computations. Invalidate
the mapped region.
* src/proto.h (_gdbm_init_cache): Change prototype.
* src/update.c (write_header, _gdbm_end_update): Remove checks
for dbf->mapped_region.
* tests/gtload.c: Implement the -maxmap option (set maximal
mapped memory size).
* doc/gdbm.texinfo: Document GDBM_SETMAXMAPSIZE.
2011-08-09 Sergey Poznyakoff
Update the docs.
* doc/gdbm.texinfo: Document compatibility functions,
provide more cross-references.
2011-08-09 Sergey Poznyakoff
Implement dbm_error and dbm_clearerr.
* compat/ndbm.h (__gdbm_error_to_ndbm): New macro
(dbm_error,dbm_clearerr): Provide prototypes instead of
the macros.
(DBM) <_dbm_errno>: New member.
* compat/dbmerr.c: New file.
* compat/Makefile.am (NDBM_CF): Add dbmerr.c
* compat/dbmdelete.c: Make sure _dbm_errno reflects the
actual error state.
* compat/dbmfetch.c: Likewise.
* compat/dbmseq.c: Likewise.
* compat/dbmstore.c: Likewise.
2011-08-08 Sergey Poznyakoff
Provide test group descriptors in the testsuite.
* tests/atlocal.in (XFAILFILE): Remove.
* tests/version.at: Don't create XFAILFILE.
* tests/testsuite.at: Add test group banners
* tests/dbmcreate00.at (AT_SETUP): Change description.
* tests/dbmdel00.at: Likewise.
* tests/dbmdel01.at: Likewise.
* tests/dbmdel02.at: Likewise.
* tests/dbmfetch00.at: Likewise.
* tests/dbmfetch01.at: Likewise.
2011-08-07 Sergey Poznyakoff
* src/testgdbm.c: Change internal command invocation
mechanism: the begin handler (if provided) initializes
the invocation and computes the expected number of
output lines. If it is greater than the screen size
the pager is enabled. End handler (if supplied) cleans
up after the invocation.
Always use error() for diagnostics.
2011-08-06 Sergey Poznyakoff
* doc/Config: New file.
* doc/gendocs_template: Rewrite for the new site layout.
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
Force the use of --enable-libgdbm-compat on distcheck stage.
* compat/ndbm.h (DBM) : New member.
* src/version.c (gdbm_version_cmp): New function.
* compat/dbmclose.c (dbm_close): Close dirfd.
* compat/dbmdirfno.c (dbm_dirfno): Return dirfd.
* compat/dbmopen.c (dbm_open): Instead of linking
pag to dir, create a separate dir file with the version
information in it. When opening an existing db in
write mode, detect if it has pag linked to dir. If so,
break the link and recreate the dir file in new format.
This allows GDBM to cooperate with the applications which
lock both pag and dir files.
* doc/gdbm.texinfo: Document gdbm_version_cmp.
* NEWS: Update.
2011-08-05 Sergey Poznyakoff
* configure.ac: Require latest autotools. Enable silent mode.
* NEWS: Convert to the standard GNU outline format. Add entry
for 1.9.
2011-08-05 Sergey Poznyakoff
* configure.ac: Require latest autotools. Enable silent mode.
* NEWS: Convert to the standard GNU outline format. Add entry
for 1.9.
2011-08-05 Sergey Poznyakoff
* tests/version.at: Update.
* tests/Makefile.am: Define AT_PACKAGE_VERSION_MAJOR,
AT_PACKAGE_VERSION_MINOR, and AT_PACKAGE_VERSION_PATCH.
* src/lock.c: Shut the gcc warning.
* doc/gdbm.texinfo: Minor fixes.
* src/testgdbm.c (error): Bugfix.
2011-08-05 Sergey Poznyakoff
* src/global.c: Remove.
* src/extern.h: Remove.
* src/Makefile.am: Remove extern.h and global.c
* src/flatfile.c: Don't include extern.h
* src/gdbmreorg.c: Likewise.
* src/lock.c: Likewise.
* src/testgdbm.c: Likewise.
* src/gdbmerrno.c (gdbm_errno): New declaration (from
global.c)
* compat/dbm-priv.h: New file.
* compat/dbm.h: New file.
* compat/ndbm.h: New file.
* compat/Makefile.am (include_HEADERS): Add dbm.h and ndbm.h
(noinst_HEADERS): Add dbm-priv.h
* compat/close.c: Rewrite using ndbm interface.
* compat/dbminit.c: Likewise.
* compat/delete.c: Likewise.
* compat/fetch.c: Likewise.
* compat/seq.c: Likewise.
* compat/store.c: Likewise.
* compat/dbmclose.c: Include nbdm.h.
Use the new DBM declaration.
* compat/dbmdelete.c: Likewise.
* compat/dbmdirfno.c: Likewise.
* compat/dbmfetch.c: Likewise.
* compat/dbmopen.c: Likewise.
* compat/dbmpagfno.c: Likewise.
* compat/dbmrdonly.c: Likewise.
* compat/dbmseq.c: Likewise.
* compat/dbmstore.c: Likewise.
* tests/Makefile.am: Add new files.
* tests/atlocal.in: Conditionally define COMPAT.
* tests/create00.at: Update keywords.
* tests/delete00.at: Likewise.
* tests/delete01.at: Likewise.
* tests/delete02.at: Likewise.
* tests/fetch00.at: Likewise.
* tests/fetch01.at: Likewise.
* tests/gtdel.c: Include progname.h instead of declaring
canonical_progname.
* tests/gtdump.c: Likewise.
* tests/gtfetch.c: Likewise.
* tests/gtload.c: Likewise.
* tests/gtver.c: Likewise.
* tests/testsuite.at (AT_COMPAT_PREREQ): New macro.
Add compat test cases.
* tests/dtload.c: New file.
* tests/dtdump.c: New file.
* tests/dtdel.c: New file.
* tests/dbmcreate00.at: New test case.
* tests/dbmfetch00: Likewise.
* tests/dbmfetch01: Likewise.
* tests/dbmdel00.at: Likewise.
* tests/dbmdel01.at: Likewise.
* tests/dbmdel02.at: Likewise.
2011-08-04 Sergey Poznyakoff
* README: Update.
* doc/gdbm.3: Update.
2011-08-03 Sergey Poznyakoff
* tests/gtver.c: New file.
* tests/Makefile.am (check_PROGRAMS): Add gtver.
* tests/.cvsignore: Update.
* tests/version.at: Use gtver instead of testgdbm.
2011-08-03 Sergey Poznyakoff
* src/gdbm.proto: Remove.
* src/gdbm.proto2: Remove.
* src/gdbmerrno.h: Remove.
* src/gdbm.h.in: New file.
* Makefile.am (dist-hook): Remove destination file before
copying over it.
* configure.ac: Define Major,Minor numbers and Patchlevel
separately.
(GDBM_VERSION_MAJOR,GDBM_VERSION_MINOR)
(GDBM_VERSION_PATCH): New substitution variables.
* src/Makefile.am: Remove rules for building gdbm.h.
It is now created by configure.
(noinst_HEADERS): Install gdbm.h
(EXTRA_DIST): Distribute gdbm.h.in.
* src/flatfile.c: Include arpa/inet.h and gdbm.h.
* src/gdbmerrno.c: Include gdbm.h.
* src/version.c: Include gdbm.h.
(gdbm_version_number): New global variable.
* doc/gdbm.texinfo: Document gdbm_version_number and
GDBM_VERSION_* macros.
* src/gdbmopen.c: Remove unused variables, fix format specs.
* src/testgdbm.c: Remove unused variables, fix format specs.
2011-08-03 Sergey Poznyakoff
* Makefile.am (dist-hook): Replace /*@DIST_DATE@*/ with
the actual distribution date.
* src/version.c (gdbm_version): Update automatically.
2011-08-03 Sergey Poznyakoff
* (all files): Update copyright headers.
2011-08-03 Sergey Poznyakoff
* doc/Makefile.am (check-fixmes): New rule.
* doc/gdbm.texinfo: Document flat format and related
functions.
* src/flatfile.c: Minor changes.
* src/gdbmerrno.c (gdbm_errlist): Indicate the size of
array and document its entries to minimize the possibility
of errors when editing it.
* src/gdbmerrno.h (gdbm_errlist): New prototype.
2011-08-03 Sergey Poznyakoff
* src/gdbmdefs.h (struct gdbm_file_info) : Remove
the static qualifier.
2011-08-03 Sergey Poznyakoff
* src/gdbm.proto2: Remove a leftover __P wrapper.
* src/gdbmsetopt.c (gdbm_setopt): Avoid coredumps on NULL
optval.
* doc/.cvsignore: Update.
* doc/Makefile.am: Rewrite.
* doc/gdbm.texinfo: Revise.
* doc/gendocs_template: New file.
* doc/untabify.el: New file.
2011-08-02 Sergey Poznyakoff
* tests/.cvsignore: Update.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Likewise.
* tests/gtdump.c: Minor fix.
* tests/gtfetch.c: Likewise.
* tests/delete00.at: New file.
* tests/delete01.at: New file.
* tests/delete02.at: New file.
* tests/gtdel.c: New file.
* Makefile.am (SUBDIRS): Add tests.
* configure.ac: Initialize testsuite.
* src/testgdbm.c: Minor fixes.
* tests/Makefile.am: New file.
* tests/atlocal.in: New file.
* tests/create00.at: New file.
* tests/fetch00.at: New file.
* tests/fetch01.at: New file.
* tests/gtdump.c: New file.
* tests/gtfetch.c: New file.
* tests/gtload.c: New file.
* tests/num2word.c: New file.
* tests/testsuite.at: New file.
* tests/version.at: New file.
* .cvsignore: Update.
* compat/.cvsignore: Update.
* doc/.cvsignore: Update.
* export/.cvsignore: Update.
* src/.cvsignore: Update.
2011-08-01 Sergey Poznyakoff
* compat/dbminit.c: Remove useless include.
* compat/dbmopen.c: Likewise.
2011-08-01 Sergey Poznyakoff
* src/testgdbm.c (main): Support --help and --version for
the sake of make distcheck.
2011-08-01 Sergey Poznyakoff
* src/gdbm.proto: Remove the legacy __P stuff.
2011-08-01 Sergey Poznyakoff
* Makefile.am (ACLOCAL_AMFLAGS): New variable.
* configure.ac: Use AM_INIT_AUTOMAKE with arguments.
* src/gdbm.proto (GDBM_FILE): Change typedef.
* src/gdbmdefs.h: Include gdbm.h
(datum): Remove duplicate declaration.
(gdbm_file_info): Change to struct gdbm_file_info
* src/proto.h: Use GDBM_FILE instead of gdbm_file_info *.
Remove duplicate declarations.
* src/gdbmopen.c: Use GDBM_FILE instead of gdbm_file_info *.
(gdbm_open): Fix signature to match global declaration.
* compat/dbmclose.c: Use GDBM_FILE instead of gdbm_file_info *.
* compat/dbmdirfno.c: Likewise.
* compat/dbmfetch.c: Likewise.
* compat/dbmopen.c: Likewise.
* compat/dbmpagfno.c: Likewise.
* compat/dbmrdonly.c: Likewise.
* compat/dbmseq.c: Likewise.
* compat/dbmstore.c: Likewise.
* src/bucket.c: Likewise.
* src/extern.h: Likewise.
* src/falloc.c: Likewise.
* src/findkey.c: Likewise.
* src/flatfile.c: Likewise.
* src/gdbmclose.c: Likewise.
* src/gdbmdelete.c: Likewise.
* src/gdbmexists.c: Likewise.
* src/gdbmfdesc.c: Likewise.
* src/gdbmfetch.c: Likewise.
* src/gdbmreorg.c: Likewise.
* src/gdbmseq.c: Likewise.
* src/gdbmsetopt.c: Likewise.
* src/gdbmstore.c: Likewise.
* src/gdbmsync.c: Likewise.
* src/global.c: Likewise.
* src/lock.c: Likewise.
* src/mmap.c: Likewise.
* src/testgdbm.c: Likewise.
* src/update.c: Likewise.
2009-01-03 Sergey Poznyakoff
* configure.ac: Update bug-reporting address.
* doc/gdbm.texinfo: Likewise.
* INSTALL, doc/version.texi: Remove automatically generated files.
Wed Dec 3 19:29:25 PST 2008 Jason Downs (downsj@downsj.com)
* src/lock.c, src/gdbm.proto, src/proto.h: Disabled/removed
gdbm_locked() for now, it's not needed.
Sun Nov 30 16:48:29 PST 2008 Jason Downs (downsj@downsj.com)
* src/lock.c: Check errno to see if a lock failed because it's already
locked. Add external gdbm_locked() routine to return the
status of locking. Move lock type to the dbf.
* src/gdbmdefs.h: Move lock type to the dbf.
* src/gdbm.proto: Add gdbm_export(), gdbm_import(), and gdbm_locked().
2008-11-30 Sergey Poznyakoff
* src/lock.c: Remove flock/flock64 distinction.
Sat Nov 29 23:22:24 PST 2008 Jason Downs (downsj@downsj.com)
* configure.ac: Add test for lockf.
* src/lock.c: New file, adds _gdbm_unlock_file() and
_gdbm_lock_file() routines. These attempt to use flock(),
lockf(), and fcntl() locking.
* src/proto.h: Add new prototypes.
* src/systems.h: Remove file locking macros.
* src/gdbmopen.c: Rewrite locking code, use _gdbm_lock_file().
* src/gdbmclose.c, src/gdbmreorg.c: Use _gdbm_unlock_file().
Sat Nov 29 21:19:32 PST 2008 Jason Downs (downsj@downsj.com)
* configure.ac: Add test for sys/termios.h
* src/systems.h: Add macros for Solaris-style 64bit fcntl locks.
* src/testgdbm.c: Add support for opening files without locking.
Add support for opening files without mmap.
Add sys/termios.h include and add check for TIOCWINSZ.
* export/export.c: Add support for opening files without locking.
Mon Oct 29 15:14:53 EET 2007 Sergey Poznyakoff (gray@gnu.org.ua)
* configure.ac (AC_INIT): Add bug-reporting email.
* gdbm.texinfo: Use values.texi for version and edition number and
date.
Document testgdbm and gdbmexport.
Remove obsolete chapter describing conv2gdbm.
* export/export.c: Fix check for argc.
Take name of the output file from the second argument.
Accept -h and -v command line options.
* src/Makefile.am (noinst_PROGRAMS): move to bin_PROGRAMS.
* src/flatfile.c (gdbm_export): Add missing break.
* src/gdbmreorg.c (gdbm_reorganize): Call _gdbm_mapped_init if
required.
* src/testgdbm.c: Improve usage and version output to comply to
standards.texi.
Allow to operate on non-nul-terminated ascii data:
(key_z, data_z): New variables.
(key_z_handler, data_z_handler, status_handler): New handlers -
commands 'z', 'Z' and 'S'
All functions using key_data and data_data updated accordingly
(read_from_file): 'r' command takes an optional second arg.
(print_cache_handler): Use pager.
(page_data): Ignore pager for non-interactive usage.
Sun Oct 28 15:50:53 PDT 2007 Jason Downs (downsj@downsj.com)
* configure.ac: Add options for gdbmexport.
* export/Makefile.am, export/export.c: New files, stand alone flat
file exporter.
* COPYING, all source files: Update to GPLv3.
* src/Makefile.ac, compat/Makefile.ac: Move gdbm_compat to compat dir.
* compat: New directory, populate with [n]dbm files.
* src/Makefile.ac: Remove getopt.h.
* testgdbm.c, conv2gdbm.c: Remove getopt.h.
* configure.ac: Remove getopt.
* getopt.h, getopt.c: Remove.
Fri Oct 26 07:43:18 PDT 2007 Sergey Poznyakoff (gray@gnu.org.ua)
* src/Makefile.am (noinst_PROGRAMS): Remove testdbm, testndbm,
and conv2gdbm
* src/gdbmreorg.c (gdbm_reorganize): Call _gdbm_mapped_unmap
* src/testgdbm.c: Redo command handling. Expect arguments to
follow the command, otherwise prompt for them.
Thu Oct 25 09:36:51 PDT 2007 Sergey Poznyakoff (gray@gnu.org.ua)
* src, doc: New directories
* *.[ch], gdbm.proto, gdbm.proto2: Move to src
* gdbm.texi, gdbm.3: Move to doc
* configure.in: Rename to configure.ac, switch to deep structure
* build-aux: Auxiliary dir for autoconf stuff
* Makefile.am, src/Makefile.am, doc/Makefile.am: New file
* src/mmap.c (_gdbm_mapped_remap): Bugfix.
* src/testgdbm.c: New commands '<' - read entries from file and store,
and 'l' - list entire database
Tue Oct 23 19:19:36 PDT 2007 Jason Downs (downsj@downsj.com)
* update.c: Force sync if using mmap.
* gdbmclose.c: Unmap file.
* gdbmopen.c: Initialize mmap.
* gdbmdefs.h: Finish adding mmap support.
* Makefile.in: Add mmap.c.
* mmap.c: New mmap() i/o routines, from Sergey Poznyakoff
.
Thu Oct 18 18:16:26 PDT 2007
* gdbmdefs.h: Convert a bunch of flags to bit fields.
* gdbmconst.h, gdbm.proto, gdbm.proto2: Add GDBM_NOMMAP and clean up.
* gdbmerrno.c, gdbmerrno.h: New errnos.
* gdbmconst.h, gdbmdefs.h, gdbmopen.c: Implement new magic number(s).
* bucket.c, falloc.c, findkey.c, gdbmopen.c, gdbmstore.c, update.c:
lseek() becomes __lseek().
* bucket.c, falloc.c, gdbmopen.c, gdbmstore.c, update.c: write()
becomes __write().
* bucket.c, falloc.c, findkey.c, gdbmopen.c: read() becomes __read().
* gdbmclose.c, gdbmopen.c, gdbmreorg.c, gdbmsync.c, update.c: fsync()
becomes __fsync().
* systems.h: New I/O macros.
* Makefile.in: Library version 4, remove BINOWN/BINGRP.
* autoconf.h.in, configure: Regenerate.
* aclocal.m4, config.guess, config.sub, ltmain.sh: Update.
* systems.h, gdbmfetch.c, gdbmopen.c, gdbmseq.c, gdbmstore.c,
findkey.c: Switch to memcpy() and memcmp().
* configure.in: Add mmap() support, sizeof off_t check, remove bcopy.
* proto.h, gdbmopen.c, update.c: Fatal function now takes a
const char *.
* All .h and .c files: ANSI function declarations, remove __P macros.
Also minor style fixes.
Tue Oct 15 15:00:11 PDT 2002 Jason Downs (downsj@downsj.com)
* samp1.cc: Remove.
* gdbm.3, gdbm.texinfo: 1.8.3.
* version.c: Version 1.8.3., modernize string (release date is in
American format).
* gdbmreorg.c: Remove small memory leak.
* Makefile.in: Use more subs from configure, remove mention of SunOS.
Add support for spec'ing an install time prefix via INSTALL_ROOT.
* INSTALL: Remove extra text from top.
* config.guess, config.sub: Update to latest versions.
* autoconf.h.in: Regenerate.
* configure.in: Modernize.
* systems.h: HAVE_ST_BLKSIZE -> HAVE_STRUCT_STAT_ST_BLKSIZE.
Fri Sep 27 16:12:44 PDT 2002 Jason Downs (downsj@downsj.com)
* Makefile.in: Remove `info' target from all, since we don't even
bother installing the one we built anyway.
* Fix a few checks against dbf.read_write.
Wed Sep 25 15:19:00 PDT 2002 Jason Downs (downsj@downsj.com)
* Makefile.in: Remove the dbm and ndbm routines from the main
library, moving them to gdbm_compat. install-compat now
installs the compat headers and the library. Increment the
MAJOR number of the shared library due to the removal of
the compat functions.
* gdbm.3, gdbm.texinfo, version.c: 1.8.1; note gdbm_compat.
* proto.h: Change _gdbm_fatal() to void.
* update.c(_gdbm_fatal): Change function declaration to void.
* update.c(_gdbm_fatal): Change default exit status to 1.
* gdbmopen.c(gdbm_open): Remove setting of flags since we always check
it against the mask.
* testdbm.c, testndbm.c: Added stdlib.h inclusions.
* falloc.c(push_avail_block): Fixed extremely rare case where the
header avail table could fill up, causing us to over flow the
table, corrupting memory, and eventually crashing. Also forced
merging of blocks within the scope of this routine (possibly
should force them whenever the header avail table is being used).
* gdbmerrno.c: Fix error count, there are more than 18.
* gdbmerrno.h: Fix typo; GDBM_OPT_ILLEGAL is 20.
* gdbmopen.c: Fix typo; s/GDBM_OPENMASK/GDBM_WRITER/.
Tue May 18 19:25:25 PDT 1999 Jason Downs (downsj@downsj.com)
* gdbm.3, gdbm.texinfo: Update for 1.8.
* Makefile.in, configure.in: Switch to using libtool, but without
automake.
* aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh: New
files (libtool 1.2).
Wed May 12 01:26:15 PDT 1999 Jason Downs (downsj@downsj.com)
* gdbmopen.c, gdbmclose.c, gdbmreorg.c: check file_locking before
calling locking macros; add support for setting GDBM_NOLOCK in
gdbm_open().
* gdbmdefs.h: add file_locking flag to gdbm_file_info.
* gdbmconst.h, gdbm.proto: add GDBM_NOLOCK flag.
* gdbmfdesc.c: new file, adds external gdbm_fdesc() routine.
* gdbm.proto, gdbm.proto2: clean up, use __P, and compress.
* gdbmerrno.h: kill the enum, add defines for errors.
* gdbmsetopt.c, testgdbm.c: support GDBM_SYNC/GDBM_SYNCMODE.
* gdbmopen.c: gdbm_open() now DEFAULTS to ``fast mode''; use
GDBM_SYNC to turn it off. GDBM_FAST is obsolete and ignored.
* gdbmconst.h: add GDBM_SYNC and GDBM_SYNCMODE.
* proto.h, various source files: switch _ARGS to __P.
* systems.h, various source files: kill word_t, just use int
everywhere.
* configure.in, autoconf.h.in: remove alloca() goo and modernize.
* many source files: replace all instances of alloca() with real
malloc()s and free()s.
* update.c: don't deref NULL in _gdbm_fatal(), and don't use stdio.
[ The following are entries revived from a dead experimental branch. ]
Tue Nov 1 00:35:11 1994 Jason Downs (downsj@downsj.com)
* gdbmopen.c (gdbm_open): actually initialize central_free and
coalesce_blocks.
* gdbmdefs.h: added coalesce_blocks. these should've been bitmapped.
oh well.
* falloc.c (various routines): made block merging an option.
* gdbmsetopt.c (gdbm_setopt): added GDBM_COALESCEBLKS option.
* gdbmconst.h: added GDBM_COALESCEBLKS option.
Fri Jun 3 09:45:19 1994 Jason Downs (downsj@downsj.com)
* falloc.c (_gdbm_free): if central_free is set, all blocks are
put into the header.
* gdbmsetopt.c (gdbm_setopt): add GDBM_CENTFREE case.
* gdbmdefs.h, gdbmconst.h, gdbm.proto: add central free option.
Fri Jun 3 05:57:36 1994 Jason Downs (downsj@downsj.com)
* falloc.c (pop_avail_block): merge block with header, instead
of replace, since header may not be empty any longer.
* falloc.c (_gdbm_alloc): pop a block off the stack when the
current header is half empty, instead of zero.
Fri Jun 3 05:11:33 1994 Jason Downs (downsj@downsj.com)
* gdbmstore.c (gdbm_store): don't alloc new disk if we're replacing
and the records are the same size. suggested by phil a long time
ago.
Fri Jun 3 03:47:46 1994 Jason Downs (downsj@downsj.com)
* falloc.c (_gdbm_put_av_elem): allow adjacent blocks to be
merged. inspired by the enhancement by Tim Howes.
Thu Jun 2 22:15:19 1994 Jason Downs (downsj@downsj.com)
* Makefile.in: add installation mode, owner, and group.
Thu Jun 2 04:24:58 1994 Jason Downs (downsj@downsj.com)
* Makefile.in: run mkinstalldirs before installing files.
* mkinstalldirs: new file.
[ End of revived entries. ]
Thu May 19 15:50:04 1994 Jason Downs (downsj@downsj.com)
* NEWS, README: update to 1.7.3.
* gdbm.texinfo: update to 1.7.3, slight fixes.
* gdbm.3: update to 1.7.3, slight reformat.
Thu May 19 14:45:51 1994 Jason Downs (downsj@downsj.com)
* gdbmconst.h: removed the header magic numbers from this
branch.
* version.c: added an include of autoconf.h, updated version
* gdbm.proto: added a define for GDBM_FASTMODE.
Sun May 15 02:39:48 1994 Jason Downs (downsj@downsj.com)
* gdbm.3, gdbm.texinfo: updates for 1.7.2
* README, NEWS, version.c: update for 1.7.2
* Makefile.in: removed files, changed (drastically) how the
package compiles and installs.
* bytewise.c, bytewise.h: removed from this branch.
Wed Mar 23 00:44:43 1994 Jason Downs (downsj@downsj.com)
* extern.h: removed bogus (old) function declarations.
Mon Mar 14 01:37:09 1994 Jason Downs (downsj@downsj.com)
* Makefile.in: added new files.
* bytewise.c, bytewise.h: new portable byte order conversion
package; supports 64bit longs/16bit ints.
Sun Mar 13 22:56:10 1994 Jason Downs (downsj@downsj.com)
* gdbmsetopt.c, gdbmconst.h: added GDBM_FASTMODE option.
* falloc.c: taught _gdbm_alloc() about the header avail table.
hopefully, this will fix the bloating problem. i dunno, though,
as i've never had that problem, myself.
Sun Dec 26 05:17:04 1993 Jason Downs (downsj@downsj.com)
* version.c: made gdbm_version const.
* gdbmerrno.c: made gdbm_strerror() and it's array const.
* various files: general clean up, reformating of code.
* systems.h: put inside of a conditional.
* configure.in, autoconf.h.in: added check for .
* systems.h: added a default define of SEEK_SET.
* bucket.c, gdbmopen.c, gdbmseq.c, gdbmdelete.c, gdbmdefs.h:
cleaned up some uses of word_t.
Tue Nov 16 03:11:56 1993 Jason Downs (downsj@downsj.com)
* gdbm.3, gdbm.texinfo: updated versions to 1.3 for release
* version.c, README, NEWS: updated versions to 1.7.1 for release
Sun Nov 14 17:21:03 1993 Jason Downs (downsj@downsj.com)
* Makefile.in: added $(srcdir) to a few file references.
Sat Nov 13 13:56:37 1993 Jason Downs (downsj@downsj.com)
* gdbm.3, gdbm.texinfo: added new gdbm_firstkey()/gdbm_nextkey()
documentation.
* gdbmopen.c: added SGI alloca patch.
* Makefile.in: changed installation prefix semantics.
Sat Nov 13 01:52:31 1993 Jason Downs (downsj@downsj.com)
* various source: redid the AIX alloca declaration. any new files
that call alloca will have to start with the same header.
* all source, configure.in, Makefile.in: switched over to using
autoconf.h, rather than packing all of the autoconf defs into
the DEFS line.
* autoconf.h.in: new file.
* Makefile.in: changed rule for tndbm.o, hopefully making it more
portable.
* alloca.c: added inclusion of stdlib.h
Fri Nov 12 13:11:03 1993 Jason Downs (downsj@downsj.com)
* Makefile.in, configure.in: fixed getop related bugs.
* systems.h: moved sys/types.h include to top.
Wed Nov 3 17:18:59 1993 Jason Downs (downsj@downsj.com)
* version.c: changed version to 1.7, for release.
* gdbmdefs.h: Moved all system includes to systems.h.
Sun Oct 31 02:50:12 1993 Jason Downs (downsj@downsj.com)
* version.c: changed version number to 1.7alpha.
* gdbm.texinfo: updated to reflect new routines and changes.
* getopt.c, getopt.h: Added the GNU getopt.c to the dist, for
compilation of testgdbm and conv2gdbm on machines without getopt().
* various source files: changed all appropiate occurances of 'long'
to type 'off_t'. Added off_t check to configure.in.
* gdbm.3: updated to reflect new routines and changes.
Sat Oct 30 05:20:45 1993 Jason Downs (downsj@downsj.com)
* testgdbm.c: Added support for bucket cache and block sizes,
adding -c, -b and -g flags. Must use -g to specify the file
name, now.
* bucket.c, gdbmopen.c, gdbmclose.c, gdbmreorg.c, update.c,
gdbmconst.h, gdbmdefs.h: Implemented dynamic, delayed
initialization, bucket cache. New routine: _gdbm_init_cache().
* proto.h, gdbmerrno.c, gdbmerrno.h: Added gdbm_setopt() errors
and prototypes.
* gdbmsetopt.c: New file, implements the gdbm_setopt() routine.
* testgdbm.c, testndbm.c, testdbm.c, conv2gdbm.c: cleaned up
compiler warnings.
* update.c: repaired declarations and added prototypes for
static routines, repaired declaration of _gdbm_fatal().
* falloc.c: repaired declarations and added prototypes for
static routines.
* gdbmstore.c: commented out unsed variables in gdbm_store().
* proto.h: added prototypes for _gdbm_read_entry(),
_gdbm_find_key(), and gdbm_sync().
* bucket.c, proto.h: changed _gdbm_get_bucket() and
_gdbm_write_bucket() over to type void.
Sat Oct 30 00:56:24 1993 Jason Downs (downsj@downsj.com)
* gdbmerrno.c, gdbmexists.c, close.c, dbmrdonly.c: New files,
adding the routines gdbm_strerror(), gdbm_exists(), and for
better compatibility with the old dbm/ndbm libraries, the
dbmclose() and dbm_rdonly() routines.
* various headers: Added prototypes for the new routines, and
rearranged how gdbm.h is generated.
Fri Oct 29 07:02:41 1993 Jason Downs (downsj@downsj.com)
* README: split into README, INSTALL, and NEWS. INSTALL
includes more tips on compiling. NEWS contains the 'short form'
ChangeLog.
* Makefile.in, configure.in: Redid parts of the autoconf
stuff, and repaired many bugs.
* systems.h: Repaired the alloca declarations, among other
things.
* various source files: changed all relevant usage of type
'long' to type 'word_t', which will always be 32bits wide.
'word_t' is defined in systems.h.
Fri Jul 30 13:27:24 1993 Phil Nelson (phil@cs.wwu.edu)
* findkey.c: Added a check of elem_loc == -1 in determining if
the data cache held the item being looked for.
Tue Jul 20 13:08:47 1993 Phil Nelson (phil at cs.wwu.edu)
* gdbm.texinfo: Fixed some errors.
* Makefile.in: Fixed some errors.
* version.c: Set version to 1.6 for release.
Mon Jul 19 15:02:40 1993 Phil Nelson (phil at cs.wwu.edu)
* COPYING: Replaced Version 1 with Version 2. Also updated
all file notices to refer to version 2.
* gdbm.texinfo: Updated the documentation.
* README: Updated to current version.
* Makefile: updated clean and install.
Wed Jul 14 13:37:44 1993 Phil Nelson (phil at cs.wwu.edu)
* Makfile.in: Added samp1.cc to the list of distributed files.
Sat Jun 5 21:35:59 1993 Phil Nelson (phil at cs.wwu.edu)
* gdbm.proto, Makefile.in: Added #ifndef _GDBM_H_ protection
for the final gdbm.h file. Also added prototypes and C++
support.
* gdbmseq.c: Added gdbm_errno initialization to gdbm_nextkey.
* gdbmerrno.h and others: Moved the extern definition of
gdbm_erron to gdbmerrno.h from the other files.
Mon May 17 12:32:02 1993 Phil Nelson (phil at cs.wwu.edu)
* gdbm.proto: Added GDBM_FAST to the read_write flags.
Sun May 16 12:50:01 1993 Phil Nelson (phil at cs.wwu.edu)
* configure.in, Makefile.in: Added autoconf configuration
to gdbm.
Tue Mar 30 00:08:48 1993 Phil Nelson (phil at cs.wwu.edu)
* global.c: Set gdbm_errno to GDBM_NO_ERROR to force
it into the data segment.
Sun Mar 28 22:51:40 1993 Phil Nelson (phil at cs.wwu.edu)
* gdbmfetch.c: Set return_val.dsize to 0 as a default return
value. (I was told that was more compatible with dbm/ndbm.)
* gdbmopen.c: Changed a "sizeof(int)" to "sizeof(long)".
* testgdbm.c: Changed "char opt" to "int opt" to make sure
opt can be -1.
* hash.c: Added "unsigned" to declaration of value for
better overflow operation.
* gdbmreorg.c: Added a free for data.dptr in the main loop.
Also changed the malloc for new_name to an alloca.
Removed all frees on new_name.
Sat Mar 27 23:25:14 1993 Phil Nelson (phil at cs.wwu.edu)
* gdbmconst.h, gdbmdefs.h, gdbmopen.c, gdbmreorg.c,
testgdbm.c, update.c, gdbm.h: Added code to allow for a
GDBM_FAST mode in which fsync is not called during
database update mode. Added a new flag "-f" to
testgdbm to make use of the new fast mode.
* gdbmsync.c: Added this function to allow a programmer
to use the GDBM_FAST mode but still be able to sync
a database.
* gdbmopen.c, gdbmdelete.c, gdbmfetch.c, gdbmseq.c, gdbmstore.c,
gdbmreorg.c: Added initialization of gdbm_errno to GDBM_NO_ERROR.
Mon Mar 22 23:03:36 1993 Phil Nelson (phil at cs.wwu.edu)
* gdbmclose.c: (gdbmclose) Added a fsync before close to make
sure the file is written to disk before continuing.
Sun Mar 21 21:33:31 1993 Phil Nelson (phil at cs.wwu.edu)
* proto.h: Added this as a new file. It adds ANSI prototypes
for ANSI compilers.
* gdbmdefs.h: Added an include of proto.h.
* Makefile: Added proper references to proto.h
* gdbmopen.c: Changed (int *) casts to (long *) and added
an initialization to dbf->header.
* gdbmreorg.c: Added an "end update" on the new database and
correctly set up the bucket cache.
* update.c: (_gdbm_end_update) Added type void to header.
Wed Mar 17 19:14:27 1993 Phil Nelson (phil at cs.wwu.edu)
* Changed copyright on all files to include 1993. Also deleted
all references to my phone number.
Thu Feb 28 17:05:09 1991 Phil Nelson (phil at strawberry.cs.wwu.edu)
* Added 1991 to copyright lines on all files.
* gdbmfetch.c: Fixed a bug introduced by previous changes.
* version.c: Updated version to 1.5.
Fri Feb 8 12:27:13 1991 Phil Nelson (phil at strawberry.cs.wwu.edu)
* Change author's e-mail address in all comments.
* gdbmopen.c, systems.h: Changed opening sequence so that a
database will not be truncated in NEWDB mode until the
write has locked the file.
* testgdbm.c: Fixed a bug that caused a segmentation fault on
one computer. Also added the flags "-r" for opening the
database as a READER and "-n" for opening the database as
a NEWDB writer. The default mode remains the WRCREAT mode.
* Various source files, changed the data types of various
variables from int to long. This should not make any difference
to systems where sizeof(int) = sizeof(long). It should make
it easier to move to other systems.
* gdbmstore.c: Added a check for NULL key or content dptr. Due to
NULLs being used as error indications, data cannot be NULL also.
* gdbmfetch.c, gdbmseq.c, fetch.c: Added checks for zero sized
key and content so malloc will not try to allocate zero bytes.
* gdbmconst.h: Added this file so that all constants are in one
central place. A few constants can be changed without changing
the header sizes.
Tue Aug 14 13:08:43 1990 Phil Nelson (phil at unicorn.wwu.edu)
* Version 1.4 released. (version.c: Updated to correct version.)
* Makefile: Added $(LIBS) to link for conv2gdbm.
* README: Updated to version 1.4 and added a 1.0-1.4 change
statement.
Wed Aug 8 16:57:29 1990 Phil Nelson (phil at unicorn.wwu.edu)
* gdbmopen.c: Restructured some code to initialize dbf
more completely.
* dbm.h: Added a null define to satisfy some versions that
require a dbmclose() call.
* findkey.c: (_gdbm_findkey) Added a check for the NULL
pointer in ...ca_data.dptr.
* gdbmdelete.c: Added code to more completely remove the
cache entry for a deleted item.
* gdbmreorg.c: Added code to finish the transfer of information
from the new_dbf to the orginal dbf.
Fri May 30 08:29:16 1990 Phil Nelson (phil at unicorn.wwu.edu)
* gdbmstore.c: Changed a strncpy to bcopy.
Tue May 15 09:55:21 1990 Phil Nelson (phil at unicorn.wwu.edu)
* Version 1.3 released.
* systems.h: Changed the defines for alloca to use the
name builtin_alloca to depend on BUILTIN_ALLOCA instead
of __GNUC__. Added a definition of BUILTIN_ALLOCA for
GNUC and for sun sparc.
Fri May 11 12:15:56 1990 Phil Nelson (phil at unicorn.wwu.edu)
* systems.h: Removed the include for and now
systems.h requires included before it.
* Makefile: Corrected the makefile to include a file that
was missing before. Also, switched order of conv2gdbm
and alldbm in the all option.
* findkey.c (_gdbm_read_entry): Reordered some statements
to make the code more readable.
* update.c (_gdbm_fatal): Changed fatal message from "dbm fatal:"
to "gdbm fatal:".
Mon Apr 30 10:18:24 1990 Phil Nelson (phil at unicorn.wwu.edu)
* Version 1.2 released.
Fri Apr 27 09:49:59 1990 Phil Nelson (phil at unicorn.wwu.edu)
* Makefile: Added the dist option. Similar to the
addition from hack@ai.mit.edu, but correct.
* falloc.c (push_avail_block): Change the avail count
to reflect the correct number of entries.
* dbminit.c (dbminit): Changed the stat call to stat the
".dir" file as is done in dbmopen.c (dbm_open).
Tue Apr 10 12:18:40 1990 Phil Nelson (phil at unicorn.wwu.edu)
* Version 1.1. released.
* gdbmopen.c (gdbm_open): Clear out bucket cache.
Local Variables:
mode: change-log
version-control: never
buffer-read-only: t
End:
gdbm-1.18.1/README 0000644 0001750 0001750 00000007066 13302023253 010316 0000000 0000000 GNU dbm README
See the end of file for copying conditions.
* Introduction
This file contains brief information about configuring, testing
and using GNU dbm. It is *not* intended as a replacement
for the documentation, instead it is provided as a brief reference
only. The complete documentation is available in doc/ subdirectory.
To read the manpage without installing the package use `man
doc/gdbm.3'. To read texinfo documentation without installing the
package, run `info -f doc/gdbm.info'. After the package is installed
the documentation can be accessed by running `man gdbm' and
`info gdbm'.
* Overview
GNU dbm is a set of database routines that use extendible hashing and
works similar to the standard UNIX dbm routines. The library provides
also an optional compatibility layer for UNIX-like dbm and ndbm calls.
* Configuration
a) configure [PARAMETERS]
b) make
For a list of generic PARAMETERS, see the file INCLUDE. The gdbm-specific
parameters are:
** --enable-memory-mapped-io
Enable the use of mmap(2) for I/O optimizations. This is the default,
if mmap is available. To disable mmap, use --disable-memory-mapped-io.
** --enable-libgdbm-compat
Build and install libgdbm_compat, a compatibility layer which provides
UNIX-like dbm and ndbm interfaces. It includes two header files:
dbm.h and ndbm.h, which are installed into $includedir. If you wish
to install them elsewhere, define the variable COMPATINCLUDEDIR, e.g.
./configure --enable-libgdbm-compat COMPATINCLUDEDIR=/usr/include/gdbm
** --without-readline
Don't compile GNU Readline support. By default, configure enables
line-editing support if GNU Readline is available on the system.
** --enable-gdbmtool-debug
This option instruments gdbmtool for additional debugging. Configured
with this option, gdbmtool accepts two additional arguments:
--lex-trace, which enables tracing the operation of the lexical
analyzer, and --gram-trace, which enables parser tracing output.
Note, that bison and flex must be installed for this option to take effect,
* Installation
make install
This package also contains the 'magic' file for the file(1) utility -
src/gdbm.magic. It is not installed by default, as its installation
location differs considerably between various distributions. The most
straightforward (but not the best one) approach is appending its
content to /etc/magic:
cat src/gdbm.magic >> /etc/magic
See the documentation in your distribution for detailed instructions
on how to install this file.
* Bug reporting
Please report bugs to
* Documentation, updates etc.
For the latest updates, visit ,
In particular, a copy of GDBM documentation in various formats is
available online at .
Latest versions of GDBM can be downloaded from anonymous
ftp://ftp.gnu.org/gnu/gdbm.
To track the development, visit
.
* Copyright information:
Copyright (C) 2011, 2016-2018 Free Software Foundation, Inc.
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
copyright notice and this permission notice are preserved,
thus giving the recipient permission to redistribute in turn.
Permission is granted to distribute modified versions
of this document, or of portions of it,
under the above conditions, provided also that they
carry prominent notices stating who last changed them.
Local Variables:
mode: outline
paragraph-separate: "[ ]*$"
version-control: never
End:
gdbm-1.18.1/compat/ 0000755 0001750 0001750 00000000000 13364776741 011021 5 0000000 0000000 gdbm-1.18.1/compat/delete.c 0000644 0001750 0001750 00000002115 13237505627 012336 0000000 0000000 /* delete.c - Remove the key and its associated data from the database.
This is the original unix interface name. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2017-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "dbm-priv.h"
/* Remove the KEYed item and the KEY from the database. */
int
delete (datum key)
{
return dbm_delete (_gdbm_file, key);
}
gdbm-1.18.1/compat/dbmseq.c 0000644 0001750 0001750 00000004045 13237505627 012353 0000000 0000000 /* dbmseq.c - Visit all elements in the database. This is the NDBM
interface. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2017-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "ndbm.h"
#include "gdbmdefs.h"
/* NDBM Start the visit of all keys in the database. This produces
something in hash order, not in any sorted order. DBF is the dbm file
information pointer. */
datum
dbm_firstkey (DBM *dbm)
{
datum ret_val;
/* Free previous dynamic memory, do actual call, and save pointer to new
memory. */
ret_val = gdbm_firstkey (dbm->file);
if (dbm->_dbm_memory.dptr != NULL)
free (dbm->_dbm_memory.dptr);
dbm->_dbm_memory = ret_val;
__gdbm_error_to_ndbm (dbm);
/* Return the new value. */
return ret_val;
}
/* NDBM Continue visiting all keys. The next key in the sequence is returned.
DBF is the file information pointer. */
datum
dbm_nextkey (DBM *dbm)
{
datum ret_val;
/* Make sure we have a valid key. */
if (dbm->_dbm_memory.dptr == NULL)
return dbm->_dbm_memory;
/* Call gdbm nextkey with the old value. After that, free the old value. */
ret_val = gdbm_nextkey (dbm->file, dbm->_dbm_memory);
if (dbm->_dbm_memory.dptr != NULL)
free (dbm->_dbm_memory.dptr);
dbm->_dbm_memory = ret_val;
__gdbm_error_to_ndbm (dbm);
/* Return the new value. */
return ret_val;
}
gdbm-1.18.1/compat/dbm.h 0000644 0001750 0001750 00000002606 13237505627 011650 0000000 0000000 /* dbm.h - The include file for dbm users. */
/* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson.
Copyright (C) 1990-2011, 2017-2018 Free Software Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see .
You may contact the author by:
e-mail: phil@cs.wwu.edu
us-mail: Philip A. Nelson
Computer Science Department
Western Washington University
Bellingham, WA 98226
*************************************************************************/
#include
/* These are the routines in dbm. */
extern int dbminit (char *file);
extern datum fetch (datum key);
extern int store (datum key, datum content);
extern int delete (datum key);
extern datum firstkey (void);
extern datum nextkey (datum key);
extern int dbmclose (void);
gdbm-1.18.1/compat/seq.c 0000644 0001750 0001750 00000002466 13237505627 011675 0000000 0000000 /* seq.c - This is the sequential visit of the database. This defines two
user-visable routines that are used together. This is the DBM interface. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2017-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "dbm-priv.h"
/* Start the visit of all keys in the database. This produces something in
hash order, not in any sorted order. */
datum
firstkey (void)
{
return dbm_firstkey (_gdbm_file);
}
/* Continue visiting all keys. The next key following KEY is returned. */
datum
nextkey (datum key)
{
return dbm_nextkey (_gdbm_file);
}
gdbm-1.18.1/compat/dbmdirfno.c 0000644 0001750 0001750 00000002157 13237505627 013046 0000000 0000000 /* dbmdirfno.c - The .dir file number for NDBM interface. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2013, 2017-2018 Free
Software Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "ndbm.h"
#include "gdbmdefs.h"
/* Return the file number of the DBF file. NDBM original wanted the .dir
file number. Since we have only one file number, we return it. */
int
dbm_dirfno (DBM *dbm)
{
return dbm->dirfd;
}
gdbm-1.18.1/compat/Makefile.am 0000644 0001750 0001750 00000002565 13237505627 012775 0000000 0000000 # This file is part of GDBM. -*- Makefile -*-
# Copyright (C) 2007, 2011, 2014, 2017-2018 Free Software Foundation,
# Inc.
#
# GDBM is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GDBM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GDBM. If not, see . */
# Flags
AM_CPPFLAGS=-I$(srcdir)/../src -I../src
# The libraries
VI_CURRENT = 4
VI_REVISION = 0
VI_AGE = 0
lib_LTLIBRARIES = libgdbm_compat.la
libgdbm_compat_la_LIBADD = ../src/libgdbm.la
compatincludedir=$(COMPATINCLUDEDIR)
compatinclude_HEADERS = dbm.h ndbm.h
noinst_HEADERS = dbm-priv.h
DBM_CF=\
dbminit.c\
delete.c\
fetch.c\
store.c\
seq.c\
close.c
NDBM_CF=\
dbmopen.c\
dbmdelete.c\
dbmerr.c\
dbmfetch.c\
dbmstore.c\
dbmseq.c\
dbmclose.c\
dbmdirfno.c\
dbmpagfno.c\
dbmrdonly.c
libgdbm_compat_la_SOURCES = $(DBM_CF) $(NDBM_CF)
libgdbm_compat_la_LDFLAGS = -version-info $(VI_CURRENT):$(VI_REVISION):$(VI_AGE)
gdbm-1.18.1/compat/dbmdelete.c 0000644 0001750 0001750 00000002222 13237505627 013020 0000000 0000000 /* dbmdelete.c - Remove the key and its associated data from the database.
This is the NDBM unix interface name. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2017-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "ndbm.h"
/* Remove the KEYed item and the KEY from the database DBF. */
int
dbm_delete (DBM *dbm, datum key)
{
int rc = gdbm_delete (dbm->file, key);
if (rc)
__gdbm_error_to_ndbm (dbm);
return rc;
}
gdbm-1.18.1/compat/store.c 0000644 0001750 0001750 00000002257 13237505627 012237 0000000 0000000 /* store.c - Add a new key/data pair to the database. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2017-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "dbm-priv.h"
/* Add a new element to the database. CONTENT is keyed by KEY. The file on
disk is updated to reflect the structure of the new database before
returning from this procedure. */
int
store (datum key, datum content)
{
return dbm_store (_gdbm_file, key, content, DBM_REPLACE);
}
gdbm-1.18.1/compat/dbm-priv.h 0000644 0001750 0001750 00000001506 13237505627 012624 0000000 0000000 /* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2017-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
#include "dbm.h"
#include "ndbm.h"
#include "gdbmdefs.h"
extern DBM *_gdbm_file;
gdbm-1.18.1/compat/dbmrdonly.c 0000644 0001750 0001750 00000002077 13237505627 013075 0000000 0000000 /* dbmrdonly.c - Check to see if a database is read only, NDBM style. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1993, 2007, 2011, 2017-2018 Free Software Foundation,
Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "ndbm.h"
#include "gdbmdefs.h"
/* not much of a routine, but should be a function for compatibility. */
int
dbm_rdonly (DBM *dbm)
{
return (dbm->file->read_write == GDBM_READER);
}
gdbm-1.18.1/compat/dbmstore.c 0000644 0001750 0001750 00000002410 13237505627 012711 0000000 0000000 /* dbmstore.c - Add a new key/data pair to the database. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2017-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "ndbm.h"
#include "gdbmdefs.h"
/* NDBM add a new element to the database. CONTENT is keyed by KEY.
The file on disk is updated to reflect the structure of the new
database before returning from this procedure. */
int
dbm_store (DBM *dbm, datum key, datum content, int flags)
{
int rc = gdbm_store (dbm->file, key, content, flags);
__gdbm_error_to_ndbm (dbm);
return rc;
}
gdbm-1.18.1/compat/fetch.c 0000644 0001750 0001750 00000002272 13237505627 012171 0000000 0000000 /* fetch.c - Find a key and return the associated data. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2017-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "dbm-priv.h"
/* Look up a given KEY and return the information associated with that KEY.
The pointer in the structure that is returned is a pointer to dynamically
allocated memory block. This DBM interface uses the NDBM interface. */
datum
fetch (datum key)
{
return dbm_fetch (_gdbm_file, key);
}
gdbm-1.18.1/compat/dbmerr.c 0000644 0001750 0001750 00000001676 13237505627 012362 0000000 0000000 /* This file is part of GDBM, the GNU data base manager.
Copyright (C) 2011, 2017-2018 Free Software Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "ndbm.h"
#include "gdbmdefs.h"
int
dbm_error (DBM *dbf)
{
return dbf->_dbm_errno;
}
void
dbm_clearerr (DBM *dbf)
{
dbf->_dbm_errno = 0;
}
gdbm-1.18.1/compat/ndbm.h 0000644 0001750 0001750 00000004626 13237505627 012032 0000000 0000000 /* ndbm.h - The include file for ndbm users. */
/* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson.
Copyright (C) 1990-2011, 2017-2018 Free Software Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see .
You may contact the author by:
e-mail: phil@cs.wwu.edu
us-mail: Philip A. Nelson
Computer Science Department
Western Washington University
Bellingham, WA 98226
*************************************************************************/
#include
/* Parameters to dbm_store for simple insertion or replacement. */
#define DBM_INSERT GDBM_INSERT
#define DBM_REPLACE GDBM_REPLACE
/* The file information header. */
typedef struct
{
GDBM_FILE file; /* Actual gdbm file (held in the .pag file */
int dirfd; /* Descriptor of the .dir file */
datum _dbm_memory; /* Keeps the last returned key */
char *_dbm_fetch_val; /* Keeps the dptr of the last fetched datum */
gdbm_error _dbm_errno; /* Error code from the last failed call */
} DBM;
/* Used internally by the library */
#define __gdbm_error_to_ndbm(dbm) \
do \
{ \
if (gdbm_errno && gdbm_errno != GDBM_ITEM_NOT_FOUND) \
(dbm)->_dbm_errno = gdbm_errno; \
} \
while (0)
/* These are the routines */
extern DBM *dbm_open (char *file, int flags, int mode);
extern void dbm_close (DBM *dbf);
extern datum dbm_fetch (DBM *dbf, datum key);
extern int dbm_store (DBM *dbf, datum key, datum content, int flags);
extern int dbm_delete (DBM *dbf, datum key);
extern datum dbm_firstkey (DBM *dbf);
extern datum dbm_nextkey (DBM *dbf);
extern int dbm_error (DBM *dbf);
extern void dbm_clearerr (DBM *dbf);
extern int dbm_dirfno (DBM *dbf);
extern int dbm_pagfno (DBM *dbf);
extern int dbm_rdonly (DBM *dbf);
gdbm-1.18.1/compat/Makefile.in 0000644 0001750 0001750 00000061115 13364776062 013006 0000000 0000000 # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# This file is part of GDBM. -*- Makefile -*-
# Copyright (C) 2007, 2011, 2014, 2017-2018 Free Software Foundation,
# Inc.
#
# GDBM is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GDBM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GDBM. If not, see . */
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = compat
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(compatinclude_HEADERS) \
$(noinst_HEADERS) $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/autoconf.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(libdir)" \
"$(DESTDIR)$(compatincludedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libgdbm_compat_la_DEPENDENCIES = ../src/libgdbm.la
am__objects_1 = dbminit.lo delete.lo fetch.lo store.lo seq.lo close.lo
am__objects_2 = dbmopen.lo dbmdelete.lo dbmerr.lo dbmfetch.lo \
dbmstore.lo dbmseq.lo dbmclose.lo dbmdirfno.lo dbmpagfno.lo \
dbmrdonly.lo
am_libgdbm_compat_la_OBJECTS = $(am__objects_1) $(am__objects_2)
libgdbm_compat_la_OBJECTS = $(am_libgdbm_compat_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
libgdbm_compat_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(AM_CFLAGS) $(CFLAGS) $(libgdbm_compat_la_LDFLAGS) $(LDFLAGS) \
-o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libgdbm_compat_la_SOURCES)
DIST_SOURCES = $(libgdbm_compat_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(compatinclude_HEADERS) $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOM4TE = @AUTOM4TE@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE64_BIN = @BASE64_BIN@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPATINCLUDEDIR = @COMPATINCLUDEDIR@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CURSES_LIBS = @CURSES_LIBS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GDBM_COUNT_T = @GDBM_COUNT_T@
GDBM_DEBUG_ENABLE = @GDBM_DEBUG_ENABLE@
GDBM_VERSION_MAJOR = @GDBM_VERSION_MAJOR@
GDBM_VERSION_MINOR = @GDBM_VERSION_MINOR@
GDBM_VERSION_PATCH = @GDBM_VERSION_PATCH@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
GZIP_BIN = @GZIP_BIN@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LFLAGS_DEBUG = @LFLAGS_DEBUG@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POSUB = @POSUB@
RANLIB = @RANLIB@
READLINE_LIBS = @READLINE_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
YACC = @YACC@
YFLAGS = @YFLAGS@
YFLAGS_DEBUG = @YFLAGS_DEBUG@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
# Flags
AM_CPPFLAGS = -I$(srcdir)/../src -I../src
# The libraries
VI_CURRENT = 4
VI_REVISION = 0
VI_AGE = 0
lib_LTLIBRARIES = libgdbm_compat.la
libgdbm_compat_la_LIBADD = ../src/libgdbm.la
compatincludedir = $(COMPATINCLUDEDIR)
compatinclude_HEADERS = dbm.h ndbm.h
noinst_HEADERS = dbm-priv.h
DBM_CF = \
dbminit.c\
delete.c\
fetch.c\
store.c\
seq.c\
close.c
NDBM_CF = \
dbmopen.c\
dbmdelete.c\
dbmerr.c\
dbmfetch.c\
dbmstore.c\
dbmseq.c\
dbmclose.c\
dbmdirfno.c\
dbmpagfno.c\
dbmrdonly.c
libgdbm_compat_la_SOURCES = $(DBM_CF) $(NDBM_CF)
libgdbm_compat_la_LDFLAGS = -version-info $(VI_CURRENT):$(VI_REVISION):$(VI_AGE)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits compat/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnits compat/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libgdbm_compat.la: $(libgdbm_compat_la_OBJECTS) $(libgdbm_compat_la_DEPENDENCIES) $(EXTRA_libgdbm_compat_la_DEPENDENCIES)
$(AM_V_CCLD)$(libgdbm_compat_la_LINK) -rpath $(libdir) $(libgdbm_compat_la_OBJECTS) $(libgdbm_compat_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmclose.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmdelete.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmdirfno.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmerr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmfetch.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbminit.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmopen.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmpagfno.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmrdonly.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmseq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbmstore.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fetch.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/store.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-compatincludeHEADERS: $(compatinclude_HEADERS)
@$(NORMAL_INSTALL)
@list='$(compatinclude_HEADERS)'; test -n "$(compatincludedir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(compatincludedir)'"; \
$(MKDIR_P) "$(DESTDIR)$(compatincludedir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(compatincludedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(compatincludedir)" || exit $$?; \
done
uninstall-compatincludeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(compatinclude_HEADERS)'; test -n "$(compatincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(compatincludedir)'; $(am__uninstall_files_from_dir)
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(compatincludedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-compatincludeHEADERS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-libLTLIBRARIES
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-compatincludeHEADERS uninstall-libLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am \
install-compatincludeHEADERS install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-libLTLIBRARIES install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am \
uninstall-compatincludeHEADERS uninstall-libLTLIBRARIES
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
gdbm-1.18.1/compat/dbmfetch.c 0000644 0001750 0001750 00000002767 13237505627 012665 0000000 0000000 /* dbmfetch.c - Find a key and return the associated data. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2017-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "ndbm.h"
#include "gdbmdefs.h"
/* NDBM Look up a given KEY and return the information associated with that
KEY. The pointer in the structure that is returned is a pointer to
dynamically allocated memory block. */
datum
dbm_fetch (DBM *dbm, datum key)
{
datum ret_val; /* The return value. */
/* Free previous dynamic memory, do actual call, and save pointer to new
memory. */
ret_val = gdbm_fetch (dbm->file, key);
if (dbm->_dbm_fetch_val != NULL)
free (dbm->_dbm_fetch_val);
dbm->_dbm_fetch_val = ret_val.dptr;
__gdbm_error_to_ndbm (dbm);
/* Return the new value. */
return ret_val;
}
gdbm-1.18.1/compat/dbminit.c 0000644 0001750 0001750 00000004057 13237505627 012531 0000000 0000000 /* dbminit.c - Open the file for dbm operations. This looks like the
DBM interface. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2016-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "dbm-priv.h"
DBM *_gdbm_file;
/* Initialize dbm system. FILE is a pointer to the file name. In
standard dbm, the database is found in files called FILE.pag and
FILE.dir. To make gdbm compatable with dbm using the dbminit call,
the same file names are used. Specifically, dbminit will use the file
name FILE.pag in its call to gdbm open. If the file (FILE.pag) has a
size of zero bytes, a file initialization procedure is performed,
setting up the initial structure in the file. Any error detected will
cause a return value of -1. No errors cause the return value of 0.
NOTE: file.dir will be linked to file.pag. */
int
dbminit (char *file)
{
if (_gdbm_file != NULL)
dbm_close (_gdbm_file);
/* Try to open the file as a writer. DBM never created a file. */
_gdbm_file = dbm_open (file, O_RDWR, 0644);
/* If it was not opened, try opening it as a reader. */
if (_gdbm_file == NULL)
{
_gdbm_file = dbm_open (file, O_RDONLY, 0644);
/* Did we successfully open the file? */
if (_gdbm_file == NULL)
{
gdbm_set_errno (NULL, GDBM_FILE_OPEN_ERROR, TRUE);
return -1;
}
}
return 0;
}
gdbm-1.18.1/compat/dbmpagfno.c 0000644 0001750 0001750 00000002156 13237505627 013036 0000000 0000000 /* dbmpagfno.c - The .pag file number for NDBM interface. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2017-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "ndbm.h"
#include "gdbmdefs.h"
/* Return the file number of the DBF file. NDBM original wanted the .pag
file number. Since we have only one file number, we return it. */
int
dbm_pagfno (DBM *dbm)
{
return dbm->file->desc;
}
gdbm-1.18.1/compat/close.c 0000644 0001750 0001750 00000002155 13237505627 012205 0000000 0000000 /* close.c - Close the "original" style database. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1993, 2007, 2011, 2017-2018 Free Software Foundation,
Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "dbm-priv.h"
/* It's unclear whether dbmclose() is *always* a void function in old
C libraries. We use int, here. */
int
dbmclose ()
{
if (_gdbm_file != NULL)
{
dbm_close (_gdbm_file);
_gdbm_file = NULL;
}
return (0);
}
gdbm-1.18.1/compat/dbmopen.c 0000644 0001750 0001750 00000016414 13342145156 012521 0000000 0000000 /* dbmopen.c - Open the file for dbm operations. This looks like the
NDBM interface for dbm use. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2016-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "ndbm.h"
#include "gdbmdefs.h"
#include
#include
#include
#define DIRSUF ".dir"
/* dir file structure:
GDBM_DIR_MAGIC 4 bytes
GDBM_VERSION_MAJOR 4 bytes
GDBM_VERSION_MINOR 4 bytes
GDBM_VERSION_PATCH 4 bytes
Total length: 16 bytes
*/
#define GDBM_DIR_MAGIC 0x4744424d /* GDBM */
#define DEF_DIR_SIZE 16
static unsigned
getint (const unsigned char *cp)
{
return (cp[0] << 24) + (cp[1] << 16) + (cp[2] << 8) + cp[3];
}
static void
putint (unsigned char *cp, unsigned n)
{
cp[0] = (n >> 24) & 0xff;
cp[1] = (n >> 16) & 0xff;
cp[2] = (n >> 8) & 0xff;
cp[3] = n & 0xff;
}
/* FIXME: revise return codes */
static int
ndbm_open_dir_file0 (const char *file_name, int pagfd, int mode)
{
int fd = -1;
struct stat st, pagst;
unsigned char dirbuf[DEF_DIR_SIZE];
int flags = (mode & GDBM_OPENMASK) == GDBM_READER ?
O_RDONLY : O_RDWR;
if (mode & GDBM_CLOEXEC)
flags |= O_CLOEXEC;
if (fstat (pagfd, &pagst))
{
gdbm_set_errno (NULL, GDBM_FILE_OPEN_ERROR, TRUE); /* FIXME: special code? */
return -1;
}
/* Previous versions of GDBM linked pag to dir. Try to detect this: */
if (stat (file_name, &st) == 0)
{
if (st.st_nlink >= 2)
{
if (st.st_dev == pagst.st_dev && st.st_ino == pagst.st_ino)
{
if (unlink (file_name))
{
if ((mode & GDBM_OPENMASK) == GDBM_READER)
/* Ok, try to cope with it. */
return pagfd;
else if (errno != ENOENT)
{
gdbm_set_errno (NULL, GDBM_FILE_OPEN_ERROR, TRUE);
return -1;
}
}
}
else
{
gdbm_set_errno (NULL, GDBM_FILE_OPEN_ERROR, FALSE);
return -1;
}
}
else if (st.st_size == 0)
/* ok */;
else if (st.st_size != DEF_DIR_SIZE)
{
gdbm_set_errno (NULL, GDBM_BAD_MAGIC_NUMBER, FALSE);
return -1;
}
else
{
fd = open (file_name, flags);
if (fd == -1)
{
gdbm_set_errno (NULL, GDBM_FILE_OPEN_ERROR, FALSE);
return fd;
}
if (read (fd, dirbuf, sizeof (dirbuf)) != sizeof (dirbuf))
{
gdbm_set_errno (NULL, GDBM_FILE_OPEN_ERROR, FALSE);
close (fd);
return -1;
}
if (getint (dirbuf) == GDBM_DIR_MAGIC)
{
int v[3];
v[0] = getint (dirbuf + 4);
v[1] = getint (dirbuf + 8);
v[2] = getint (dirbuf + 12);
if (gdbm_version_cmp (v, gdbm_version_number) <= 0)
return fd;
}
close (fd);
gdbm_set_errno (NULL, GDBM_BAD_MAGIC_NUMBER, FALSE);
return -1;
}
}
/* File does not exist. Create it. */
fd = open (file_name, flags | O_CREAT, pagst.st_mode & 0777);
if (fd >= 0)
{
putint (dirbuf, GDBM_DIR_MAGIC);
putint (dirbuf + 4, gdbm_version_number[0]);
putint (dirbuf + 8, gdbm_version_number[1]);
putint (dirbuf + 12, gdbm_version_number[2]);
if (write (fd, dirbuf, sizeof (dirbuf)) != sizeof (dirbuf))
{
gdbm_set_errno (NULL, GDBM_FILE_WRITE_ERROR, FALSE);
close (fd);
fd = -1;
}
}
return fd;
}
static int
ndbm_open_dir_file (const char *base, int pagfd, int mode)
{
char *file_name = malloc (strlen (base) + sizeof (DIRSUF));
int fd;
if (!file_name)
{
gdbm_set_errno (NULL, GDBM_MALLOC_ERROR, FALSE);
return -1;
}
fd = ndbm_open_dir_file0 (strcat (strcpy (file_name, base), DIRSUF),
pagfd, mode);
free (file_name);
return fd;
}
/* Initialize ndbm system. FILE is a pointer to the file name. In
standard dbm, the database is found in files called FILE.pag and
FILE.dir. To make gdbm compatable with dbm using the dbminit call,
the same file names are used. Specifically, dbminit will use the file
name FILE.pag in its call to gdbm open. If the file (FILE.pag) has a
size of zero bytes, a file initialization procedure is performed,
setting up the initial structure in the file. Any error detected will
cause a return value of -1. No errors cause the return value of 0.
The file.dir file is used only to ensure that the corresponding file.pag
was created using a compatible version of GDBM. If file.dir is a hard
link to file.pag, as was in GDBM 1.8.x, it is removed and recreated in
the right format (see above). If the database is being opened read-only,
the file.dir remains untouched.
FLAGS and MODE are the same as for the open(2) call. This call will
look at the FLAGS and decide what call to make to gdbm_open. For
FLAGS == O_RDONLY, it will be a GDBM_READER, if FLAGS == O_RDWR|O_CREAT,
it will be a GDBM_WRCREAT (creater and writer) and if the FLAGS == O_RDWR,
it will be a GDBM_WRITER and if FLAGS contain O_TRUNC then it will be
a GDBM_NEWDB. The O_CLOEXEC bit raises GDBM_CLOEXEC flag.
All other values of FLAGS are ignored. */
DBM *
dbm_open (char *file, int flags, int mode)
{
char *pag_file; /* Used to construct "file.pag". */
DBM *dbm = NULL;
int open_flags;
int f;
/* Prepare the correct name for "file.pag". */
pag_file = (char *) malloc (strlen (file) + 5);
if (!pag_file)
{
gdbm_set_errno (NULL, GDBM_MALLOC_ERROR, FALSE); /* For the hell of it. */
return NULL;
}
strcpy (pag_file, file);
strcat (pag_file, ".pag");
/* Call the actual routine, saving the pointer to the file information. */
f = flags & (O_RDONLY | O_RDWR | O_CREAT | O_TRUNC);
if (f == O_RDONLY)
{
open_flags = GDBM_READER;
mode = 0;
}
else if (f == (O_RDWR | O_CREAT))
{
open_flags = GDBM_WRCREAT;
}
else if ((f & O_TRUNC) == O_TRUNC)
{
open_flags = GDBM_NEWDB;
}
else
{
open_flags = GDBM_WRITER;
mode = 0;
}
if (flags & O_CLOEXEC)
open_flags |= GDBM_CLOEXEC;
open_flags |= GDBM_NOLOCK;
dbm = calloc (1, sizeof (*dbm));
if (!dbm)
{
free (pag_file);
gdbm_set_errno (NULL, GDBM_MALLOC_ERROR, FALSE); /* For the hell of it. */
return NULL;
}
dbm->file = gdbm_open (pag_file, 0, open_flags, mode, NULL);
/* Did we successfully open the file? */
if (dbm->file == NULL)
{
gdbm_set_errno (NULL, GDBM_FILE_OPEN_ERROR, FALSE);
free (dbm);
dbm = NULL;
}
else
{
dbm->dirfd = ndbm_open_dir_file (file, dbm->file->desc, open_flags);
if (dbm->dirfd == -1)
{
gdbm_close (dbm->file);
free (dbm);
dbm = NULL;
}
}
free (pag_file);
return dbm;
}
gdbm-1.18.1/compat/dbmclose.c 0000644 0001750 0001750 00000002233 13237505627 012665 0000000 0000000 /* dbmclose.c - The the dbm file. This is the NDBM interface. */
/* This file is part of GDBM, the GNU data base manager.
Copyright (C) 1990-1991, 1993, 2007, 2011, 2017-2018 Free Software
Foundation, Inc.
GDBM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GDBM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDBM. If not, see . */
/* Include system configuration before all else. */
#include "autoconf.h"
#include "ndbm.h"
#include "gdbmdefs.h"
/* Close the DBF file. */
void
dbm_close (DBM *dbm)
{
gdbm_close (dbm->file);
close (dbm->dirfd);
if (dbm->_dbm_memory.dptr)
free (dbm->_dbm_memory.dptr);
if (dbm->_dbm_fetch_val)
free (dbm->_dbm_fetch_val);
free (dbm);
}
gdbm-1.18.1/README-alpha 0000644 0001750 0001750 00000005030 13237505627 011407 0000000 0000000 This file is part of GDBM.
See end of file for copying conditions.
* Introduction
This is a *pre-release* version, and not ready for production use yet.
If you are taking source from CVS, you will need to have several
special tools to help contribute. See the file README-hacking for more
information. See chapter `Building' for the detailed instructions on
how to build the package.
Please, note that the accompanying documentation may be inaccurate
or incomplete. The ChangeLog file is the authoritative documentation of
all recent changes.
Please, send comments and problem reports to .
* Checking Out the Sources
The following instructions apply if you wish to obtain sources from
the repository. There are several repositories:
1. CVS at Puszcza.gnu.org.ua - master repository
2. Git at Puszcza.gnu.org.ua - slave
3. CVS at Savannah.gnu.org - slave
4. Git at Savannah.gnu.org - slave
Slave repositories are synchronized with the master 8 times a day.
** CVS
To checkout the source tree from CVS issue the following command:
cvs -d:pserver:anonymous@cvs.gnu.org.ua:/cvsroot/gdbm co gdbm
Or, to checkout the sources from CVS mirror at Savannah, issue the
following command:
cvs -d :pserver:anoncvs@cvs.savannah.gnu.org:/cvsroot/gdbm checkout gdbm
** Git
To clone the Git repository, run:
git clone git://git.gnu.org.ua/gdbm.git
Or, to clone the secondary GDBM Git mirrror repo, run:
git clone git://git.savannah.gnu.org/gdbm.git
In all cases, this will give you read-only access. If you think you need
write access, contact .
* Building
Usual procedures apply:
./configure
make
make install
See the files INSTALL and README for the detailed instructions.
* Copyright information:
Copyright information:
Copyright (C) 1990-2011, 2017-2018 Free Software Foundation, Inc.
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
copyright notice and this permission notice are preserved,
thus giving the recipient permission to redistribute in turn.
Permission is granted to distribute modified versions
of this document, or of portions of it,
under the above conditions, provided also that they
carry prominent notices stating who last changed them.
Local variables:
mode: outline
paragraph-separate: "[ ]*$"
end:
gdbm-1.18.1/NOTE-WARNING 0000644 0001750 0001750 00000002015 13300077706 011230 0000000 0000000 ******************************************************************************
W A R N I N G
******************************************************************************
Gdbm files have never been `portable' between different operating systems,
system architectures, or potentially even different compilers. Differences
in byte order, the size of file offsets, and even structure packing make
gdbm files non-portable.
Therefore, if you intend to send your database to somebody over the wire,
please dump it into a portable format using gdbm_dump and send the resulting
file instead. The receiving party will be able to recreate the database from
the dump using the gdbm_load command.
Please refer to the documentation, chapters 22 and 23, for a detailed
discussion of these two tools. Run `info gdbm gdbm_dump', if gdbm is
already installed on your system, or `info -f doc/gdbm.info gdbm_dump'
to read the docs from the source tree.
The documentation is also available online at
http://www.gnu.org.ua/software/gdbm/manual.
gdbm-1.18.1/po/ 0000755 0001750 0001750 00000000000 13364776741 010154 5 0000000 0000000 gdbm-1.18.1/po/es.po 0000644 0001750 0001750 00000055775 13364776740 011065 0000000 0000000 # Spanish translations for gdbm.
# Copyright (C) 2018 Free Software Foundation, Inc.
# This file is distributed under the same license as the gdbm package.
# Francisco Javier Serrador , 2018
msgid ""
msgstr ""
"Project-Id-Version: gdbm 1.12.90\n"
"Report-Msgid-Bugs-To: bug-gdbm@gnu.org\n"
"POT-Creation-Date: 2018-10-27 08:55+0300\n"
"PO-Revision-Date: 2018-04-06 16:34+0200\n"
"Last-Translator: Francisco Javier Serrador \n"
"Language-Team: Spanish \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.4\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: src/bucket.c:90 src/bucket.c:249
msgid "couldn't init cache"
msgstr "no se puede iniciar caché"
#: src/bucket.c:119 src/bucket.c:445 src/falloc.c:197 src/falloc.c:333
#: src/findkey.c:112 src/gdbmstore.c:169 src/update.c:37 src/update.c:101
msgid "lseek error"
msgstr "error lseek"
#: src/bucket.c:299
msgid "directory overflow"
msgstr "desbordamiento de directorio"
#: src/bucket.c:310 src/falloc.c:297 src/findkey.c:85 src/findkey.c:101
msgid "malloc error"
msgstr "error malloc"
#: src/falloc.c:187
msgid "malloc failed"
msgstr "malloc fallado"
#: src/gdbm_dump.c:25
msgid "select dump format"
msgstr "seleccionar formato volcado"
#: src/gdbm_dump.c:67
msgid "unknown dump format"
msgstr "formato de volcado desconocido"
#: src/gdbm_dump.c:74 src/gdbm_load.c:215
msgid "unknown option"
msgstr "opción desconocida"
#: src/gdbm_dump.c:90 src/gdbm_load.c:231
#, c-format
msgid "too many arguments; try `%s -h' for more info"
msgstr "demasiados argumentos; intente `%s -h' para más información"
#: src/gdbm_dump.c:110 src/gdbm_load.c:251
#, c-format
msgid "cannot open %s"
msgstr "no puede abrir %s"
#: src/gdbm_dump.c:118 src/gdbm_load.c:261
msgid "gdbm_open failed"
msgstr "gdbm_open fallado"
#: src/gdbm_dump.c:125
msgid "dump error"
msgstr "error de volcado"
#: src/gdbm_load.c:35
msgid "replace records in the existing database"
msgstr "sustituye registros dentro de BD existente"
#: src/gdbm_load.c:36
msgid "MODE"
msgstr "MODO"
#: src/gdbm_load.c:36
msgid "set file mode"
msgstr "establecer modo fichero"
#: src/gdbm_load.c:37
msgid "NAME|UID[:NAME|GID]"
msgstr "NOMBRE|UID[:NOMBRE|GID]"
#: src/gdbm_load.c:37
msgid "set file owner"
msgstr "establecer propietario del fichero"
#: src/gdbm_load.c:38
msgid "do not attempt to set file meta-data"
msgstr "no tratar establecer ficheros meta-datos"
#: src/gdbm_load.c:39
msgid "use memory mapping"
msgstr "utilizar distribución de memoria"
#: src/gdbm_load.c:40 src/gdbm_load.c:41
msgid "NUM"
msgstr "NÚM"
#: src/gdbm_load.c:40
msgid "set the cache size"
msgstr "establece el tamaño de caché"
#: src/gdbm_load.c:41
msgid "set the block size"
msgstr "establecer tamaño del bloque"
#: src/gdbm_load.c:79
#, c-format
msgid "invalid number: %s"
msgstr "número inválido: %s"
#: src/gdbm_load.c:84
#, c-format
msgid "invalid number: %s: %s"
msgstr "número no válido: %s: %s"
#: src/gdbm_load.c:136
#, c-format
msgid "invalid octal number"
msgstr "número octal no válido"
#: src/gdbm_load.c:161
#, c-format
msgid "invalid user name: %s"
msgstr "nombre de usuario no válido: %s"
#: src/gdbm_load.c:180
#, c-format
msgid "invalid group name: %s"
msgstr "nombre de grupo inválido: %s"
#: src/gdbm_load.c:192
#, c-format
msgid "no such UID: %lu"
msgstr "sin tal UID: %lu"
#: src/gdbm_load.c:267 src/gdbmtool.c:115 src/gdbmtool.c:121 src/gdbmtool.c:127
#: src/gdbmtool.c:1059
#, c-format
msgid "gdbm_setopt failed: %s"
msgstr "gdbm_setopt fallado: %s"
#: src/gdbm_load.c:281 src/gdbm_load.c:299 src/gdbmtool.c:1042
#, c-format
msgid "error restoring metadata: %s (%s)"
msgstr "error restaurando metadatos: %s (%s)"
#: src/gdbm_load.c:290
#, c-format
msgid "cannot load from %s"
msgstr "no se puede cargar desde %s"
#: src/gdbm_load.c:307
msgid "gdbm_setopt failed"
msgstr "gdbm_setopt fallado"
#: src/gdbmerrno.c:103
msgid "No error"
msgstr "Sin error"
#: src/gdbmerrno.c:104
msgid "Malloc error"
msgstr "Error malloc"
#: src/gdbmerrno.c:105
msgid "Block size error"
msgstr "Error de tamaño de bloque"
#: src/gdbmerrno.c:106
msgid "File open error"
msgstr "Error de apertura de fichero"
#: src/gdbmerrno.c:107
msgid "File write error"
msgstr "Error de escritura de fichero"
#: src/gdbmerrno.c:108
msgid "File seek error"
msgstr "Error de seguimiento de fichero"
#: src/gdbmerrno.c:109
msgid "File read error"
msgstr "Error de lectura de fichero"
#: src/gdbmerrno.c:110
msgid "Bad magic number"
msgstr "Número mágico equivocado"
#: src/gdbmerrno.c:111
msgid "Empty database"
msgstr "BD vacÃa"
#: src/gdbmerrno.c:112
msgid "Can't be reader"
msgstr "No puede ser leÃdo"
#: src/gdbmerrno.c:113
msgid "Can't be writer"
msgstr "No puede ser escrito"
#: src/gdbmerrno.c:114
msgid "Reader can't delete"
msgstr "Lector no puede borrar"
#: src/gdbmerrno.c:115
msgid "Reader can't store"
msgstr "Lector no puede almacenar"
#: src/gdbmerrno.c:116
msgid "Reader can't reorganize"
msgstr "Lector no puede reorganizar"
#: src/gdbmerrno.c:117
msgid "Should not happen: unused error code"
msgstr "No deberÃa ocurrir: código erróneo inutilizado"
#: src/gdbmerrno.c:118 src/gdbmtool.c:461
msgid "Item not found"
msgstr "Ãtem no encontrado"
#: src/gdbmerrno.c:119
msgid "Reorganize failed"
msgstr "Reorganización fallada"
#: src/gdbmerrno.c:120
msgid "Cannot replace"
msgstr "No puede reemplazar"
#: src/gdbmerrno.c:121
msgid "Illegal data"
msgstr "Datos ilegales"
#: src/gdbmerrno.c:122
msgid "Option already set"
msgstr "Opción ya establecida"
#: src/gdbmerrno.c:123
msgid "Illegal option"
msgstr "Opción ilegal"
#: src/gdbmerrno.c:124
msgid "Byte-swapped file"
msgstr "Fichero con byte intercambiado"
#: src/gdbmerrno.c:125
msgid "File header assumes wrong off_t size"
msgstr ""
#: src/gdbmerrno.c:126
msgid "Bad file flags"
msgstr "Marcas depuradas equivocadas"
#: src/gdbmerrno.c:127
msgid "Cannot stat file"
msgstr "No puede especificar fichero"
#: src/gdbmerrno.c:128
msgid "Unexpected end of file"
msgstr "Final de lÃnea no esperado"
#: src/gdbmerrno.c:129
msgid "Database name not given"
msgstr "Nombre de BD no dada"
#: src/gdbmerrno.c:130
msgid "Failed to restore file owner"
msgstr "Fallado al restaurar el propietario del fichero"
#: src/gdbmerrno.c:131
msgid "Failed to restore file mode"
msgstr "Fallado al restaurar modo de fichero"
#: src/gdbmerrno.c:132
msgid "Database needs recovery"
msgstr "BD requiere recuperación"
#: src/gdbmerrno.c:133
msgid "Failed to create backup copy"
msgstr "Fallado al crear copia de respaldo"
#: src/gdbmerrno.c:134
msgid "Bucket directory overflow"
msgstr "Desbordamiento superior de directorio bucket"
#: src/gdbmerrno.c:135
msgid "Malformed bucket header"
msgstr ""
#: src/gdbmerrno.c:136
#, fuzzy
msgid "Malformed database file header"
msgstr "escribe cabecera del fichero BBDD"
#: src/gdbmerrno.c:137
msgid "Malformed avail_block"
msgstr ""
#: src/gdbmerrno.c:138
msgid "Malformed hash table"
msgstr ""
#: src/gdbmerrno.c:139
#, fuzzy
msgid "Invalid directory entry"
msgstr ""
"\n"
"actual directorio registro = %d.\n"
#: src/gdbmerrno.c:140
msgid "Error closing file"
msgstr ""
#: src/gdbmerrno.c:141
msgid "Error synchronizing file"
msgstr ""
#: src/gdbmerrno.c:142
msgid "Error truncating file"
msgstr ""
#: src/parseopt.c:49
msgid "give this help list"
msgstr "da este listado de ayuda"
#: src/parseopt.c:50
msgid "print program version"
msgstr "escribe versión de programa"
#: src/parseopt.c:51
msgid "give a short usage message"
msgstr "da un mensaje corto de empleo"
#: src/parseopt.c:348 src/parseopt.c:431
msgid "Usage:"
msgstr "Modo de empleo:"
#: src/parseopt.c:350
msgid "OPTION"
msgstr "OPCIÓN"
#: src/parseopt.c:364
msgid ""
"Mandatory or optional arguments to long options are also mandatory or "
"optional for any corresponding short options."
msgstr ""
"Argumentos obligatorios u opcionales para opciones largas son también "
"obligatorios u opcionales para opciones correspondientes cortas."
#. TRANSLATORS: The placeholder indicates the bug-reporting address
#. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the address for translation
#. bugs (typically your translation team's web or email address).
#: src/parseopt.c:375
#, c-format
msgid "Report bugs to %s.\n"
msgstr "Comunique defectos a %s.\n"
#: src/parseopt.c:378
#, c-format
msgid "%s home page: <%s>\n"
msgstr "%s página inicial: <%s>\n"
#. TRANSLATORS: Translate "(C)" to the copyright symbol
#. (C-in-a-circle), if this symbol is available in the user's
#. locale. Otherwise, do not translate "(C)"; leave it as-is.
#: src/parseopt.c:541
msgid "(C)"
msgstr "©"
#: src/gdbmtool.c:96
#, c-format
msgid "database %s already exists; overwrite"
msgstr "bbdd %s ya existente; sobrescribe"
#: src/gdbmtool.c:108
#, c-format
msgid "cannot open database %s: %s"
msgstr "no puede abrir la bbdd %s: %s"
#: src/gdbmtool.c:145
#, c-format
msgid "warning: using default database file %s"
msgstr "aviso: utilizando fichero %s de bbdd predeterminado"
#: src/gdbmtool.c:194
#, c-format
msgid ""
"bits = %d\n"
"count= %d\n"
"Hash Table:\n"
msgstr ""
"bits = %d\n"
"contador= %d\n"
"Segmento Hash:\n"
#: src/gdbmtool.c:197
#, c-format
msgid ""
" # hash value key size data size data adr home key start\n"
msgstr ""
" # valor hash tam. clave tam datos dirc datos inicio clave "
"inicio\n"
#: src/gdbmtool.c:215
#, c-format
msgid ""
"\n"
"Avail count = %1d\n"
msgstr ""
"\n"
"Cont disp = %1d\n"
#: src/gdbmtool.c:216
#, c-format
msgid "Address size\n"
msgstr "Dirección tamaño\n"
#: src/gdbmtool.c:288
#, c-format
msgid ""
"\n"
"header block\n"
"size = %d\n"
"count = %d\n"
msgstr ""
"\n"
"blquear cabecera\n"
"tam. = %d\n"
"cont. = %d\n"
"\n"
#: src/gdbmtool.c:314
#, c-format
msgid ""
"\n"
"block = %d\n"
"size = %d\n"
"count = %d\n"
msgstr ""
"\n"
"bloque = %d\n"
"tamaño = %d\n"
"contador = %d\n"
"\n"
#: src/gdbmtool.c:319
msgid "invalid avail_block"
msgstr ""
#: src/gdbmtool.c:334
#, fuzzy, c-format
msgid ""
"Bucket Cache (size %zu):\n"
" Index: Address Changed Data_Hash \n"
msgstr ""
"Bucket cacheado (tamaño %zu):\n"
" Indexado: Dirección Modificado Hash_Datos \n"
#: src/gdbmtool.c:342
msgid "True"
msgstr "Verdadero"
#: src/gdbmtool.c:342
msgid "False"
msgstr "Falso"
#: src/gdbmtool.c:347
#, c-format
msgid "Bucket cache has not been initialized.\n"
msgstr "Caché bucket no ha sido inicializado.\n"
#: src/gdbmtool.c:405
msgid "nothing to close"
msgstr "nada que cerrar"
#: src/gdbmtool.c:444
msgid "count buffer overflow"
msgstr "desbordamiento de búfer contador"
#: src/gdbmtool.c:447
#, c-format
msgid "There is %s item in the database.\n"
msgid_plural "There are %s items in the database.\n"
msgstr[0] ""
"Hay %s Ãtem dentro de la BBDD.\n"
" \n"
msgstr[1] "Hay %s Ãtemes dentro de la BBDD.\n"
#: src/gdbmtool.c:463
#, c-format
msgid "Can't delete: %s"
msgstr "No puede borrar: %s"
#: src/gdbmtool.c:479 src/gdbmtool.c:546
msgid "No such item found."
msgstr "Sin tal Ãtem encontrado."
#: src/gdbmtool.c:481
#, c-format
msgid "Can't fetch data: %s"
msgstr "No puede obtener datos: %s"
#: src/gdbmtool.c:491
#, fuzzy, c-format
msgid "Item not inserted: %s."
msgstr "Ãtem no insertado."
#: src/gdbmtool.c:514
#, c-format
msgid "No such item found.\n"
msgstr "Sin tal Ãtem encontrado.\n"
#: src/gdbmtool.c:516 src/gdbmtool.c:551
#, c-format
msgid "Can't find key: %s"
msgstr "No puede encontrar clave: %s"
#: src/gdbmtool.c:559
msgid "Reorganization failed."
msgstr "Reorganización fallada."
#: src/gdbmtool.c:561
msgid "Reorganization succeeded."
msgstr "Reorganización correcta."
#: src/gdbmtool.c:611 src/gdbmtool.c:621 src/gdbmtool.c:631 src/gdbmtool.c:738
#: src/gdbmtool.c:747
#, c-format
msgid "not a number (stopped near %s)\n"
msgstr "no un número (detenido cerca de %s)\n"
#: src/gdbmtool.c:638 src/gdbmtool.c:982 src/gdbmtool.c:1014
#, c-format
msgid "unrecognized argument: %s"
msgstr "argumento no reconocido: %s"
#: src/gdbmtool.c:647
#, c-format
msgid "Recovery succeeded.\n"
msgstr "Recuperación correcta.\n"
#: src/gdbmtool.c:651
#, c-format
msgid "Keys recovered: %lu, failed: %lu, duplicate: %lu\n"
msgstr ""
#: src/gdbmtool.c:656
#, c-format
msgid "Buckets recovered: %lu, failed: %lu\n"
msgstr ""
#: src/gdbmtool.c:664
#, c-format
msgid "Original database preserved in file %s"
msgstr "BBDD original preservada en el fichero %s"
#: src/gdbmtool.c:672
#, c-format
msgid "Recovery failed: %s"
msgstr "Recuperación fallada: %s"
#: src/gdbmtool.c:716
#, c-format
msgid "no current bucket\n"
msgstr "sin bucket actual\n"
#: src/gdbmtool.c:720
#, c-format
msgid "Bucket #%s"
msgstr "Cubo Nº%s"
#: src/gdbmtool.c:723
msgid "Current bucket"
msgstr "Cubo actual"
#: src/gdbmtool.c:724
#, c-format
msgid ""
"\n"
" current directory entry = %d.\n"
msgstr ""
"\n"
"actual directorio registro = %d.\n"
#: src/gdbmtool.c:726
#, c-format
msgid " current bucket address = %lu.\n"
msgstr " dirección actual bucket = %lu.\n"
#: src/gdbmtool.c:769
msgid "Not a bucket."
msgstr "No un bucket."
#: src/gdbmtool.c:816
#, c-format
msgid "Hash table directory.\n"
msgstr ""
"Directorio distr. hash.\n"
"\n"
#: src/gdbmtool.c:817
#, c-format
msgid ""
" Size = %d. Bits = %d, Buckets = %zu.\n"
"\n"
msgstr ""
" Tamaño = %d. Bits = %d, Buckets = %zu.\n"
"\n"
#: src/gdbmtool.c:842
#, c-format
msgid ""
"\n"
"File Header: \n"
"\n"
msgstr ""
"\n"
"Fichero Cabecera. \n"
"\n"
#: src/gdbmtool.c:843
#, c-format
msgid " table = %lu\n"
msgstr " segmento = %lu\n"
#: src/gdbmtool.c:845
#, c-format
msgid " table size = %d\n"
msgstr " tamaño distribuido = %d\n"
#: src/gdbmtool.c:846
#, c-format
msgid " table bits = %d\n"
msgstr " segmento bits = %d\n"
#: src/gdbmtool.c:847
#, c-format
msgid " block size = %d\n"
msgstr " tam blq = %d\n"
#: src/gdbmtool.c:848
#, c-format
msgid " bucket elems = %d\n"
msgstr " bucket elems = %d\n"
#: src/gdbmtool.c:849
#, c-format
msgid " bucket size = %d\n"
msgstr " tam bucket = %d\n"
#: src/gdbmtool.c:850
#, c-format
msgid " header magic = %x\n"
msgstr " cabecera mágica = %x\n"
#: src/gdbmtool.c:851
#, c-format
msgid " next block = %lu\n"
msgstr " sig bloque = %lu\n"
#: src/gdbmtool.c:853
#, c-format
msgid " avail size = %d\n"
msgstr " disp tam = %d\n"
#: src/gdbmtool.c:854
#, c-format
msgid " avail count = %d\n"
msgstr " contador disponible =%d\n"
#: src/gdbmtool.c:855
#, c-format
msgid " avail nx blk = %lu\n"
msgstr " disp blq nx %lu\n"
#: src/gdbmtool.c:868
#, c-format
msgid "hash value = %x, bucket #%u, slot %u"
msgstr "hash valorado = %x, cubo #%u, rendija %u"
#: src/gdbmtool.c:874
#, c-format
msgid "hash value = %x"
msgstr "valor hash = %x"
#: src/gdbmtool.c:938
#, c-format
msgid "%s; the key was:"
msgstr ""
#: src/gdbmtool.c:991
#, c-format
msgid "error dumping database: %s"
msgstr "volcando de BD erróneo: %s"
#: src/gdbmtool.c:1051
#, c-format
msgid "cannot load from %s: %s"
msgstr "no se puede cargar desde %s: %s"
#: src/gdbmtool.c:1067
#, c-format
msgid "Database file: %s\n"
msgstr "Fichero BD: %s\n"
#: src/gdbmtool.c:1069
msgid "No database name"
msgstr "Ningún nombre de BBDD"
#: src/gdbmtool.c:1071
msgid "Database is open"
msgstr "BD está abierta"
#: src/gdbmtool.c:1073
msgid "Database is not open"
msgstr "BD no está abierta"
#: src/gdbmtool.c:1127
#, c-format
msgid "unknown debug flag: %s"
msgstr "marca de depuración desconocido: %s"
#: src/gdbmtool.c:1130
#, c-format
msgid "invalid type of argument %d"
msgstr "tipo inválido de argumento %d"
#: src/gdbmtool.c:1135
#, c-format
msgid "Debug flags:"
msgstr "Marcas depuradas:"
#: src/gdbmtool.c:1141
msgid "none"
msgstr "ninguno"
#: src/gdbmtool.c:1145
msgid "compiled without debug support"
msgstr "compilado sin apoyo depurador"
#: src/gdbmtool.c:1200
msgid "count (number of entries)"
msgstr "contador (número de asientos)"
#: src/gdbmtool.c:1203 src/gdbmtool.c:1218 src/gdbmtool.c:1246
#: src/gdbmtool.c:1310
msgid "KEY"
msgstr "CLAVE"
#: src/gdbmtool.c:1206
msgid "delete a record"
msgstr "borra un registro"
#: src/gdbmtool.c:1209 src/gdbmtool.c:1224 src/gdbmtool.c:1549
msgid "FILE"
msgstr "FICHERO"
#: src/gdbmtool.c:1215
msgid "export"
msgstr "exportar"
#: src/gdbmtool.c:1221
msgid "fetch record"
msgstr "obtener registro"
#: src/gdbmtool.c:1230
msgid "import"
msgstr "importar"
#: src/gdbmtool.c:1236
msgid "list"
msgstr "listado"
#: src/gdbmtool.c:1239
msgid "[KEY]"
msgstr "[CLAVE]"
#: src/gdbmtool.c:1243
msgid "nextkey"
msgstr "siguienteclave"
#: src/gdbmtool.c:1247
msgid "DATA"
msgstr "DATOS"
#: src/gdbmtool.c:1251
msgid "store"
msgstr "almacenaje"
#: src/gdbmtool.c:1257
msgid "firstkey"
msgstr "primeraclave"
#: src/gdbmtool.c:1263
msgid "reorganize"
msgstr "reorganizar"
#: src/gdbmtool.c:1276
msgid "recover the database"
msgstr "recupera la bbdd"
#: src/gdbmtool.c:1282
msgid "print avail list"
msgstr "escribe lista disponible"
#: src/gdbmtool.c:1285
msgid "NUMBER"
msgstr "NÚMERO"
#: src/gdbmtool.c:1289
msgid "print a bucket"
msgstr "escribe un bucket"
#: src/gdbmtool.c:1295
msgid "print current bucket"
msgstr "escribe bucket actual"
#: src/gdbmtool.c:1301
msgid "print hash directory"
msgstr "escribe hasd del directorio"
#: src/gdbmtool.c:1307
msgid "print database file header"
msgstr "escribe cabecera del fichero BBDD"
#: src/gdbmtool.c:1314
msgid "hash value of key"
msgstr "valor hash de clave"
#: src/gdbmtool.c:1320
msgid "print the bucket cache"
msgstr "escribe la caché del bucket"
#: src/gdbmtool.c:1326
msgid "print current program status"
msgstr "escribe estado de programa actual"
#: src/gdbmtool.c:1332
msgid "print version of gdbm"
msgstr "escribe la versión de gdbm"
#: src/gdbmtool.c:1338
msgid "print this help list"
msgstr "escribe esta ayuda listada"
#: src/gdbmtool.c:1344
msgid "quit the program"
msgstr "salir del programa"
#: src/gdbmtool.c:1350
msgid "set or list variables"
msgstr "establece o lista variables"
#: src/gdbmtool.c:1356
msgid "unset variables"
msgstr "desestablece variables"
#: src/gdbmtool.c:1364
msgid "define datum structure"
msgstr "define estructura de datos"
#: src/gdbmtool.c:1371
msgid "source command script"
msgstr "orden de guión fuente"
#: src/gdbmtool.c:1377
msgid "close the database"
msgstr "cierra la BD"
#: src/gdbmtool.c:1383
msgid "open new database"
msgstr "abre bbdd nueva"
#: src/gdbmtool.c:1387
msgid "[FROM]"
msgstr "[ORIGEN]"
#: src/gdbmtool.c:1388
msgid "[COUNT]"
msgstr "[CUENTA]"
#: src/gdbmtool.c:1392
msgid "show input history"
msgstr "muestra entrada histórica"
#: src/gdbmtool.c:1399
msgid "query/set debug level"
msgstr "petición/establecer nivel depurador"
#: src/gdbmtool.c:1529
msgid "Invalid command. Try ? for help."
msgstr "Orden inválido. Pruebe ? para ayuda."
#: src/gdbmtool.c:1530
msgid "Unknown command"
msgstr "Orden desconocida"
#: src/gdbmtool.c:1538
msgid "examine and/or modify a GDBM database"
msgstr "examina y/o modifica una BD GDBM"
#: src/gdbmtool.c:1539
msgid "DBFILE [COMMAND [ARG ...]]"
msgstr ""
#: src/gdbmtool.c:1547 src/gdbmtool.c:1548
msgid "SIZE"
msgstr "TAMAÑO"
#: src/gdbmtool.c:1547
msgid "set block size"
msgstr "establecer tamaño de bloque"
#: src/gdbmtool.c:1548
msgid "set cache size"
msgstr "establece tamaño caché"
#: src/gdbmtool.c:1549
msgid "read commands from FILE"
msgstr "leer órdenes desde FICHERO"
#: src/gdbmtool.c:1551
msgid "disable file locking"
msgstr "desactiva fichero bloqueado"
#: src/gdbmtool.c:1552
msgid "do not use mmap"
msgstr "no utilizar multidistribución"
#: src/gdbmtool.c:1553
msgid "create database"
msgstr "crear BD"
#: src/gdbmtool.c:1554
msgid "do not read .gdbmtoolrc file"
msgstr "no leer fichero .gdbmtoolrc"
#: src/gdbmtool.c:1555
msgid "open database in read-only mode"
msgstr "abre bbdd en modo de solo lectura"
#: src/gdbmtool.c:1556
msgid "synchronize to disk after each write"
msgstr "sincroniza al disco tras cada escritura"
#: src/gdbmtool.c:1557
msgid "don't print initial banner"
msgstr "no escribe pancarta inicial"
#: src/gdbmtool.c:1559
msgid "enable lexical analyzer traces"
msgstr ""
#: src/gdbmtool.c:1560
msgid "enable grammar traces"
msgstr ""
#: src/gdbmtool.c:1831
#, c-format
msgid "cannot coerce %s to %s"
msgstr "no se puede obligar %s a %s"
#: src/gdbmtool.c:1906
#, c-format
msgid "%s: not enough arguments"
msgstr "%s: sin argumentos suficientes"
#: src/gdbmtool.c:1913
msgid "unexpected eof"
msgstr "inesperado FDL"
#: src/gdbmtool.c:1936
#, c-format
msgid "%s: too many arguments"
msgstr "%s: demasiados argumentos"
#: src/gdbmtool.c:1964
#, c-format
msgid "cannot run pager `%s': %s"
msgstr "no puede ejecutar paginador `%s': %s"
#: src/gdbmtool.c:2013
msgid "cannot find home directory"
msgstr "no puede encontrar el directorio inicial"
#: src/gdbmtool.c:2141
#, c-format
msgid "unknown option; try `%s -h' for more info"
msgstr "opción desconocida; intente `%s -h' para más información"
#: src/gdbmtool.c:2165
msgid "--file and command cannot be used together"
msgstr ""
#: src/gdbmtool.c:2187
#, c-format
msgid ""
"\n"
"Welcome to the gdbm tool. Type ? for help.\n"
"\n"
msgstr ""
"\n"
"Bienvenido para la herramenta de gdbm. Tipo ? para ayuda.\n"
"\n"
#: src/gram.y:221
#, c-format
msgid "expected \"key\" or \"content\", but found \"%s\""
msgstr "esperaba «clave» o «contanido», pero encontró «%s»"
#: src/gram.y:292 src/gram.y:313 src/gram.y:345
#, c-format
msgid "no such variable: %s"
msgstr "sin tal variable: %s"
#: src/gram.y:296
#, c-format
msgid "%s is not a boolean variable"
msgstr "%s no una variable booleana"
#: src/gram.y:300 src/gram.y:325
#, c-format
msgid "unexpected error setting %s: %d"
msgstr "error de opciones inesperado %s: %d"
#: src/gram.y:317
#, c-format
msgid "%s: bad variable type"
msgstr "%s: tipo de variable equivocada"
#: src/gram.y:321
#, c-format
msgid "%s: value %s is not allowed"
msgstr "%s: valor %s no permitido"
#: src/gram.y:349
#, c-format
msgid "%s: variable cannot be unset"
msgstr "%s: variable no puede ser desestablecida"
#: src/lex.l:96
msgid "recursive sourcing"
msgstr "origen recursivo"
#: src/lex.l:98
#, c-format
msgid "%s already sourced here"
msgstr "%s ya fuente original aquÃ"
#: src/lex.l:204 src/lex.l:214
msgid "invalid #line statement"
msgstr "estado #line inválido"
#: src/datconv.c:254
#, c-format
msgid "(not enough data)"
msgstr "(sin suficientes datos)"
#: src/datconv.c:329
msgid "mixing tagged and untagged values is not allowed"
msgstr "mezclando valores etiquetados y no etiquetados no esa permitido"
#: src/datconv.c:362
msgid "cannot convert"
msgstr "no puede convertir"
#: src/datconv.c:373
#, c-format
msgid "cannot convert value #%d: %s"
msgstr "no puede convertir valor Nº%d: %s"
#~ msgid "Wrong file offset"
#~ msgstr "Fichero desplazado equivocado"
#~ msgid "cannot fetch data; the key was:"
#~ msgstr "no puede obtener datos, la clave fue:"
#~ msgid "DBFILE"
#~ msgstr "BDFICHERO"
#~ msgid "too many arguments"
#~ msgstr "demasiados argumentos"
#~ msgid "cannot open `%s': %s"
#~ msgstr "no puede abrir «%s»: %s"
#~ msgid "%s is not a regular file"
#~ msgstr "%s no es un fichero regular"
#~ msgid "cannot open %s for reading: %s"
#~ msgstr "no se puede abrir %s para lectura: %s"
gdbm-1.18.1/po/sr.po 0000644 0001750 0001750 00000067600 13364776740 011070 0000000 0000000 # Serbian translation of gdbm.
# Copyright (C) 2012 Free Software Foundation, Inc.
# This file is distributed under the same license as the gdbm package.
# МироÑлав Ðиколић , 2012—2016.
msgid ""
msgstr ""
"Project-Id-Version: gdbm-1.12.90\n"
"Report-Msgid-Bugs-To: bug-gdbm@gnu.org\n"
"POT-Creation-Date: 2018-10-27 08:55+0300\n"
"PO-Revision-Date: 2016-12-05 19:03+0200\n"
"Last-Translator: МироÑлав Ðиколић \n"
"Language-Team: Serbian <(nothing)>\n"
"Language: sr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
#: src/bucket.c:90 src/bucket.c:249
msgid "couldn't init cache"
msgstr "не могу да покренем оÑтаву"
#: src/bucket.c:119 src/bucket.c:445 src/falloc.c:197 src/falloc.c:333
#: src/findkey.c:112 src/gdbmstore.c:169 src/update.c:37 src/update.c:101
msgid "lseek error"
msgstr "грешка премотавања реда"
#: src/bucket.c:299
msgid "directory overflow"
msgstr "прекорачење директоријума"
#: src/bucket.c:310 src/falloc.c:297 src/findkey.c:85 src/findkey.c:101
msgid "malloc error"
msgstr "грешка доделе меморије"
#: src/falloc.c:187
msgid "malloc failed"
msgstr "није уÑпела додела меморије"
#: src/gdbm_dump.c:25
msgid "select dump format"
msgstr "бирам Ð·Ð°Ð¿Ð¸Ñ Ð¸ÑпиÑа"
#: src/gdbm_dump.c:67
msgid "unknown dump format"
msgstr "непознат Ð·Ð°Ð¿Ð¸Ñ Ð¸ÑпиÑа"
#: src/gdbm_dump.c:74 src/gdbm_load.c:215
msgid "unknown option"
msgstr "непозната опција"
#: src/gdbm_dump.c:90 src/gdbm_load.c:231
#, c-format
msgid "too many arguments; try `%s -h' for more info"
msgstr "превише аргумената; покушајте „%s -h“ за више података"
#: src/gdbm_dump.c:110 src/gdbm_load.c:251
#, c-format
msgid "cannot open %s"
msgstr "не могу да отворим „%s“"
#: src/gdbm_dump.c:118 src/gdbm_load.c:261
msgid "gdbm_open failed"
msgstr "гдбм_отвори није уÑпело"
#: src/gdbm_dump.c:125
msgid "dump error"
msgstr "грешка иÑпиÑа"
#: src/gdbm_load.c:35
msgid "replace records in the existing database"
msgstr "мења запиÑе у поÑтојећој бази података"
#: src/gdbm_load.c:36
msgid "MODE"
msgstr "РЕЖИМ"
#: src/gdbm_load.c:36
msgid "set file mode"
msgstr "подешава режим датотеке"
#: src/gdbm_load.c:37
msgid "NAME|UID[:NAME|GID]"
msgstr "ÐÐЗИВ|ЈИБ[:ÐÐЗИВ|ГИБ]"
#: src/gdbm_load.c:37
msgid "set file owner"
msgstr "подешава влаÑника датотеке"
#: src/gdbm_load.c:38
msgid "do not attempt to set file meta-data"
msgstr "не покушава да подеÑи мета податке датотеке"
#: src/gdbm_load.c:39
msgid "use memory mapping"
msgstr "кориÑти мапирање меморије"
#: src/gdbm_load.c:40 src/gdbm_load.c:41
msgid "NUM"
msgstr "БРОЈ"
#: src/gdbm_load.c:40
msgid "set the cache size"
msgstr "подешава величину оÑтаве"
#: src/gdbm_load.c:41
msgid "set the block size"
msgstr "подешава величину блока"
#: src/gdbm_load.c:79
#, c-format
msgid "invalid number: %s"
msgstr "неиÑправан број: %s"
#: src/gdbm_load.c:84
#, c-format
msgid "invalid number: %s: %s"
msgstr "неиÑправан број: %s: %s"
#: src/gdbm_load.c:136
#, c-format
msgid "invalid octal number"
msgstr "неиÑправан октални број"
#: src/gdbm_load.c:161
#, c-format
msgid "invalid user name: %s"
msgstr "неиÑправно кориÑничко име: %s"
#: src/gdbm_load.c:180
#, c-format
msgid "invalid group name: %s"
msgstr "неиÑправан назив групе: %s"
#: src/gdbm_load.c:192
#, c-format
msgid "no such UID: %lu"
msgstr "нема таквог ЈИБ-а: %lu"
#: src/gdbm_load.c:267 src/gdbmtool.c:115 src/gdbmtool.c:121 src/gdbmtool.c:127
#: src/gdbmtool.c:1059
#, c-format
msgid "gdbm_setopt failed: %s"
msgstr "гдбм_подеÑиопцију није уÑпело: %s"
#: src/gdbm_load.c:281 src/gdbm_load.c:299 src/gdbmtool.c:1042
#, c-format
msgid "error restoring metadata: %s (%s)"
msgstr "грешка повраћаја мета података: %s (%s)"
#: src/gdbm_load.c:290
#, c-format
msgid "cannot load from %s"
msgstr "не могу да учитам из %s"
#: src/gdbm_load.c:307
msgid "gdbm_setopt failed"
msgstr "гдбм_подеÑиопцију није уÑпело"
#: src/gdbmerrno.c:103
msgid "No error"
msgstr "Ðема грешака"
#: src/gdbmerrno.c:104
msgid "Malloc error"
msgstr "Грешка доделе меморије"
#: src/gdbmerrno.c:105
msgid "Block size error"
msgstr "Грешка величине блока"
#: src/gdbmerrno.c:106
msgid "File open error"
msgstr "Грешка отварања датотеке"
#: src/gdbmerrno.c:107
msgid "File write error"
msgstr "Грешка пиÑања датотеке"
#: src/gdbmerrno.c:108
msgid "File seek error"
msgstr "Грешка премотавања датотеке"
#: src/gdbmerrno.c:109
msgid "File read error"
msgstr "Грешка читања датотеке"
#: src/gdbmerrno.c:110
msgid "Bad magic number"
msgstr "Лош магични број"
#: src/gdbmerrno.c:111
msgid "Empty database"
msgstr "Празна база података"
#: src/gdbmerrno.c:112
msgid "Can't be reader"
msgstr "Ðе може бити читач"
#: src/gdbmerrno.c:113
msgid "Can't be writer"
msgstr "Ðе може бити пиÑач"
#: src/gdbmerrno.c:114
msgid "Reader can't delete"
msgstr "Читач не може да обрише"
#: src/gdbmerrno.c:115
msgid "Reader can't store"
msgstr "Читач не може да Ñкладишти"
#: src/gdbmerrno.c:116
msgid "Reader can't reorganize"
msgstr "Читач не може да преорганизује"
#: src/gdbmerrno.c:117
msgid "Should not happen: unused error code"
msgstr "Ово није требало да Ñе деÑи: некоришћени код грешке"
#: src/gdbmerrno.c:118 src/gdbmtool.c:461
msgid "Item not found"
msgstr "Ðема такве Ñтавке"
#: src/gdbmerrno.c:119
msgid "Reorganize failed"
msgstr "Преорганизовање није уÑпело"
#: src/gdbmerrno.c:120
msgid "Cannot replace"
msgstr "Ðе могу да заменим"
#: src/gdbmerrno.c:121
msgid "Illegal data"
msgstr "ÐеиÑправни подаци"
#: src/gdbmerrno.c:122
msgid "Option already set"
msgstr "Опција је већ подешена"
#: src/gdbmerrno.c:123
msgid "Illegal option"
msgstr "ÐеиÑправна опција"
#: src/gdbmerrno.c:124
msgid "Byte-swapped file"
msgstr "Датотека размењеног бајта"
#: src/gdbmerrno.c:125
msgid "File header assumes wrong off_t size"
msgstr ""
#: src/gdbmerrno.c:126
msgid "Bad file flags"
msgstr "Лоше заÑтавице датотеке"
#: src/gdbmerrno.c:127
msgid "Cannot stat file"
msgstr "Ðе могу да добавим податке о датотеци"
#: src/gdbmerrno.c:128
msgid "Unexpected end of file"
msgstr "Ðеочекиван крај датотеке"
#: src/gdbmerrno.c:129
msgid "Database name not given"
msgstr "Ðије дат назив базе података"
#: src/gdbmerrno.c:130
msgid "Failed to restore file owner"
msgstr "ÐиÑам уÑпео да повратим влаÑника датотеке"
#: src/gdbmerrno.c:131
msgid "Failed to restore file mode"
msgstr "ÐиÑам уÑпео да повратим режим датотеке"
#: src/gdbmerrno.c:132
msgid "Database needs recovery"
msgstr "Бази података је потребан опоравак"
#: src/gdbmerrno.c:133
msgid "Failed to create backup copy"
msgstr "ÐиÑам уÑпео да направим резервни примерак"
#: src/gdbmerrno.c:134
msgid "Bucket directory overflow"
msgstr "Прекорачење директоријума ведра"
#: src/gdbmerrno.c:135
msgid "Malformed bucket header"
msgstr ""
#: src/gdbmerrno.c:136
#, fuzzy
msgid "Malformed database file header"
msgstr "иÑпиÑује заглавље датотеке базе података"
#: src/gdbmerrno.c:137
msgid "Malformed avail_block"
msgstr ""
#: src/gdbmerrno.c:138
msgid "Malformed hash table"
msgstr ""
#: src/gdbmerrno.c:139
#, fuzzy
msgid "Invalid directory entry"
msgstr ""
"\n"
" ÑƒÐ½Ð¾Ñ Ñ‚Ñ€ÐµÐ½ÑƒÑ‚Ð½Ð¾Ð³ директоријума = %d.\n"
#: src/gdbmerrno.c:140
msgid "Error closing file"
msgstr ""
#: src/gdbmerrno.c:141
msgid "Error synchronizing file"
msgstr ""
#: src/gdbmerrno.c:142
msgid "Error truncating file"
msgstr ""
#: src/parseopt.c:49
msgid "give this help list"
msgstr "приказује овај ÑпиÑак помоћи"
#: src/parseopt.c:50
msgid "print program version"
msgstr "иÑпиÑује издање програма"
#: src/parseopt.c:51
msgid "give a short usage message"
msgstr "приказује кратку поруку коришћења"
#: src/parseopt.c:348 src/parseopt.c:431
msgid "Usage:"
msgstr "Употреба:"
#: src/parseopt.c:350
msgid "OPTION"
msgstr "МОГУЋÐОСТ"
#: src/parseopt.c:364
msgid ""
"Mandatory or optional arguments to long options are also mandatory or "
"optional for any corresponding short options."
msgstr ""
"Обавезни или опционални аргументи за дуге опције Ñу такође обавезни или "
"опционални за Ñве одговарајуће кратке опције."
#. TRANSLATORS: The placeholder indicates the bug-reporting address
#. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the address for translation
#. bugs (typically your translation team's web or email address).
#: src/parseopt.c:375
#, c-format
msgid "Report bugs to %s.\n"
msgstr "Грешке пријавите на %s.\n"
#: src/parseopt.c:378
#, c-format
msgid "%s home page: <%s>\n"
msgstr "%s матична Ñтраница: <%s>\n"
#. TRANSLATORS: Translate "(C)" to the copyright symbol
#. (C-in-a-circle), if this symbol is available in the user's
#. locale. Otherwise, do not translate "(C)"; leave it as-is.
#: src/parseopt.c:541
msgid "(C)"
msgstr "©"
#: src/gdbmtool.c:96
#, c-format
msgid "database %s already exists; overwrite"
msgstr "већ поÑтоји база података „%s“; да је препишем"
#: src/gdbmtool.c:108
#, c-format
msgid "cannot open database %s: %s"
msgstr "не могу да отворим базу података %s: %s"
#: src/gdbmtool.c:145
#, c-format
msgid "warning: using default database file %s"
msgstr "упозорење: кориÑтим оÑновну датотеку базе података „%s“"
#: src/gdbmtool.c:194
#, c-format
msgid ""
"bits = %d\n"
"count= %d\n"
"Hash Table:\n"
msgstr ""
"бита = %d\n"
"број = %d\n"
"Хеш табела:\n"
#: src/gdbmtool.c:197
#, c-format
msgid ""
" # hash value key size data size data adr home key start\n"
msgstr ""
" # хеш вредноÑÑ‚ величина кључа величина податка податак "
"адреÑа почетна кључ полазна\n"
#: src/gdbmtool.c:215
#, c-format
msgid ""
"\n"
"Avail count = %1d\n"
msgstr ""
"\n"
"Укупно доÑтупно = %1d\n"
#: src/gdbmtool.c:216
#, c-format
msgid "Address size\n"
msgstr "ÐдрÑа величина\n"
#: src/gdbmtool.c:288
#, c-format
msgid ""
"\n"
"header block\n"
"size = %d\n"
"count = %d\n"
msgstr ""
"\n"
"блок заглавља\n"
"величина = %d\n"
"укупно = %d\n"
#: src/gdbmtool.c:314
#, c-format
msgid ""
"\n"
"block = %d\n"
"size = %d\n"
"count = %d\n"
msgstr ""
"\n"
"блок = %d\n"
"величина = %d\n"
"укупно = %d\n"
#: src/gdbmtool.c:319
msgid "invalid avail_block"
msgstr ""
#: src/gdbmtool.c:334
#, fuzzy, c-format
msgid ""
"Bucket Cache (size %zu):\n"
" Index: Address Changed Data_Hash \n"
msgstr ""
"ОÑтава ведра (величина %zu):\n"
" ИндекÑ: ÐдреÑа Измењен Хеш_података \n"
#: src/gdbmtool.c:342
msgid "True"
msgstr "Тачно"
#: src/gdbmtool.c:342
msgid "False"
msgstr "Ðетачно"
#: src/gdbmtool.c:347
#, c-format
msgid "Bucket cache has not been initialized.\n"
msgstr "Ведро оÑтаве није покренуто.\n"
#: src/gdbmtool.c:405
msgid "nothing to close"
msgstr "ништа за затварање"
#: src/gdbmtool.c:444
msgid "count buffer overflow"
msgstr "прекорачење међумеморије броја"
#: src/gdbmtool.c:447
#, c-format
msgid "There is %s item in the database.\n"
msgid_plural "There are %s items in the database.\n"
msgstr[0] "ПоÑтоји %s Ñтавка у бази података.\n"
msgstr[1] "ПоÑтоје %s Ñтавке у бази података.\n"
msgstr[2] "ПоÑтоји %s Ñтавки у бази података.\n"
#: src/gdbmtool.c:463
#, c-format
msgid "Can't delete: %s"
msgstr "Ðе могу да обришем: %s"
#: src/gdbmtool.c:479 src/gdbmtool.c:546
msgid "No such item found."
msgstr "ÐиÑам нашао такву Ñтавку."
#: src/gdbmtool.c:481
#, c-format
msgid "Can't fetch data: %s"
msgstr "Ðе могу да довучем податке: %s"
#: src/gdbmtool.c:491
#, fuzzy, c-format
msgid "Item not inserted: %s."
msgstr "Ставка није уметнута."
#: src/gdbmtool.c:514
#, c-format
msgid "No such item found.\n"
msgstr "ÐиÑам пронашао такву Ñтавку.\n"
#: src/gdbmtool.c:516 src/gdbmtool.c:551
#, c-format
msgid "Can't find key: %s"
msgstr "Ðе могу да нађем кључ: %s"
#: src/gdbmtool.c:559
msgid "Reorganization failed."
msgstr "Преорганизација није уÑпела."
#: src/gdbmtool.c:561
msgid "Reorganization succeeded."
msgstr "Преорганизација је уÑпела."
#: src/gdbmtool.c:611 src/gdbmtool.c:621 src/gdbmtool.c:631 src/gdbmtool.c:738
#: src/gdbmtool.c:747
#, c-format
msgid "not a number (stopped near %s)\n"
msgstr "није број (Ñтадох близу %s)\n"
#: src/gdbmtool.c:638 src/gdbmtool.c:982 src/gdbmtool.c:1014
#, c-format
msgid "unrecognized argument: %s"
msgstr "непознат аргумент: %s"
#: src/gdbmtool.c:647
#, c-format
msgid "Recovery succeeded.\n"
msgstr "Опоравак је уÑпео.\n"
#: src/gdbmtool.c:651
#, c-format
msgid "Keys recovered: %lu, failed: %lu, duplicate: %lu\n"
msgstr ""
#: src/gdbmtool.c:656
#, c-format
msgid "Buckets recovered: %lu, failed: %lu\n"
msgstr ""
#: src/gdbmtool.c:664
#, c-format
msgid "Original database preserved in file %s"
msgstr "Изворна база података је очувана у датотеци „%s“"
#: src/gdbmtool.c:672
#, c-format
msgid "Recovery failed: %s"
msgstr "Опоравак није уÑпео: %s"
#: src/gdbmtool.c:716
#, c-format
msgid "no current bucket\n"
msgstr "нема тренутног ведра\n"
#: src/gdbmtool.c:720
#, c-format
msgid "Bucket #%s"
msgstr "Ведро #%s"
#: src/gdbmtool.c:723
msgid "Current bucket"
msgstr "Тренутно ведро"
#: src/gdbmtool.c:724
#, c-format
msgid ""
"\n"
" current directory entry = %d.\n"
msgstr ""
"\n"
" ÑƒÐ½Ð¾Ñ Ñ‚Ñ€ÐµÐ½ÑƒÑ‚Ð½Ð¾Ð³ директоријума = %d.\n"
#: src/gdbmtool.c:726
#, c-format
msgid " current bucket address = %lu.\n"
msgstr " адреÑа тренутног ведра = %lu.\n"
#: src/gdbmtool.c:769
msgid "Not a bucket."
msgstr "Ðије ведро."
#: src/gdbmtool.c:816
#, c-format
msgid "Hash table directory.\n"
msgstr "Директоријум хеш табеле.\n"
#: src/gdbmtool.c:817
#, c-format
msgid ""
" Size = %d. Bits = %d, Buckets = %zu.\n"
"\n"
msgstr ""
" Величина = %d. Бита = %d, Ведро = %zu.\n"
"\n"
#: src/gdbmtool.c:842
#, c-format
msgid ""
"\n"
"File Header: \n"
"\n"
msgstr ""
"\n"
"Заглавље датотеке: \n"
"\n"
#: src/gdbmtool.c:843
#, c-format
msgid " table = %lu\n"
msgstr " табела = %lu\n"
#: src/gdbmtool.c:845
#, c-format
msgid " table size = %d\n"
msgstr " величина табеле = %d\n"
#: src/gdbmtool.c:846
#, c-format
msgid " table bits = %d\n"
msgstr " битови табеле = %d\n"
#: src/gdbmtool.c:847
#, c-format
msgid " block size = %d\n"
msgstr " величина блока = %d\n"
#: src/gdbmtool.c:848
#, c-format
msgid " bucket elems = %d\n"
msgstr " елементи ведра = %d\n"
#: src/gdbmtool.c:849
#, c-format
msgid " bucket size = %d\n"
msgstr " величина ведра = %d\n"
#: src/gdbmtool.c:850
#, c-format
msgid " header magic = %x\n"
msgstr " магија заглавља = %x\n"
#: src/gdbmtool.c:851
#, c-format
msgid " next block = %lu\n"
msgstr " Ñледећи блок = %lu\n"
#: src/gdbmtool.c:853
#, c-format
msgid " avail size = %d\n"
msgstr " доÑтупна величина = %d\n"
#: src/gdbmtool.c:854
#, c-format
msgid " avail count = %d\n"
msgstr " доÑтупан количина = %d\n"
#: src/gdbmtool.c:855
#, c-format
msgid " avail nx blk = %lu\n"
msgstr " доÑтпн Ñлдћи блк = %lu\n"
#: src/gdbmtool.c:868
#, c-format
msgid "hash value = %x, bucket #%u, slot %u"
msgstr "вредноÑÑ‚ хеша = %x, ведро #%u, урез %u"
#: src/gdbmtool.c:874
#, c-format
msgid "hash value = %x"
msgstr "вредноÑÑ‚ хеша = %x"
#: src/gdbmtool.c:938
#, c-format
msgid "%s; the key was:"
msgstr ""
#: src/gdbmtool.c:991
#, c-format
msgid "error dumping database: %s"
msgstr "грешка иÑпиÑивања базе података: %s"
#: src/gdbmtool.c:1051
#, c-format
msgid "cannot load from %s: %s"
msgstr "не могу да учитам из %s: %s"
#: src/gdbmtool.c:1067
#, c-format
msgid "Database file: %s\n"
msgstr "Датотека базе података: %s\n"
#: src/gdbmtool.c:1069
msgid "No database name"
msgstr "Ðема назива базе података"
#: src/gdbmtool.c:1071
msgid "Database is open"
msgstr "База података је отворена"
#: src/gdbmtool.c:1073
msgid "Database is not open"
msgstr "База података није отворена"
#: src/gdbmtool.c:1127
#, c-format
msgid "unknown debug flag: %s"
msgstr "непозната заÑтавица прочишћавања: %s"
#: src/gdbmtool.c:1130
#, c-format
msgid "invalid type of argument %d"
msgstr "неиÑправна врÑта аргумента „%d“"
#: src/gdbmtool.c:1135
#, c-format
msgid "Debug flags:"
msgstr "ЗаÑтавице прочишћавања:"
#: src/gdbmtool.c:1141
msgid "none"
msgstr "ништа"
#: src/gdbmtool.c:1145
msgid "compiled without debug support"
msgstr "преведено је без подршке прочишћавања"
#: src/gdbmtool.c:1200
msgid "count (number of entries)"
msgstr "број (укупан број уноÑа)"
#: src/gdbmtool.c:1203 src/gdbmtool.c:1218 src/gdbmtool.c:1246
#: src/gdbmtool.c:1310
msgid "KEY"
msgstr "КЉУЧ"
#: src/gdbmtool.c:1206
msgid "delete a record"
msgstr "брише запиÑ"
#: src/gdbmtool.c:1209 src/gdbmtool.c:1224 src/gdbmtool.c:1549
msgid "FILE"
msgstr "ДÐТОТЕКÐ"
#: src/gdbmtool.c:1215
msgid "export"
msgstr "извози"
#: src/gdbmtool.c:1221
msgid "fetch record"
msgstr "довлачи запиÑ"
#: src/gdbmtool.c:1230
msgid "import"
msgstr "увози"
#: src/gdbmtool.c:1236
msgid "list"
msgstr "ÑпиÑак"
#: src/gdbmtool.c:1239
msgid "[KEY]"
msgstr "[КЉУЧ]"
#: src/gdbmtool.c:1243
msgid "nextkey"
msgstr "Ñледећи кључ"
#: src/gdbmtool.c:1247
msgid "DATA"
msgstr "ПОДÐЦИ"
#: src/gdbmtool.c:1251
msgid "store"
msgstr "Ñмешта"
#: src/gdbmtool.c:1257
msgid "firstkey"
msgstr "први кључ"
#: src/gdbmtool.c:1263
msgid "reorganize"
msgstr "преорганизује"
#: src/gdbmtool.c:1276
msgid "recover the database"
msgstr "опоравља базу података"
#: src/gdbmtool.c:1282
msgid "print avail list"
msgstr "иÑпиÑује доÑтупан ÑпиÑак"
#: src/gdbmtool.c:1285
msgid "NUMBER"
msgstr "БРОЈ"
#: src/gdbmtool.c:1289
msgid "print a bucket"
msgstr "иÑпиÑује ведро"
#: src/gdbmtool.c:1295
msgid "print current bucket"
msgstr "иÑпиÑује тренутно ведро"
#: src/gdbmtool.c:1301
msgid "print hash directory"
msgstr "иÑпиÑује хеш директоријум"
#: src/gdbmtool.c:1307
msgid "print database file header"
msgstr "иÑпиÑује заглавље датотеке базе података"
#: src/gdbmtool.c:1314
msgid "hash value of key"
msgstr "хеш вредноÑÑ‚ кључа"
#: src/gdbmtool.c:1320
msgid "print the bucket cache"
msgstr "иÑпиÑује оÑтаву ведра"
#: src/gdbmtool.c:1326
msgid "print current program status"
msgstr "иÑпиÑује Ñтање тренутног програма"
#: src/gdbmtool.c:1332
msgid "print version of gdbm"
msgstr "иÑпиÑује издање гдбм-а"
#: src/gdbmtool.c:1338
msgid "print this help list"
msgstr "иÑпиÑује овај ÑпиÑак помоћи"
#: src/gdbmtool.c:1344
msgid "quit the program"
msgstr "излази из програма"
#: src/gdbmtool.c:1350
msgid "set or list variables"
msgstr "подешава или наводи променљиве"
#: src/gdbmtool.c:1356
msgid "unset variables"
msgstr "поништава променљиве"
#: src/gdbmtool.c:1364
msgid "define datum structure"
msgstr "одређује Ñтруктуру датума"
#: src/gdbmtool.c:1371
msgid "source command script"
msgstr "ÑÐ¿Ð¸Ñ Ð½Ð°Ñ€ÐµÐ´Ð±Ðµ извора"
#: src/gdbmtool.c:1377
msgid "close the database"
msgstr "затвара базу података"
#: src/gdbmtool.c:1383
msgid "open new database"
msgstr "отвара нову базу података"
#: src/gdbmtool.c:1387
msgid "[FROM]"
msgstr "[ОД]"
#: src/gdbmtool.c:1388
msgid "[COUNT]"
msgstr "[БРОЈ]"
#: src/gdbmtool.c:1392
msgid "show input history"
msgstr "приказује иÑторијат улаза"
#: src/gdbmtool.c:1399
msgid "query/set debug level"
msgstr "пропитује/поÑтавља ниво прочишћавања"
#: src/gdbmtool.c:1529
msgid "Invalid command. Try ? for help."
msgstr "ÐеиÑправна наредба. Покушајте ? за помоћ."
#: src/gdbmtool.c:1530
msgid "Unknown command"
msgstr "Ðепозната наредба"
#: src/gdbmtool.c:1538
msgid "examine and/or modify a GDBM database"
msgstr "иÑпитује и/или мења ГДБМ базу података."
#: src/gdbmtool.c:1539
msgid "DBFILE [COMMAND [ARG ...]]"
msgstr ""
#: src/gdbmtool.c:1547 src/gdbmtool.c:1548
msgid "SIZE"
msgstr "ВЕЛИЧИÐÐ"
#: src/gdbmtool.c:1547
msgid "set block size"
msgstr "подешава величину блока"
#: src/gdbmtool.c:1548
msgid "set cache size"
msgstr "подешава величину оÑтаве"
#: src/gdbmtool.c:1549
msgid "read commands from FILE"
msgstr "чита наредбе из ДÐТОТЕКЕ"
#: src/gdbmtool.c:1551
msgid "disable file locking"
msgstr "иÑкључује закључавање датотеке"
#: src/gdbmtool.c:1552
msgid "do not use mmap"
msgstr "не кориÑти нмапу"
#: src/gdbmtool.c:1553
msgid "create database"
msgstr "Ñтвара базу података"
#: src/gdbmtool.c:1554
msgid "do not read .gdbmtoolrc file"
msgstr "не чита датотеку „.gdbmtoolrc“"
#: src/gdbmtool.c:1555
msgid "open database in read-only mode"
msgstr "отвара базу података у режиму Ñамо за читање"
#: src/gdbmtool.c:1556
msgid "synchronize to disk after each write"
msgstr "уÑаглашава Ñе Ñа диÑком након Ñваког упиÑа"
#: src/gdbmtool.c:1557
msgid "don't print initial banner"
msgstr "не штампа почетну врпцу"
#: src/gdbmtool.c:1559
msgid "enable lexical analyzer traces"
msgstr ""
#: src/gdbmtool.c:1560
msgid "enable grammar traces"
msgstr ""
#: src/gdbmtool.c:1831
#, c-format
msgid "cannot coerce %s to %s"
msgstr "не могу да приморам „%s“ на „%s“"
#: src/gdbmtool.c:1906
#, c-format
msgid "%s: not enough arguments"
msgstr "%s: нема довољно аргумената"
#: src/gdbmtool.c:1913
msgid "unexpected eof"
msgstr "неочекиван крај датотеке"
#: src/gdbmtool.c:1936
#, c-format
msgid "%s: too many arguments"
msgstr "%s: превише аргумената"
#: src/gdbmtool.c:1964
#, c-format
msgid "cannot run pager `%s': %s"
msgstr "не могу да покренем Ñтраничара „%s“: %s"
#: src/gdbmtool.c:2013
msgid "cannot find home directory"
msgstr "не могу да пронађем лични директоријум"
#: src/gdbmtool.c:2141
#, c-format
msgid "unknown option; try `%s -h' for more info"
msgstr "непозната опција; покушајте „%s -h“ за више података"
#: src/gdbmtool.c:2165
msgid "--file and command cannot be used together"
msgstr ""
#: src/gdbmtool.c:2187
#, c-format
msgid ""
"\n"
"Welcome to the gdbm tool. Type ? for help.\n"
"\n"
msgstr ""
"\n"
"Добродошли у гдбм програм. Укуцајте ? за помоћ.\n"
"\n"
#: src/gram.y:221
#, c-format
msgid "expected \"key\" or \"content\", but found \"%s\""
msgstr "очекивах „key“ или „content“, али нађох „%s“"
#: src/gram.y:292 src/gram.y:313 src/gram.y:345
#, c-format
msgid "no such variable: %s"
msgstr "нема такве променљиве: %s"
#: src/gram.y:296
#, c-format
msgid "%s is not a boolean variable"
msgstr "„%s“ није логичка променљива"
#: src/gram.y:300 src/gram.y:325
#, c-format
msgid "unexpected error setting %s: %d"
msgstr "неочекивана грешка подешавања %s: %d"
#: src/gram.y:317
#, c-format
msgid "%s: bad variable type"
msgstr "%s: лоша врÑта променљиве"
#: src/gram.y:321
#, c-format
msgid "%s: value %s is not allowed"
msgstr "%s: вредноÑÑ‚ „%s“ није дозвољена"
#: src/gram.y:349
#, c-format
msgid "%s: variable cannot be unset"
msgstr "%s: променљива не може бити поништена"
#: src/lex.l:96
msgid "recursive sourcing"
msgstr "дубинÑко извориште"
#: src/lex.l:98
#, c-format
msgid "%s already sourced here"
msgstr "„%s“ је већ изврело овде"
#: src/lex.l:204 src/lex.l:214
msgid "invalid #line statement"
msgstr "неиÑправно Ñтање „#line“"
#: src/datconv.c:254
#, c-format
msgid "(not enough data)"
msgstr "(нема довољно података)"
#: src/datconv.c:329
msgid "mixing tagged and untagged values is not allowed"
msgstr "није дозвољено мешање означених и неозначених вредноÑти"
#: src/datconv.c:362
msgid "cannot convert"
msgstr "не могу да претворим"
#: src/datconv.c:373
#, c-format
msgid "cannot convert value #%d: %s"
msgstr "не могу да претворим вредноÑÑ‚ „#%d“: %s"
#~ msgid "Wrong file offset"
#~ msgstr "Погрешан померај датотеке"
#~ msgid "cannot fetch data; the key was:"
#~ msgstr "не могу да довучем податке; кључ беше:"
#~ msgid "DBFILE"
#~ msgstr "ДÐТОТЕКÐБП"
#~ msgid "too many arguments"
#~ msgstr "има превише аргумената"
#~ msgid "cannot open `%s': %s"
#~ msgstr "не могу да отворим „%s“: %s"
#~ msgid "%s is not a regular file"
#~ msgstr "„%s“ није обична датотека"
#~ msgid "cannot open %s for reading: %s"
#~ msgstr "не могу да отворим „%s“ за читање: %s"
#~ msgid "Unknown update"
#~ msgstr "Ðепознато ажурирање"
#~ msgid "Unknown error"
#~ msgstr "Ðепозната грешка"
#~ msgid "gdbm fatal: %s\n"
#~ msgstr "кобноÑÑ‚ гдбм-а: %s\n"
gdbm-1.18.1/po/remove-potcdate.sin 0000644 0001750 0001750 00000000660 12764624130 013672 0000000 0000000 # Sed script that remove the POT-Creation-Date line in the header entry
# from a POT file.
#
# The distinction between the first and the following occurrences of the
# pattern is achieved by looking at the hold space.
/^"POT-Creation-Date: .*"$/{
x
# Test if the hold space is empty.
s/P/P/
ta
# Yes it was empty. First occurrence. Remove the line.
g
d
bb
:a
# The hold space was nonempty. Following occurrences. Do nothing.
x
:b
}
gdbm-1.18.1/po/stamp-po 0000644 0001750 0001750 00000000012 13364776740 011547 0000000 0000000 timestamp
gdbm-1.18.1/po/pt_BR.gmo 0000644 0001750 0001750 00000040322 13364776740 011606 0000000 0000000 Þ• Ý 3 ì
¸ ¹ Ú î . ÿ " . $ Q K v + Â î . C X m ‚ ˜ ® Ã Ø ù % B X q ˆ ¤ Á Ò Ö è
1 G < ' „ ¬ $ Æ ë ý
. C V e v … Š ¥ ¸ Í Þ ö * / L h … $ ‹ ° À Ð à ñ $ E ] l ƒ 1 ‡ ¹ ¾ Ô ì s - ¡ µ ¹ À Ñ Ú î
&