1 /* Sample code to dump all error codes and their descriptions */
8 int main(int argc
, char **argv
)
11 gboolean numeric
= FALSE
, manpage
= FALSE
, doc
= FALSE
;
13 const char *errorstring
;
14 const char *errorname
;
16 if (argc
>= 2 && strcmp(argv
[1], "-n") == 0) {
20 if (argc
>= 2 && strcmp(argv
[1], "-m") == 0) {
24 if (argc
>= 2 && strcmp(argv
[1], "-d") == 0) {
28 for (error
= ERR_NONE
; error
< ERR_LAST_VALUE
; error
++) {
29 errorstring
= GSM_ErrorString(error
);
30 errorname
= GSM_ErrorName(error
);
31 if (strcmp("Unknown error description.", errorstring
) == 0) {
32 fprintf(stderr
, "Unknown error message for %d!\n", error
);
35 if (errorname
== NULL
) {
36 fprintf(stderr
, "Unknown error name for %d!\n", error
);
40 printf("%d. %s - %s\n", error
, errorname
, errorstring
);
42 printf(".SS %d\n%s\n", 100 + error
, errorstring
);
44 printf("%d\n %s\n", 100 + error
, errorstring
);
46 printf("# %s - %s\n", errorname
, errorstring
);
53 /* Editor configuration
54 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: