manpagez: man pages & more
info gdbm
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17 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.

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:

IndexMeaning
0Major number
1Minor number
2Patchlevel 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 January 24, 2014 using texi2html 5.0.

© manpagez.com 2000-2017
Individual documents may contain additional copyright information.