]> git.ozlabs.org Git - ccan/blob - ccan/err/_info
5a5752bb0b297418486200661ec69db71d84dbdf
[ccan] / ccan / err / _info
1 #include <stdio.h>
2 #include <string.h>
3 #include "config.h"
4
5 /**
6  * err - err(), errx(), warn() and warnx(), as per BSD's err.h.
7  *
8  * A few platforms don't provide err.h; for those, this provides replacements.
9  * For most, it simple includes the system err.h.
10  *
11  * Example:
12  *      #include <ccan/err/err.h>
13  *
14  *      int main(int argc, char *argv[])
15  *      {
16  *              if (argc != 1)
17  *                      errx(1, "Expect no arguments");
18  *              exit(0);
19  *      }
20  *
21  * License: Public domain
22  * Author: Rusty Russell <rusty@rustcorp.com.au>
23  */
24 int main(int argc, char *argv[])
25 {
26         if (argc != 2)
27                 return 1;
28
29         if (strcmp(argv[1], "depends") == 0) {
30 #if !HAVE_ERR_H
31                 printf("ccan/compiler\n");
32 #endif
33                 return 0;
34         }
35
36         return 1;
37 }