[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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. See section Error codes, for a list of available error codes and their descriptions.Use
gdbm_strerror
(see section Error strings.) 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 (see section Error strings.). 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_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
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on December 2, 2011 using texi2html 5.0.