diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-08-06 09:26:34 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-08-06 09:26:34 +0000 |
commit | 69653d34920e1b340f648a6787aefb2fb3dae15f (patch) | |
tree | 6e1f07b325fbd7b644d41c1b4da55cfe62d633a7 /doc/gdbm.texinfo | |
parent | 0d47d7c9c540c82287e0ab44889e21ce0a68749e (diff) | |
download | gdbm-69653d34920e1b340f648a6787aefb2fb3dae15f.tar.gz gdbm-69653d34920e1b340f648a6787aefb2fb3dae15f.tar.bz2 |
Document gdbm_version_cmp.
Diffstat (limited to 'doc/gdbm.texinfo')
-rw-r--r-- | doc/gdbm.texinfo | 53 |
1 files changed, 39 insertions, 14 deletions
diff --git a/doc/gdbm.texinfo b/doc/gdbm.texinfo index 3553d0b..8dcb1cb 100644 --- a/doc/gdbm.texinfo +++ b/doc/gdbm.texinfo | |||
@@ -1094,6 +1094,23 @@ Use @code{gdbm_strerror} (@pxref{Errors}) to convert it to a | |||
1094 | descriptive text. | 1094 | descriptive text. |
1095 | @end deftypevar | 1095 | @end deftypevar |
1096 | 1096 | ||
1097 | @deftypevar const char * const gdbm_errlist[] | ||
1098 | This variable is an array of error descriptions, which is used by | ||
1099 | @code{gdbm_strerror} to convert error codes to human-readable text | ||
1100 | (@pxref{Errors}). You can access it directly, if you wish so. It | ||
1101 | contains @code{_GDBM_MAX_ERRNO + 1} elements and can be directly | ||
1102 | indexed by the error code to obtain a corresponding descriptive | ||
1103 | text. | ||
1104 | @end deftypevar | ||
1105 | |||
1106 | @defvr {Constant} _GDBM_MIN_ERRNO | ||
1107 | The minimum error code used by @code{gdbm}. | ||
1108 | @end defvr | ||
1109 | |||
1110 | @defvr {Constant} _GDBM_MAX_ERRNO | ||
1111 | The maximum error code used by @code{gdbm}. | ||
1112 | @end defvr | ||
1113 | |||
1097 | @deftypevar const char *gdbm_version | 1114 | @deftypevar const char *gdbm_version |
1098 | A string containing the version information. | 1115 | A string containing the version information. |
1099 | @end deftypevar | 1116 | @end deftypevar |
@@ -1128,22 +1145,30 @@ Patchlevel number. | |||
1128 | These can be used to verify whether the header file matches the library. | 1145 | These can be used to verify whether the header file matches the library. |
1129 | @end deftypevar | 1146 | @end deftypevar |
1130 | 1147 | ||
1131 | @deftypevar const char * const gdbm_errlist[] | 1148 | To compare two split-out version numbers, use the following function: |
1132 | This variable is an array of error descriptions, which is used by | ||
1133 | @code{gdbm_strerror} to convert error codes to human-readable text | ||
1134 | (@pxref{Errors}). You can access it directly, if you wish so. It | ||
1135 | contains @code{_GDBM_MAX_ERRNO + 1} elements and can be directly | ||
1136 | indexed by the error code to obtain a corresponding descriptive | ||
1137 | text. | ||
1138 | @end deftypevar | ||
1139 | 1149 | ||
1140 | @defvr {Constant} _GDBM_MIN_ERRNO | 1150 | @deftypefn {gdbm interface} int gdbm_version_cmp (int const @var{a}[3], @ |
1141 | The minimum error code used by @code{gdbm}. | 1151 | int const @var{b}[3]) |
1142 | @end defvr | 1152 | Compare two version numbers. Return @samp{-1} if @var{a} is less than |
1153 | @var{b}, @samp{1} if @var{a} is greater than @var{b} and @samp{0} if | ||
1154 | they are equal. | ||
1143 | 1155 | ||
1144 | @defvr {Constant} _GDBM_MAX_ERRNO | 1156 | Comparison is done from left to right, so that: |
1145 | The maximum error code used by @code{gdbm}. | 1157 | |
1146 | @end defvr | 1158 | @example |
1159 | a = @{ 1, 8, 3 @}; | ||
1160 | b = @{ 1, 8, 3 @}; | ||
1161 | gdbm_version_cmp (a, b) @result{} 0 | ||
1162 | |||
1163 | a = @{ 1, 8, 3 @}; | ||
1164 | b = @{ 1, 8, 2 @}; | ||
1165 | gdbm_version_cmp (a, b) @result{} 1 | ||
1166 | |||
1167 | a = @{ 1, 8, 3 @}; | ||
1168 | b = @{ 1, 9. 0 @}; | ||
1169 | gdbm_version_cmp (a, b) @result{} -1 | ||
1170 | @end example | ||
1171 | @end deftypefn | ||
1147 | 1172 | ||
1148 | @node Error codes | 1173 | @node Error codes |
1149 | @chapter Error codes | 1174 | @chapter Error codes |