Changes To Manual for lc_geterrno

Changes to "Manual for lc_geterrno" between 2014-11-24 20:10:44 and 2014-11-24 20:11:48

            1  +<H2>NAME</H2>
            2  +lc_geterrno - Retrieve a numeric error code.
            3  +<P>
            4  +<A NAME="lbAC">&nbsp;</A>
            5  +<H2>SYNOPSIS</H2>
            6  +<B>#include &lt;<A HREF="artifact/7c61a9805e664fde7943807af8d5e164e7cebdb6">libconfig.h</A>&gt;</B>
            7  +<P>
            8  +<B>lc_err_t lc_geterrno(void);</B>
            9  +<P>
           10  +<A NAME="lbAD">&nbsp;</A>
           11  +<H2>DESCRIPTION</H2>
           12  +The
           13  +<B><A HREF="wiki/Manual for lc_geterrno">lc_geterrno</A></B>(3)
           14  +function returns the last numeric error code set as an
           15  +<I>lc_err_t</I>
           16  +which is an enumerated type and can be cast to any integer type.
           17  +<P>
           18  +The
           19  +<I>lc_err_t</I>
           20  +type specifies the following defined values:
           21  +<DL COMPACT>
           22  +<DT>LC_ERR_NONE<DD>
           23  +No error was found.  Success.
           24  +<DT>LC_ERR_INVCMD<DD>
           25  +A command was specified for which there was no handler.
           26  +<DT>LC_ERR_INVSECTION<DD>
           27  +A section was specified for which there was no handler.
           28  +<DT>LC_ERR_INVDATA<DD>
           29  +A value that does not make sense was specified, such as a non-existant type to the
           30  +<B><A HREF="wiki/Manual for lc_process_file">lc_process_file</A></B>(3)
           31  +function.
           32  +<DT>LC_ERR_BADFORMAT<DD>
           33  +An invalid format was detected, such as no argument where on was expected, or a value passed to a boolean-specified variable whose value was not one of: enable, true, yes, on, y, 1, disable, false, off, no, n, 0.
           34  +<DT>LC_ERR_CANTOPEN<DD>
           35  +Unable to open a specified file.
           36  +<DT>LC_ERR_CALLBACK<DD>
           37  +A callback function returned an error (LC_CBRET_ERROR).
           38  +<DT>LC_ERR_ENOMEM<DD>
           39  +Memory could not be allocated for internal structures.
           40  +<P>
           41  +</DL>
           42  +<A NAME="lbAE">&nbsp;</A>
           43  +<H2>EXAMPLE</H2>
           44  +<PRE>
           45  +#include &lt;<A HREF="artifact/7c61a9805e664fde7943807af8d5e164e7cebdb6">libconfig.h</A>&gt;
           46  +#include &lt;<A HREF="file:/usr/include/stdlib.h">stdlib.h</A>&gt;
           47  +#include &lt;<A HREF="file:/usr/include/stdio.h">stdio.h</A>&gt;
           48  +int main(int argc, char **argv) {
           49  +        int lc_p_ret, lc_rv_ret;
           50  +        char *filename = NULL;
           51  +        lc_rv_ret = lc_register_var(&quot;File&quot;, LC_VAR_STRING,
           52  +                                    &amp;filename, 'f');
           53  +        if (lc_rv_ret != 0) {
           54  +                fprintf(stderr, &quot;Error registering variable: %i.\n&quot;,
           55  +                        lc_geterrno());
           56  +                return(EXIT_FAILURE);
           57  +        }
           58  +        lc_p_ret = lc_process(argc, argv, &quot;example&quot;, LC_CONF_APACHE,
           59  +                              NULL);
           60  +        lc_cleanup();
           61  +        if (lc_p_ret != 0) {
           62  +                fprintf(stderr, &quot;Error processing configuration: \
           63  +                        %s\n&quot;, lc_geterrstr());
           64  +                return(EXIT_FAILURE);
           65  +        }
           66  +        if (filename != NULL) {
           67  +                printf(&quot;File specified was: %s\n&quot;, filename);
           68  +        } else {
           69  +                printf(&quot;No filename specified.\n&quot;);
           70  +        }
           71  +        return(EXIT_SUCCESS);
           72  +}
           73  +</PRE>
           74  +<P>
           75  +<A NAME="lbAF">&nbsp;</A>
           76  +<H2>SEE ALSO</H2>
           77  +<B><A HREF="wiki/Manual">libconfig</A></B>(3),
           78  +<B><A HREF="wiki/Manual for lc_register_var">lc_register_var</A></B>(3),
           79  +<B><A HREF="wiki/Manual for lc_register_callback">lc_register_callback</A></B>(3),
           80  +<B><A HREF="wiki/Manual for lc_geterrstr">lc_geterrstr</A></B>(3),
           81  +<B><A HREF="wiki/Manual for lc_seterrstr">lc_seterrstr</A></B>(3),
           82  +<B><A HREF="wiki/Manual for lc_handle_type">lc_handle_type</A></B>(3),
           83  +<B><A HREF="wiki/Manual for lc_process">lc_process</A></B>(3),
           84  +<B><A HREF="wiki/Manual for lc_process_file">lc_process_file</A></B>(3),
           85  +<B><A HREF="wiki/Manual for lc_cleanup">lc_cleanup</A></B>(3)
           86  +<P>