From 5fdffde89ad7a24001b8aa49c243fbbcd6fedbbf Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 28 May 2014 06:17:08 +0200 Subject: info: errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- info/libgamma.texinfo | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'info/libgamma.texinfo') diff --git a/info/libgamma.texinfo b/info/libgamma.texinfo index 1869145..2a7ea57 100644 --- a/info/libgamma.texinfo +++ b/info/libgamma.texinfo @@ -29,6 +29,9 @@ Texts. A copy of the license is included in the section entitled @end quotation @end copying +£>set -u +£>cd info + @ifnottex @node Top @top libgamma -- Display server abstraction layer for gamma ramp adjustments @@ -382,6 +385,10 @@ and for the freedom of all. @node API @chapter API +@menu +* Errors:: Error codes and how to handle errors. +@end menu + To use @command{libgamma} add ``@code{#include }'' to and C file or C header file that requires anything from @command{libgamma}. @file{libgamma.h} is the only @@ -446,6 +453,47 @@ You may also want to add checks for update to +@node Errors +@section Errors + +Many @command{libgamma} functions will return +@command{libgamma} specific error codes rather +than setting @code{errno} and return @code{-1}. +However @code{errno} may have been set, but +should in such case be ignored unless +@code{LIBGAMMA_ERRNO_SET} has been returned. +Other functions do set @code{errno} and return +@code{-1}. Other functions may store the error +code. In this case @code{LIBGAMMA_ERRNO_SET} +cannot be stored but the value that @code{errno} +had when an error occured can be stored instead +of a @command{libgamma} specific error codes. +@code{errno} values are allows positive whereas +@command{libgamma} specific error codes are +allows negative. On success zero is returned +or stored. + +If @code{LIBGAMMA_DEVICE_REQUIRE_GROUP} is returned +the ID of the required group is stored in +@code{libgamma_group_gid} and the name of that +group is stored in @code{libgamma_group_name}. +@code{NULL} is stored if the name of the group +cannto be determined. @file{libgamma.h} give +you access to these variables, they are defined +as @code{gid_t} and @code{const char*} types +respectively. + +@command{libgamma} defines the following error codes +that its functions may return: +@table @code +£>for err in $(libgamma-error-extract --list); do +@item £{err} +£>libgamma-error-extract $err | texise +£>done +@end table + + + @node GNU Free Documentation License @appendix GNU Free Documentation License @include fdl.texinfo -- cgit v1.2.3-70-g09d2