gsasl  1.10.0
About: GNU SASL is an implementation of the Simple Authentication and Security Layer (SASL). Development version.
  Fossies Dox: gsasl-1.10.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

print-errors.c
Go to the documentation of this file.
1 /* print-errors.c --- Print error codes.
2  * Copyright (C) 2002-2021 Simon Josefsson
3  *
4  * This file is part of GNU SASL.
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #ifdef HAVE_CONFIG_H
22 #include "config.h"
23 #endif
24 
25 #include <stdio.h>
26 #include <stdarg.h>
27 #include <stdlib.h>
28 #include <string.h>
29 
30 #include <gsasl.h>
31 
32 int
33 main (void)
34 {
35  const char *this = NULL, *last = NULL;
36  const char *name;
37  size_t i = 0;
38 
39  printf ("@c This file is automatically generated. DO NOT EDIT!\n");
40  printf ("@c Instead, edit print-errors.c and re-run.\n");
41 
42  do
43  {
44  last = this;
45 
46  this = gsasl_strerror (i);
48 
49  if (name != NULL)
50  printf ("\n@item @code{%s}\n%s\n", name, this);
51 
52  if (this == NULL)
53  return EXIT_FAILURE;
54 
55  i++;
56  }
57  while (this != last);
58 
59  return EXIT_SUCCESS;
60 }
#define NULL
Definition: stddef.in.h:72
#define EXIT_SUCCESS
Definition: stdlib.in.h:123
#define EXIT_FAILURE
Definition: stdlib.in.h:128
const char * name
Definition: error.c:43
const char * gsasl_strerror(int err)
Definition: error.c:228
const char * gsasl_strerror_name(int err)
Definition: error.c:266
int main(void)
Definition: print-errors.c:33