X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=ggo.c;h=b9852b991530f5b7bcdbd3e3a218f7d7d0222dfd;hp=86642eb5a460c2af3b494c243fa4514726a16239;hb=bc086fe5537bd3078b920454958b61287a75c568;hpb=6bdac07456cb5872f824028912d1049883a9c21f diff --git a/ggo.c b/ggo.c index 86642eb5..b9852b99 100644 --- a/ggo.c +++ b/ggo.c @@ -10,6 +10,11 @@ #include "para.h" #include "ggo.h" +/** + * Wrapper for printf() that exits on errors. + * + * \param fmt Usual format string. + */ __printf_1_2 void printf_or_die(const char *fmt, ...) { va_list argp; @@ -20,9 +25,15 @@ __printf_1_2 void printf_or_die(const char *fmt, ...) va_end(argp); if (ret >= 0) return; - fprintf(stderr, "%s: %s\n", __FUNCTION__, strerror(errno)); + exit(EXIT_FAILURE); } +/** + * Print one of the two given help texts. + * + * \param help contains the help texts. + * \param detailed_help Whether to print the detailed help text. + */ void ggo_print_help(struct ggo_help *help, int detailed_help) { const char **p;