diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2022-11-29 02:24:47 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2022-11-29 02:24:47 +0000 |
commit | 06011c29aef19d8ed90ebf48095e1ff2a846ba23 (patch) | |
tree | a86aecdaec810635cbd4ae92b9b69f5ce9f55fa4 /src | |
parent | 1f8f72ced6a4d7043e5b47d22960cde96fbb1a71 (diff) | |
download | skalibs-06011c29aef19d8ed90ebf48095e1ff2a846ba23.tar.xz |
Prepare for 2.13.0.0, revamp strerr
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src')
76 files changed, 1013 insertions, 464 deletions
diff --git a/src/include/skalibs/lolstdio.h b/src/include/skalibs/lolstdio.h index 58689cf..63c98a6 100644 --- a/src/include/skalibs/lolstdio.h +++ b/src/include/skalibs/lolstdio.h @@ -7,7 +7,7 @@ #include <skalibs/buffer.h> #include <skalibs/bufalloc.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #ifdef DEBUG # define LOLDEBUG(...) do \ diff --git a/src/include/skalibs/skalibs.h b/src/include/skalibs/skalibs.h index c1eaf81..60c9577 100644 --- a/src/include/skalibs/skalibs.h +++ b/src/include/skalibs/skalibs.h @@ -15,6 +15,7 @@ #include <skalibs/posixplz.h> #include <skalibs/stddjb.h> +#include <skalibs/strerr.h> #include <skalibs/stdcrypto.h> #include <skalibs/random.h> #include <skalibs/datastruct.h> diff --git a/src/include/skalibs/stddjb.h b/src/include/skalibs/stddjb.h index 4f0d739..e044895 100644 --- a/src/include/skalibs/stddjb.h +++ b/src/include/skalibs/stddjb.h @@ -46,8 +46,6 @@ #include <skalibs/skamisc.h> #include <skalibs/socket.h> #include <skalibs/stralloc.h> -#include <skalibs/strerr.h> -#include <skalibs/strerr2.h> #include <skalibs/tai.h> #endif diff --git a/src/include/skalibs/strerr.h b/src/include/skalibs/strerr.h index 34b0d3c..de205d5 100644 --- a/src/include/skalibs/strerr.h +++ b/src/include/skalibs/strerr.h @@ -5,135 +5,364 @@ #include <skalibs/gccattributes.h> -extern void strerr_warn (char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) ; -extern void strerr_die (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; -extern void strerr_warnsys (char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) ; -extern void strerr_diesys (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; - -#define strerr_warn10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, se) \ -strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, se) -#define strerr_warn9(x1, x2, x3, x4, x5, x6, x7, x8, x9, se) \ -strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, x9, 0, se) -#define strerr_warn8(x1, x2, x3, x4, x5, x6, x7, x8, se) \ -strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, 0, 0, se) -#define strerr_warn7(x1, x2, x3, x4, x5, x6, x7, se) \ -strerr_warn(x1, x2, x3, x4, x5, x6, x7, 0, 0, 0, se) -#define strerr_warn6(x1, x2, x3, x4, x5, x6, se) \ -strerr_warn(x1, x2, x3, x4, x5, x6, 0, 0, 0, 0, se) -#define strerr_warn5(x1, x2, x3, x4, x5, se) \ -strerr_warn(x1, x2, x3, x4, x5, 0, 0, 0, 0, 0, se) -#define strerr_warn4(x1, x2, x3, x4, se) \ -strerr_warn(x1, x2, x3, x4, 0, 0, 0, 0, 0, 0, se) -#define strerr_warn3(x1, x2, x3, se) \ -strerr_warn(x1, x2, x3, 0, 0, 0, 0, 0, 0, 0, se) -#define strerr_warn2(x1, x2, se) \ -strerr_warn(x1, x2, 0, 0, 0, 0, 0, 0, 0, 0, se) -#define strerr_warn1(x1, se) \ -strerr_warn(x1, 0, 0, 0, 0, 0, 0, 0, 0, 0, se) - -#define strerr_warn10sys(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) \ -strerr_warnsys(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) -#define strerr_warn9sys(x1, x2, x3, x4, x5, x6, x7, x8, x9) \ -strerr_warnsys(x1, x2, x3, x4, x5, x6, x7, x8, (x9), 0) -#define strerr_warn8sys(x1, x2, x3, x4, x5, x6, x7, x8) \ -strerr_warnsys(x1, x2, x3, x4, x5, x6, x7, (x8), 0, 0) -#define strerr_warn7sys(x1, x2, x3, x4, x5, x6, x7) \ -strerr_warnsys(x1, x2, x3, x4, x5, x6, (x7), 0, 0, 0) -#define strerr_warn6sys(x1, x2, x3, x4, x5, x6) \ -strerr_warnsys(x1, x2, x3, x4, x5, (x6), 0, 0, 0, 0) -#define strerr_warn5sys(x1, x2, x3, x4, x5) \ -strerr_warnsys(x1, x2, x3, x4, (x5), 0, 0, 0, 0, 0) -#define strerr_warn4sys(x1, x2, x3, x4) \ -strerr_warnsys(x1, x2, x3, (x4), 0, 0, 0, 0, 0, 0) -#define strerr_warn3sys(x1, x2, x3) \ -strerr_warnsys(x1, x2, (x3), 0, 0, 0, 0, 0, 0, 0) -#define strerr_warn2sys(x1, x2) \ -strerr_warnsys(x1, (x2), 0, 0, 0, 0, 0, 0, 0, 0) -#define strerr_warn1sys(x1) \ -strerr_warnsys((x1), 0, 0, 0, 0, 0, 0, 0, 0, 0) - -#define strerr_warn10x(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) \ -strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, x9, (x10), 0) -#define strerr_warn9x(x1, x2, x3, x4, x5, x6, x7, x8, x9) \ -strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, (x9), 0, 0) -#define strerr_warn8x(x1, x2, x3, x4, x5, x6, x7, x8) \ -strerr_warn(x1, x2, x3, x4, x5, x6, x7, (x8), 0, 0, 0) -#define strerr_warn7x(x1, x2, x3, x4, x5, x6, x7) \ -strerr_warn(x1, x2, x3, x4, x5, x6, (x7), 0, 0, 0, 0) -#define strerr_warn6x(x1, x2, x3, x4, x5, x6) \ -strerr_warn(x1, x2, x3, x4, x5, (x6), 0, 0, 0, 0, 0) -#define strerr_warn5x(x1, x2, x3, x4, x5) \ -strerr_warn(x1, x2, x3, x4, (x5), 0, 0, 0, 0, 0, 0) -#define strerr_warn4x(x1, x2, x3, x4) \ -strerr_warn(x1, x2, x3, (x4), 0, 0, 0, 0, 0, 0, 0) -#define strerr_warn3x(x1, x2, x3) \ -strerr_warn(x1, x2, (x3), 0, 0, 0, 0, 0, 0, 0, 0) -#define strerr_warn2x(x1, x2) \ -strerr_warn(x1, (x2), 0, 0, 0, 0, 0, 0, 0, 0, 0) -#define strerr_warn1x(x1) \ -strerr_warn((x1), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - -#define strerr_die10(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, se) \ -strerr_die(e, x1, x2, x3, x4, x5 , x6, x7, x8, x9, x10, se) -#define strerr_die9(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, se) \ -strerr_die(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, 0, se) -#define strerr_die8(e, x1, x2, x3, x4, x5, x6, x7, x8, se) \ -strerr_die(e, x1, x2, x3, x4, x5, x6, x7, x8, 0, 0, se) -#define strerr_die7(e, x1, x2, x3, x4, x5, x6, x7, se) \ -strerr_die(e, x1, x2, x3, x4, x5, x6, x7, 0, 0, 0, se) -#define strerr_die6(e, x1, x2, x3, x4, x5, x6, se) \ -strerr_die(e, x1, x2, x3, x4, x5, x6, 0, 0, 0, 0, se) -#define strerr_die5(e, x1, x2, x3, x4, x5, se) \ -strerr_die(e, x1, x2, x3, x4, x5, 0, 0, 0, 0, 0, se) -#define strerr_die4(e, x1, x2, x3, x4, se) \ -strerr_die(e, x1, x2, x3, x4, 0, 0, 0, 0, 0, 0, se) -#define strerr_die3(e, x1, x2, x3, se) \ -strerr_die(e, x1, x2, x3, 0, 0, 0, 0, 0, 0, 0, se) -#define strerr_die2(e, x1, x2, se) \ -strerr_die(e, x1, x2, 0, 0, 0, 0, 0, 0, 0, 0, se) -#define strerr_die1(e, x1, se) \ -strerr_die(e, x1, 0, 0, 0, 0, 0, 0, 0, 0, 0, se) - -#define strerr_die10sys(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) \ -strerr_diesys(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) -#define strerr_die9sys(e, x1, x2, x3, x4, x5, x6, x7, x8, x9) \ -strerr_diesys(e, x1, x2, x3, x4, x5, x6, x7, x8, (x9), 0) -#define strerr_die8sys(e, x1, x2, x3, x4, x5, x6, x7, x8) \ -strerr_diesys(e, x1, x2, x3, x4, x5, x6, x7, (x8), 0, 0) -#define strerr_die7sys(e, x1, x2, x3, x4, x5, x6, x7) \ -strerr_diesys(e, x1, x2, x3, x4, x5, x6, (x7), 0, 0, 0) -#define strerr_die6sys(e, x1, x2, x3, x4, x5, x6) \ -strerr_diesys(e, x1, x2, x3, x4, x5, (x6), 0, 0, 0, 0) -#define strerr_die5sys(e, x1, x2, x3, x4, x5) \ -strerr_diesys(e, x1, x2, x3, x4, (x5), 0, 0, 0, 0, 0) -#define strerr_die4sys(e, x1, x2, x3, x4) \ -strerr_diesys(e, x1, x2, x3, (x4), 0, 0, 0, 0, 0, 0) -#define strerr_die3sys(e, x1, x2, x3) \ -strerr_diesys(e, x1, x2, (x3), 0, 0, 0, 0, 0, 0, 0) -#define strerr_die2sys(e, x1, x2) \ -strerr_diesys(e, x1, (x2), 0, 0, 0, 0, 0, 0, 0, 0) -#define strerr_die1sys(e, x1) \ -strerr_diesys(e, (x1), 0, 0, 0, 0, 0, 0, 0, 0, 0) - -#define strerr_die10x(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) \ -strerr_die(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, (x10), 0) -#define strerr_die9x(e, x1, x2, x3, x4, x5, x6, x7, x8, x9) \ -strerr_die(e, x1, x2, x3, x4, x5, x6, x7, x8, (x9), 0, 0) -#define strerr_die8x(e, x1, x2, x3, x4, x5, x6, x7, x8) \ -strerr_die(e, x1, x2, x3, x4, x5, x6, x7, (x8), 0, 0, 0) -#define strerr_die7x(e, x1, x2, x3, x4, x5, x6, x7) \ -strerr_die(e, x1, x2, x3, x4, x5, x6, (x7), 0, 0, 0, 0) -#define strerr_die6x(e, x1, x2, x3, x4, x5, x6) \ -strerr_die(e, x1, x2, x3, x4, x5, (x6), 0, 0, 0, 0, 0) -#define strerr_die5x(e, x1, x2, x3, x4, x5) \ -strerr_die(e, x1, x2, x3, x4, (x5), 0, 0, 0, 0, 0, 0) -#define strerr_die4x(e, x1, x2, x3, x4) \ -strerr_die(e, x1, x2, x3, (x4), 0, 0, 0, 0, 0, 0, 0) -#define strerr_die3x(e, x1, x2, x3) \ -strerr_die(e, x1, x2, (x3), 0, 0, 0, 0, 0, 0, 0, 0) -#define strerr_die2x(e, x1, x2) \ -strerr_die(e, x1, (x2), 0, 0, 0, 0, 0, 0, 0, 0, 0) -#define strerr_die1x(e, x1) \ -strerr_die(e, (x1), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) +extern void strerr_warnv (char const *const *, unsigned int) ; +extern void strerr_warnvsys (char const *const *, unsigned int) ; +extern void strerr_diev (int, char const *const *, unsigned int) gccattr_noreturn ; +extern void strerr_dievsys(int, char const *const *, unsigned int) gccattr_noreturn ; + +extern void strerr_warnl (unsigned int, ...) ; +extern void strerr_warnlsys (unsigned int, ...) ; +extern void strerr_diel (int, unsigned int, ...) gccattr_noreturn ; +extern void strerr_dielsys (int, unsigned int, ...) gccattr_noreturn ; + +extern void strerr_warn1x (char const *) ; +extern void strerr_warn2x (char const *, char const *) ; +extern void strerr_warn3x (char const *, char const *, char const *) ; +extern void strerr_warn4x (char const *, char const *, char const *, char const *) ; +extern void strerr_warn5x (char const *, char const *, char const *, char const *, char const *) ; +extern void strerr_warn6x (char const *, char const *, char const *, char const *, char const *, char const *) ; +extern void strerr_warn7x (char const *, char const *, char const *, char const *, char const *, char const *, char const *) ; +extern void strerr_warn8x (char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) ; +extern void strerr_warn9x (char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) ; +extern void strerr_warn10x (char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) ; +extern void strerr_warn11x (char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) ; + +extern void strerr_warn1sys (char const *) ; +extern void strerr_warn2sys (char const *, char const *) ; +extern void strerr_warn3sys (char const *, char const *, char const *) ; +extern void strerr_warn4sys (char const *, char const *, char const *, char const *) ; +extern void strerr_warn5sys (char const *, char const *, char const *, char const *, char const *) ; +extern void strerr_warn6sys (char const *, char const *, char const *, char const *, char const *, char const *) ; +extern void strerr_warn7sys (char const *, char const *, char const *, char const *, char const *, char const *, char const *) ; +extern void strerr_warn8sys (char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) ; +extern void strerr_warn9sys (char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) ; +extern void strerr_warn10sys (char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) ; +extern void strerr_warn11sys (char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) ; + +extern void strerr_die1x (int, char const *) gccattr_noreturn ; +extern void strerr_die2x (int, char const *, char const *) gccattr_noreturn ; +extern void strerr_die3x (int, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die4x (int, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die5x (int, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die6x (int, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die7x (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die8x (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die9x (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die10x (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die11x (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; + +extern void strerr_die1sys (int, char const *) gccattr_noreturn ; +extern void strerr_die2sys (int, char const *, char const *) gccattr_noreturn ; +extern void strerr_die3sys (int, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die4sys (int, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die5sys (int, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die6sys (int, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die7sys (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die8sys (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die9sys (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die10sys (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; +extern void strerr_die11sys (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ; + +extern char const *PROG ; + +#define strerr_warnw1x(x1) \ +strerr_warn3x(PROG, ": warning: ", (x1)) +#define strerr_warnw2x(x1, x2) \ +strerr_warn4x(PROG, ": warning: ", (x1), x2) +#define strerr_warnw3x(x1, x2, x3) \ +strerr_warn5x(PROG, ": warning: ", (x1), x2, x3) +#define strerr_warnw4x(x1, x2, x3, x4) \ +strerr_warn6x(PROG, ": warning: ", (x1), x2, x3, x4) +#define strerr_warnw5x(x1, x2, x3, x4, x5) \ +strerr_warn7x(PROG, ": warning: ", (x1), x2, x3, x4, x5) +#define strerr_warnw6x(x1, x2, x3, x4, x5, x6) \ +strerr_warn8x(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6) +#define strerr_warnw7x(x1, x2, x3, x4, x5, x6, x7) \ +strerr_warn9x(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6, x7) +#define strerr_warnw8x(x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_warn10x(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6, x7, x8) +#define strerr_warnw9x(x1, x2, x3, x4, x5, x6, x7, x8, x9) \ +strerr_warn11x(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6, x7, x8, x9) + +#define strerr_warnw1sys(x1) \ +strerr_warn3sys(PROG, ": warning: ", (x1)) +#define strerr_warnw2sys(x1, x2) \ +strerr_warn4sys(PROG, ": warning: ", (x1), x2) +#define strerr_warnw3sys(x1, x2, x3) \ +strerr_warn5sys(PROG, ": warning: ", (x1), x2, x3) +#define strerr_warnw4sys(x1, x2, x3, x4) \ +strerr_warn6sys(PROG, ": warning: ", (x1), x2, x3, x4) +#define strerr_warnw5sys(x1, x2, x3, x4, x5) \ +strerr_warn7sys(PROG, ": warning: ", (x1), x2, x3, x4, x5) +#define strerr_warnw6sys(x1, x2, x3, x4, x5, x6) \ +strerr_warn8sys(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6) +#define strerr_warnw7sys(x1, x2, x3, x4, x5, x6, x7) \ +strerr_warn9sys(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6, x7) +#define strerr_warnw8sys(x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_warn10sys(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6, x7, x8) +#define strerr_warnw9sys(x1, x2, x3, x4, x5, x6, x7, x8, x9) \ +strerr_warn11sys(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6, x7, x8, x9) + +#define strerr_diew1x(e, x1) \ +strerr_die3x(e, PROG, ": warning: ", x1) +#define strerr_diew2x(e, x1, x2) \ +strerr_die4x(e, PROG, ": warning: ", x1, x2) +#define strerr_diew3x(e, x1, x2, x3) \ +strerr_die5x(e, PROG, ": warning: ", x1, x2, x3) +#define strerr_diew4x(e, x1, x2, x3, x4) \ +strerr_die6x(e, PROG, ": warning: ", x1, x2, x3, x4) +#define strerr_diew5x(e, x1, x2, x3, x4, x5) \ +strerr_die7x(e, PROG, ": warning: ", x1, x2, x3, x4, x5) +#define strerr_diew6x(e, x1, x2, x3, x4, x5, x6) \ +strerr_die8x(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6) +#define strerr_diew7x(e, x1, x2, x3, x4, x5, x6, x7) \ +strerr_die9x(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6, x7) +#define strerr_diew8x(e, x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_die10x(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6, x7, x8) +#define strerr_diew9x(e, x1, x2, x3, x4, x5, x6, x7, x8, x9) \ +strerr_die11x(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6, x7, x8, x9) + +#define strerr_diew1sys(e, x1) \ +strerr_die3sys(e, PROG, ": warning: ", (x1)) +#define strerr_diew2sys(e, x1, x2) \ +strerr_die4sys(e, PROG, ": warning: ", x1, x2) +#define strerr_diew3sys(e, x1, x2, x3) \ +strerr_die5sys(e, PROG, ": warning: ", x1, x2, x3) +#define strerr_diew4sys(e, x1, x2, x3, x4) \ +strerr_die6sys(e, PROG, ": warning: ", x1, x2, x3, x4) +#define strerr_diew5sys(e, x1, x2, x3, x4, x5) \ +strerr_die7sys(e, PROG, ": warning: ", x1, x2, x3, x4, x5) +#define strerr_diew6sys(e, x1, x2, x3, x4, x5, x6) \ +strerr_die8sys(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6) +#define strerr_diew7sys(e, x1, x2, x3, x4, x5, x6, x7) \ +strerr_die9sys(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6, x7) +#define strerr_diew8sys(e, x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_die10sys(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6, x7, x8) +#define strerr_diew9sys(e, x1, x2, x3, x4, x5, x6, x7, x8, x9) \ +strerr_die11sys(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6, x7, x8, x9) + +#define strerr_dief1x(e, x1) \ +strerr_die3x(e, PROG, ": fatal: ", x1) +#define strerr_dief2x(e, x1, x2) \ +strerr_die4x(e, PROG, ": fatal: ", x1, x2) +#define strerr_dief3x(e, x1, x2, x3) \ +strerr_die5x(e, PROG, ": fatal: ", x1, x2, x3) +#define strerr_dief4x(e, x1, x2, x3, x4) \ +strerr_die6x(e, PROG, ": fatal: ", x1, x2, x3, x4) +#define strerr_dief5x(e, x1, x2, x3, x4, x5) \ +strerr_die7x(e, PROG, ": fatal: ", x1, x2, x3, x4, x5) +#define strerr_dief6x(e, x1, x2, x3, x4, x5, x6) \ +strerr_die8x(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6) +#define strerr_dief7x(e, x1, x2, x3, x4, x5, x6, x7) \ +strerr_die9x(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6, x7) +#define strerr_dief8x(e, x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_die10x(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6, x7, x8) + +#define strerr_dief1sys(e, x1) \ +strerr_die3sys(e, PROG, ": fatal: ", x1) +#define strerr_dief2sys(e, x1, x2) \ +strerr_die4sys(e, PROG, ": fatal: ", x1, x2) +#define strerr_dief3sys(e, x1, x2, x3) \ +strerr_die5sys(e, PROG, ": fatal: ", x1, x2, x3) +#define strerr_dief4sys(e, x1, x2, x3, x4) \ +strerr_die6sys(e, PROG, ": fatal: ", x1, x2, x3, x4) +#define strerr_dief5sys(e, x1, x2, x3, x4, x5) \ +strerr_die7sys(e, PROG, ": fatal: ", x1, x2, x3, x4, x5) +#define strerr_dief6sys(e, x1, x2, x3, x4, x5, x6) \ +strerr_die8sys(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6) +#define strerr_dief7sys(e, x1, x2, x3, x4, x5, x6, x7) \ +strerr_die9sys(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6, x7) +#define strerr_dief8sys(e, x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_die10sys(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6, x7, x8) +#define strerr_dief9sys(e, x1, x2, x3, x4, x5, x6, x7, x8, x9) \ +strerr_die11sys(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6, x7, x8, x9) + +#define strerr_diefu1x(e, x1) \ +strerr_die4x(e, PROG, ": fatal: ", "unable to ", x1) +#define strerr_diefu2x(e, x1, x2) \ +strerr_die5x(e, PROG, ": fatal: ", "unable to ", x1, x2) +#define strerr_diefu3x(e, x1, x2, x3) \ +strerr_die6x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3) +#define strerr_diefu4x(e, x1, x2, x3, x4) \ +strerr_die7x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4) +#define strerr_diefu5x(e, x1, x2, x3, x4, x5) \ +strerr_die8x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5) +#define strerr_diefu6x(e, x1, x2, x3, x4, x5, x6) \ +strerr_die9x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5, x6) +#define strerr_diefu7x(e, x1, x2, x3, x4, x5, x6, x7) \ +strerr_die10x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5, x6, x7) +#define strerr_diefu8x(e, x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_die11x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5, x6, x7, x8) + +#define strerr_diefu1sys(e, x1) \ +strerr_die4sys(e, PROG, ": fatal: ", "unable to ", x1) +#define strerr_diefu2sys(e, x1, x2) \ +strerr_die5sys(e, PROG, ": fatal: ", "unable to ", x1, x2) +#define strerr_diefu3sys(e, x1, x2, x3) \ +strerr_die6sys(e, PROG, ": fatal: ", "unable to ", x1, x2, x3) +#define strerr_diefu4sys(e, x1, x2, x3, x4) \ +strerr_die7sys(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4) +#define strerr_diefu5sys(e, x1, x2, x3, x4, x5) \ +strerr_die8sys(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5) +#define strerr_diefu6sys(e, x1, x2, x3, x4, x5, x6) \ +strerr_die9sys(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5, x6) +#define strerr_diefu7sys(e, x1, x2, x3, x4, x5, x6, x7) \ +strerr_die10sys(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5, x6, x7) +#define strerr_diefu8sys(e, x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_die11sys(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5, x6, x7, x8) + +#define strerr_warnwu1x(x1) \ +strerr_warn4x(PROG, ": warning: ", "unable to ", (x1)) +#define strerr_warnwu2x(x1, x2) \ +strerr_warn5x(PROG, ": warning: ", "unable to ", (x1), x2) +#define strerr_warnwu3x(x1, x2, x3) \ +strerr_warn6x(PROG, ": warning: ", "unable to ", (x1), x2, x3) +#define strerr_warnwu4x(x1, x2, x3, x4) \ +strerr_warn7x(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4) +#define strerr_warnwu5x(x1, x2, x3, x4, x5) \ +strerr_warn8x(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5) +#define strerr_warnwu6x(x1, x2, x3, x4, x5, x6) \ +strerr_warn9x(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5, x6) +#define strerr_warnwu7x(x1, x2, x3, x4, x5, x6, x7) \ +strerr_warn10x(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5, x6, x7) + +#define strerr_warnwu1sys(x1) \ +strerr_warn4sys(PROG, ": warning: ", "unable to ", (x1)) +#define strerr_warnwu2sys(x1, x2) \ +strerr_warn5sys(PROG, ": warning: ", "unable to ", (x1), x2) +#define strerr_warnwu3sys(x1, x2, x3) \ +strerr_warn6sys(PROG, ": warning: ", "unable to ", (x1), x2, x3) +#define strerr_warnwu4sys(x1, x2, x3, x4) \ +strerr_warn7sys(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4) +#define strerr_warnwu5sys(x1, x2, x3, x4, x5) \ +strerr_warn8sys(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5) +#define strerr_warnwu6sys(x1, x2, x3, x4, x5, x6) \ +strerr_warn9sys(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5, x6) +#define strerr_warnwu7sys(x1, x2, x3, x4, x5, x6, x7) \ +strerr_warn10sys(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5, x6, x7) +#define strerr_warnwu8sys(x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_warn11sys(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5, x6, x7, x8) + +#define strerr_diewu1x(e, x1) \ +strerr_die4x(e, PROG, ": warning: ", "unable to ", x1) +#define strerr_diewu2x(e, x1, x2) \ +strerr_die5x(e, PROG, ": warning: ", "unable to ", x1, x2) +#define strerr_diewu3x(e, x1, x2, x3) \ +strerr_die6x(e, PROG, ": warning: ", "unable to ", x1, x2, x3) +#define strerr_diewu4x(e, x1, x2, x3, x4) \ +strerr_die7x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4) +#define strerr_diewu5x(e, x1, x2, x3, x4, x5) \ +strerr_die8x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5) +#define strerr_diewu6x(e, x1, x2, x3, x4, x5, x6) \ +strerr_die9x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5, x6) +#define strerr_diewu7x(e, x1, x2, x3, x4, x5, x6, x7) \ +strerr_die10x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5, x6, x7) +#define strerr_diewu8x(e, x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_die11x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5, x6, x7, x8) + +#define strerr_diewu1sys(e, x1) \ +strerr_die4sys(e, PROG, ": warning: ", "unable to ", (x1)) +#define strerr_diewu2sys(e, x1, x2) \ +strerr_die5sys(e, PROG, ": warning: ", "unable to ", x1, x2) +#define strerr_diewu3sys(e, x1, x2, x3) \ +strerr_die6sys(e, PROG, ": warning: ", "unable to ", x1, x2, x3) +#define strerr_diewu4sys(e, x1, x2, x3, x4) \ +strerr_die7sys(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4) +#define strerr_diewu5sys(e, x1, x2, x3, x4, x5) \ +strerr_die8sys(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5) +#define strerr_diewu6sys(e, x1, x2, x3, x4, x5, x6) \ +strerr_die9sys(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5, x6) +#define strerr_diewu7sys(e, x1, x2, x3, x4, x5, x6, x7) \ +strerr_die10sys(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5, x6, x7) +#define strerr_diewu8sys(e, x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_die11sys(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5, x6, x7, x8) + +#define strerr_dieusage(e, u) \ +strerr_die3x(e, PROG, ": usage: ", u) + +#define strerr_dienotset(e, x) \ +strerr_dief2x(e, (x), " not set") + +#define strerr_dieinvalid(e, x) \ +strerr_dief2x(e, "invalid $", x) + +#define strerr_dieexec(e, x) \ +strerr_diefu2sys(e, "exec ", x) + +#define strerr_warni1x(x1) \ +strerr_warn3x(PROG, ": info: ", (x1)) +#define strerr_warni2x(x1, x2) \ +strerr_warn4x(PROG, ": info: ", (x1), x2) +#define strerr_warni3x(x1, x2, x3) \ +strerr_warn5x(PROG, ": info: ", (x1), x2, x3) +#define strerr_warni4x(x1, x2, x3, x4) \ +strerr_warn6x(PROG, ": info: ", (x1), x2, x3, x4) +#define strerr_warni5x(x1, x2, x3, x4, x5) \ +strerr_warn7x(PROG, ": info: ", (x1), x2, x3, x4, x5) +#define strerr_warni6x(x1, x2, x3, x4, x5, x6) \ +strerr_warn8x(PROG, ": info: ", (x1), x2, x3, x4, x5, x6) +#define strerr_warni7x(x1, x2, x3, x4, x5, x6, x7) \ +strerr_warn9x(PROG, ": info: ", (x1), x2, x3, x4, x5, x6, x7) +#define strerr_warni8x(x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_warn10x(PROG, ": info: ", (x1), x2, x3, x4, x5, x6, x7, x8) +#define strerr_warni9x(x1, x2, x3, x4, x5, x6, x7, x8, x9) \ +strerr_warn11x(PROG, ": info: ", (x1), x2, x3, x4, x5, x6, x7, x8, x9) + +#define strerr_warni1sys(x1) \ +strerr_warn3sys(PROG, ": info: ", (x1)) +#define strerr_warni2sys(x1, x2) \ +strerr_warn4sys(PROG, ": info: ", (x1), x2) +#define strerr_warni3sys(x1, x2, x3) \ +strerr_warn5sys(PROG, ": info: ", (x1), x2, x3) +#define strerr_warni4sys(x1, x2, x3, x4) \ +strerr_warn6sys(PROG, ": info: ", (x1), x2, x3, x4) +#define strerr_warni5sys(x1, x2, x3, x4, x5) \ +strerr_warn7sys(PROG, ": info: ", (x1), x2, x3, x4, x5) +#define strerr_warni6sys(x1, x2, x3, x4, x5, x6) \ +strerr_warn8sys(PROG, ": info: ", (x1), x2, x3, x4, x5, x6) +#define strerr_warni7sys(x1, x2, x3, x4, x5, x6, x7) \ +strerr_warn9sys(PROG, ": info: ", (x1), x2, x3, x4, x5, x6, x7) +#define strerr_warni8sys(x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_warn10sys(PROG, ": info: ", (x1), x2, x3, x4, x5, x6, x7, x8) +#define strerr_warni9sys(x1, x2, x3, x4, x5, x6, x7, x8, x9) \ +strerr_warn11sys(PROG, ": info: ", (x1), x2, x3, x4, x5, x6, x7, x8, x9) + +#define strerr_warnt1x(x1) \ +strerr_warn3x(PROG, ": tracing: ", (x1)) +#define strerr_warnt2x(x1, x2) \ +strerr_warn4x(PROG, ": tracing: ", (x1), x2) +#define strerr_warnt3x(x1, x2, x3) \ +strerr_warn5x(PROG, ": tracing: ", (x1), x2, x3) +#define strerr_warnt4x(x1, x2, x3, x4) \ +strerr_warn6x(PROG, ": tracing: ", (x1), x2, x3, x4) +#define strerr_warnt5x(x1, x2, x3, x4, x5) \ +strerr_warn7x(PROG, ": tracing: ", (x1), x2, x3, x4, x5) +#define strerr_warnt6x(x1, x2, x3, x4, x5, x6) \ +strerr_warn8x(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6) +#define strerr_warnt7x(x1, x2, x3, x4, x5, x6, x7) \ +strerr_warn9x(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6, x7) +#define strerr_warnt8x(x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_warn10x(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6, x7, x8) +#define strerr_warnt9x(x1, x2, x3, x4, x5, x6, x7, x8, x9) \ +strerr_warn11x(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6, x7, x8, x9) + +#define strerr_warnt1sys(x1) \ +strerr_warn3sys(PROG, ": tracing: ", (x1)) +#define strerr_warnt2sys(x1, x2) \ +strerr_warn4sys(PROG, ": tracing: ", (x1), x2) +#define strerr_warnt3sys(x1, x2, x3) \ +strerr_warn5sys(PROG, ": tracing: ", (x1), x2, x3) +#define strerr_warnt4sys(x1, x2, x3, x4) \ +strerr_warn6sys(PROG, ": tracing: ", (x1), x2, x3, x4) +#define strerr_warnt5sys(x1, x2, x3, x4, x5) \ +strerr_warn7sys(PROG, ": tracing: ", (x1), x2, x3, x4, x5) +#define strerr_warnt6sys(x1, x2, x3, x4, x5, x6) \ +strerr_warn8sys(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6) +#define strerr_warnt7sys(x1, x2, x3, x4, x5, x6, x7) \ +strerr_warn9sys(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6, x7) +#define strerr_warnt8sys(x1, x2, x3, x4, x5, x6, x7, x8) \ +strerr_warn10sys(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6, x7, x8) +#define strerr_warnt9sys(x1, x2, x3, x4, x5, x6, x7, x8, x9) \ +strerr_warn11sys(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6, x7, x8, x9) #endif diff --git a/src/include/skalibs/strerr2.h b/src/include/skalibs/strerr2.h index 5ccfca9..d41e15d 100644 --- a/src/include/skalibs/strerr2.h +++ b/src/include/skalibs/strerr2.h @@ -5,262 +5,6 @@ #include <skalibs/strerr.h> -extern char const *PROG ; - -#define strerr_warnw1x(x1) \ -strerr_warn3x(PROG, ": warning: ", (x1)) -#define strerr_warnw2x(x1, x2) \ -strerr_warn4x(PROG, ": warning: ", (x1), x2) -#define strerr_warnw3x(x1, x2, x3) \ -strerr_warn5x(PROG, ": warning: ", (x1), x2, x3) -#define strerr_warnw4x(x1, x2, x3, x4) \ -strerr_warn6x(PROG, ": warning: ", (x1), x2, x3, x4) -#define strerr_warnw5x(x1, x2, x3, x4, x5) \ -strerr_warn7x(PROG, ": warning: ", (x1), x2, x3, x4, x5) -#define strerr_warnw6x(x1, x2, x3, x4, x5, x6) \ -strerr_warn8x(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6) -#define strerr_warnw7x(x1, x2, x3, x4, x5, x6, x7) \ -strerr_warn9x(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6, x7) -#define strerr_warnw8x(x1, x2, x3, x4, x5, x6, x7, x8) \ -strerr_warn10x(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6, x7, x8) - -#define strerr_warnw1sys(x1) \ -strerr_warn4sys(PROG, ": warning: ", (x1), ": ") -#define strerr_warnw2sys(x1, x2) \ -strerr_warn5sys(PROG, ": warning: ", (x1), (x2), ": ") -#define strerr_warnw3sys(x1, x2, x3) \ -strerr_warn6sys(PROG, ": warning: ", (x1), x2, (x3), ": ") -#define strerr_warnw4sys(x1, x2, x3, x4) \ -strerr_warn7sys(PROG, ": warning: ", (x1), x2, x3, (x4), ": ") -#define strerr_warnw5sys(x1, x2, x3, x4, x5) \ -strerr_warn8sys(PROG, ": warning: ", (x1), x2, x3, x4, (x5), ": ") -#define strerr_warnw6sys(x1, x2, x3, x4, x5, x6) \ -strerr_warn9sys(PROG, ": warning: ", (x1), x2, x3, x4, x5, (x6), ": ") -#define strerr_warnw7sys(x1, x2, x3, x4, x5, x6, x7) \ -strerr_warn10sys(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6, (x7), ": ") - -#define strerr_diew1x(e, x1) \ -strerr_die3x(e, PROG, ": warning: ", x1) -#define strerr_diew2x(e, x1, x2) \ -strerr_die4x(e, PROG, ": warning: ", x1, x2) -#define strerr_diew3x(e, x1, x2, x3) \ -strerr_die5x(e, PROG, ": warning: ", x1, x2, x3) -#define strerr_diew4x(e, x1, x2, x3, x4) \ -strerr_die6x(e, PROG, ": warning: ", x1, x2, x3, x4) -#define strerr_diew5x(e, x1, x2, x3, x4, x5) \ -strerr_die7x(e, PROG, ": warning: ", x1, x2, x3, x4, x5) -#define strerr_diew6x(e, x1, x2, x3, x4, x5, x6) \ -strerr_die8x(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6) -#define strerr_diew7x(e, x1, x2, x3, x4, x5, x6, x7) \ -strerr_die9x(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6, x7) -#define strerr_diew8x(e, x1, x2, x3, x4, x5, x6, x7, x8) \ -strerr_die10x(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6, x7, x8) - -#define strerr_diew1sys(e, x1) \ -strerr_die4sys(e, PROG, ": warning: ", (x1), ": ") -#define strerr_diew2sys(e, x1, x2) \ -strerr_die5sys(e, PROG, ": warning: ", x1, (x2), ": ") -#define strerr_diew3sys(e, x1, x2, x3) \ -strerr_die6sys(e, PROG, ": warning: ", x1, x2, (x3), ": ") -#define strerr_diew4sys(e, x1, x2, x3, x4) \ -strerr_die7sys(e, PROG, ": warning: ", x1, x2, x3, (x4), ": ") -#define strerr_diew5sys(e, x1, x2, x3, x4, x5) \ -strerr_die8sys(e, PROG, ": warning: ", x1, x2, x3, x4, (x5), ": ") -#define strerr_diew6sys(e, x1, x2, x3, x4, x5, x6) \ -strerr_die9sys(e, PROG, ": warning: ", x1, x2, x3, x4, x5, (x6), ": ") -#define strerr_diew7sys(e, x1, x2, x3, x4, x5, x6, x7) \ -strerr_die10sys(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6, (x7), ": ") - -#define strerr_dief1x(e, x1) \ -strerr_die3x(e, PROG, ": fatal: ", x1) -#define strerr_dief2x(e, x1, x2) \ -strerr_die4x(e, PROG, ": fatal: ", x1, x2) -#define strerr_dief3x(e, x1, x2, x3) \ -strerr_die5x(e, PROG, ": fatal: ", x1, x2, x3) -#define strerr_dief4x(e, x1, x2, x3, x4) \ -strerr_die6x(e, PROG, ": fatal: ", x1, x2, x3, x4) -#define strerr_dief5x(e, x1, x2, x3, x4, x5) \ -strerr_die7x(e, PROG, ": fatal: ", x1, x2, x3, x4, x5) -#define strerr_dief6x(e, x1, x2, x3, x4, x5, x6) \ -strerr_die8x(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6) -#define strerr_dief7x(e, x1, x2, x3, x4, x5, x6, x7) \ -strerr_die9x(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6, x7) -#define strerr_dief8x(e, x1, x2, x3, x4, x5, x6, x7, x8) \ -strerr_die10x(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6, x7, x8) - -#define strerr_dief1sys(e, x1) \ -strerr_die4sys(e, PROG, ": fatal: ", (x1), ": ") -#define strerr_dief2sys(e, x1, x2) \ -strerr_die5sys(e, PROG, ": fatal: ", x1, (x2), ": ") -#define strerr_dief3sys(e, x1, x2, x3) \ -strerr_die6sys(e, PROG, ": fatal: ", x1, x2, (x3), ": ") -#define strerr_dief4sys(e, x1, x2, x3, x4) \ -strerr_die7sys(e, PROG, ": fatal: ", x1, x2, x3, (x4), ": ") -#define strerr_dief5sys(e, x1, x2, x3, x4, x5) \ -strerr_die8sys(e, PROG, ": fatal: ", x1, x2, x3, x4, (x5), ": ") -#define strerr_dief6sys(e, x1, x2, x3, x4, x5, x6) \ -strerr_die9sys(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, (x6), ": ") -#define strerr_dief7sys(e, x1, x2, x3, x4, x5, x6, x7) \ -strerr_die10sys(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6, (x7), ": ") - -#define strerr_diefu1x(e, x1) \ -strerr_die4x(e, PROG, ": fatal: ", "unable to ", x1) -#define strerr_diefu2x(e, x1, x2) \ -strerr_die5x(e, PROG, ": fatal: ", "unable to ", x1, x2) -#define strerr_diefu3x(e, x1, x2, x3) \ -strerr_die6x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3) -#define strerr_diefu4x(e, x1, x2, x3, x4) \ -strerr_die7x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4) -#define strerr_diefu5x(e, x1, x2, x3, x4, x5) \ -strerr_die8x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5) -#define strerr_diefu6x(e, x1, x2, x3, x4, x5, x6) \ -strerr_die9x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5, x6) -#define strerr_diefu7x(e, x1, x2, x3, x4, x5, x6, x7) \ -strerr_die10x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5, x6, x7) - -#define strerr_diefu1sys(e, x1) \ -strerr_die5sys(e, PROG, ": fatal: ", "unable to ", (x1), ": ") -#define strerr_diefu2sys(e, x1, x2) \ -strerr_die6sys(e, PROG, ": fatal: ", "unable to ", x1, (x2), ": ") -#define strerr_diefu3sys(e, x1, x2, x3) \ -strerr_die7sys(e, PROG, ": fatal: ", "unable to ", x1, x2, (x3), ": ") -#define strerr_diefu4sys(e, x1, x2, x3, x4) \ -strerr_die8sys(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, (x4), ": ") -#define strerr_diefu5sys(e, x1, x2, x3, x4, x5) \ -strerr_die9sys(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, (x5), ": ") -#define strerr_diefu6sys(e, x1, x2, x3, x4, x5, x6) \ -strerr_die10sys(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5, (x6), ": ") - -#define strerr_warnwu1x(x1) \ -strerr_warn4x(PROG, ": warning: ", "unable to ", (x1)) -#define strerr_warnwu2x(x1, x2) \ -strerr_warn5x(PROG, ": warning: ", "unable to ", (x1), x2) -#define strerr_warnwu3x(x1, x2, x3) \ -strerr_warn6x(PROG, ": warning: ", "unable to ", (x1), x2, x3) -#define strerr_warnwu4x(x1, x2, x3, x4) \ -strerr_warn7x(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4) -#define strerr_warnwu5x(x1, x2, x3, x4, x5) \ -strerr_warn8x(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5) -#define strerr_warnwu6x(x1, x2, x3, x4, x5, x6) \ -strerr_warn9x(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5, x6) -#define strerr_warnwu7x(x1, x2, x3, x4, x5, x6, x7) \ -strerr_warn10x(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5, x6, x7) - -#define strerr_warnwu1sys(x1) \ -strerr_warn5sys(PROG, ": warning: ", "unable to ", (x1), ": ") -#define strerr_warnwu2sys(x1, x2) \ -strerr_warn6sys(PROG, ": warning: ", "unable to ", (x1), (x2), ": ") -#define strerr_warnwu3sys(x1, x2, x3) \ -strerr_warn7sys(PROG, ": warning: ", "unable to ", (x1), x2, (x3), ": ") -#define strerr_warnwu4sys(x1, x2, x3, x4) \ -strerr_warn8sys(PROG, ": warning: ", "unable to ", (x1), x2, x3, (x4), ": ") -#define strerr_warnwu5sys(x1, x2, x3, x4, x5) \ -strerr_warn9sys(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, (x5), ": ") -#define strerr_warnwu6sys(x1, x2, x3, x4, x5, x6) \ -strerr_warn10sys(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5, (x6), ": ") - -#define strerr_diewu1x(e, x1) \ -strerr_die4x(e, PROG, ": warning: ", "unable to ", x1) -#define strerr_diewu2x(e, x1, x2) \ -strerr_die5x(e, PROG, ": warning: ", "unable to ", x1, x2) -#define strerr_diewu3x(e, x1, x2, x3) \ -strerr_die6x(e, PROG, ": warning: ", "unable to ", x1, x2, x3) -#define strerr_diewu4x(e, x1, x2, x3, x4) \ -strerr_die7x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4) -#define strerr_diewu5x(e, x1, x2, x3, x4, x5) \ -strerr_die8x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5) -#define strerr_diewu6x(e, x1, x2, x3, x4, x5, x6) \ -strerr_die9x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5, x6) -#define strerr_diewu7x(e, x1, x2, x3, x4, x5, x6, x7) \ -strerr_die10x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5, x6, x7) - -#define strerr_diewu1sys(e, x1) \ -strerr_die5sys(e, PROG, ": warning: ", "unable to ", (x1), ": ") -#define strerr_diewu2sys(e, x1, x2) \ -strerr_die6sys(e, PROG, ": warning: ", "unable to ", x1, (x2), ": ") -#define strerr_diewu3sys(e, x1, x2, x3) \ -strerr_die7sys(e, PROG, ": warning: ", "unable to ", x1, x2, (x3), ": ") -#define strerr_diewu4sys(e, x1, x2, x3, x4) \ -strerr_die8sys(e, PROG, ": warning: ", "unable to ", x1, x2, x3, (x4), ": ") -#define strerr_diewu5sys(e, x1, x2, x3, x4, x5) \ -strerr_die9sys(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, (x5), ": ") -#define strerr_diewu6sys(e, x1, x2, x3, x4, x5, x6) \ -strerr_die10sys(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5, (x6), ": ") - -#define strerr_dieusage(e, u) \ -strerr_die3x(e, PROG, ": usage: ", u) - -#define strerr_dienotset(e, x) \ -strerr_dief2x(e, (x), " not set") - -#define strerr_dieinvalid(e, x) \ -strerr_dief2x(e, "invalid $", x) - -#define strerr_dieexec(e, x) \ -strerr_diefu2sys(e, "exec ", x) - -#define strerr_warni1x(x1) \ -strerr_warn3x(PROG, ": info: ", (x1)) -#define strerr_warni2x(x1, x2) \ -strerr_warn4x(PROG, ": info: ", (x1), x2) -#define strerr_warni3x(x1, x2, x3) \ -strerr_warn5x(PROG, ": info: ", (x1), x2, x3) -#define strerr_warni4x(x1, x2, x3, x4) \ -strerr_warn6x(PROG, ": info: ", (x1), x2, x3, x4) -#define strerr_warni5x(x1, x2, x3, x4, x5) \ -strerr_warn7x(PROG, ": info: ", (x1), x2, x3, x4, x5) -#define strerr_warni6x(x1, x2, x3, x4, x5, x6) \ -strerr_warn8x(PROG, ": info: ", (x1), x2, x3, x4, x5, x6) -#define strerr_warni7x(x1, x2, x3, x4, x5, x6, x7) \ -strerr_warn9x(PROG, ": info: ", (x1), x2, x3, x4, x5, x6, x7) -#define strerr_warni8x(x1, x2, x3, x4, x5, x6, x7, x8) \ -strerr_warn10x(PROG, ": info: ", (x1), x2, x3, x4, x5, x6, x7, x8) - -#define strerr_warni1sys(x1) \ -strerr_warn4sys(PROG, ": info: ", (x1), ": ") -#define strerr_warni2sys(x1, x2) \ -strerr_warn5sys(PROG, ": info: ", (x1), (x2), ": ") -#define strerr_warni3sys(x1, x2, x3) \ -strerr_warn6sys(PROG, ": info: ", (x1), x2, (x3), ": ") -#define strerr_warni4sys(x1, x2, x3, x4) \ -strerr_warn7sys(PROG, ": info: ", (x1), x2, x3, (x4), ": ") -#define strerr_warni5sys(x1, x2, x3, x4, x5) \ -strerr_warn8sys(PROG, ": info: ", (x1), x2, x3, x4, (x5), ": ") -#define strerr_warni6sys(x1, x2, x3, x4, x5, x6) \ -strerr_warn9sys(PROG, ": info: ", (x1), x2, x3, x4, x5, (x6), ": ") -#define strerr_warni7sys(x1, x2, x3, x4, x5, x6, x7) \ -strerr_warn10sys(PROG, ": info: ", (x1), x2, x3, x4, x5, x6, (x7), ": ") - -#define strerr_warnt1x(x1) \ -strerr_warn3x(PROG, ": tracing: ", (x1)) -#define strerr_warnt2x(x1, x2) \ -strerr_warn4x(PROG, ": tracing: ", (x1), x2) -#define strerr_warnt3x(x1, x2, x3) \ -strerr_warn5x(PROG, ": tracing: ", (x1), x2, x3) -#define strerr_warnt4x(x1, x2, x3, x4) \ -strerr_warn6x(PROG, ": tracing: ", (x1), x2, x3, x4) -#define strerr_warnt5x(x1, x2, x3, x4, x5) \ -strerr_warn7x(PROG, ": tracing: ", (x1), x2, x3, x4, x5) -#define strerr_warnt6x(x1, x2, x3, x4, x5, x6) \ -strerr_warn8x(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6) -#define strerr_warnt7x(x1, x2, x3, x4, x5, x6, x7) \ -strerr_warn9x(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6, x7) -#define strerr_warnt8x(x1, x2, x3, x4, x5, x6, x7, x8) \ -strerr_warn10x(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6, x7, x8) - -#define strerr_warnt1sys(x1) \ -strerr_warn4sys(PROG, ": tracing: ", (x1), ": ") -#define strerr_warnt2sys(x1, x2) \ -strerr_warn5sys(PROG, ": tracing: ", (x1), (x2), ": ") -#define strerr_warnt3sys(x1, x2, x3) \ -strerr_warn6sys(PROG, ": tracing: ", (x1), x2, (x3), ": ") -#define strerr_warnt4sys(x1, x2, x3, x4) \ -strerr_warn7sys(PROG, ": tracing: ", (x1), x2, x3, (x4), ": ") -#define strerr_warnt5sys(x1, x2, x3, x4, x5) \ -strerr_warn8sys(PROG, ": tracing: ", (x1), x2, x3, x4, (x5), ": ") -#define strerr_warnt6sys(x1, x2, x3, x4, x5, x6) \ -strerr_warn9sys(PROG, ": tracing: ", (x1), x2, x3, x4, x5, (x6), ": ") -#define strerr_warnt7sys(x1, x2, x3, x4, x5, x6, x7) \ -strerr_warn10sys(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6, (x7), ": ") +#warning strerr2.h is now deprecated, use #include <skalibs/strerr.h> instead. #endif diff --git a/src/libenvexec/xexec_ae.c b/src/libenvexec/xexec_ae.c index 55b7c70..d200ae0 100644 --- a/src/libenvexec/xexec_ae.c +++ b/src/libenvexec/xexec_ae.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/exec.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> void xexec_ae (char const *file, char const *const *argv, char const *const *envp) { diff --git a/src/libenvexec/xexecvep.c b/src/libenvexec/xexecvep.c index c272401..86e7b02 100644 --- a/src/libenvexec/xexecvep.c +++ b/src/libenvexec/xexecvep.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/posixplz.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #include <skalibs/exec.h> void xexecvep (char const *file, char const *const *argv, char const *const *envp, char const *path) diff --git a/src/libenvexec/xexecvep_loose.c b/src/libenvexec/xexecvep_loose.c index ed2b3ee..04f0085 100644 --- a/src/libenvexec/xexecvep_loose.c +++ b/src/libenvexec/xexecvep_loose.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/posixplz.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #include <skalibs/exec.h> void xexecvep_loose (char const *file, char const *const *argv, char const *const *envp, char const *path) diff --git a/src/libenvexec/xmexec0_af.c b/src/libenvexec/xmexec0_af.c index 29c4ea6..de9afa5 100644 --- a/src/libenvexec/xmexec0_af.c +++ b/src/libenvexec/xmexec0_af.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/exec.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> void xmexec0_af (char const *file, char const *const *argv, char const *const *envp, size_t envlen) { diff --git a/src/libenvexec/xmexec0_afm.c b/src/libenvexec/xmexec0_afm.c index a43cb49..5ce92ed 100644 --- a/src/libenvexec/xmexec0_afm.c +++ b/src/libenvexec/xmexec0_afm.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/exec.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> void xmexec0_afm (char const *file, char const *const *argv, char const *const *envp, size_t envlen, char const *modif, size_t modiflen) { diff --git a/src/libenvexec/xmexec0_afn.c b/src/libenvexec/xmexec0_afn.c index 73eeb04..2af3686 100644 --- a/src/libenvexec/xmexec0_afn.c +++ b/src/libenvexec/xmexec0_afn.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/exec.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> void xmexec0_afn (char const *file, char const *const *argv, char const *const *envp, size_t envlen, char const *modif, size_t modiflen, size_t modifn) { diff --git a/src/libenvexec/xmexec_af.c b/src/libenvexec/xmexec_af.c index 8c737f1..23bb217 100644 --- a/src/libenvexec/xmexec_af.c +++ b/src/libenvexec/xmexec_af.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/exec.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> void xmexec_af (char const *file, char const *const *argv, char const *const *envp, size_t envlen) { diff --git a/src/libenvexec/xmexec_afm.c b/src/libenvexec/xmexec_afm.c index ac86c3a..3a2882d 100644 --- a/src/libenvexec/xmexec_afm.c +++ b/src/libenvexec/xmexec_afm.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/exec.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> void xmexec_afm (char const *file, char const *const *argv, char const *const *envp, size_t envlen, char const *modif, size_t modiflen) { diff --git a/src/libenvexec/xmexec_afn.c b/src/libenvexec/xmexec_afn.c index 93f0c33..f98ca1a 100644 --- a/src/libenvexec/xmexec_afn.c +++ b/src/libenvexec/xmexec_afn.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/exec.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> void xmexec_afn (char const *file, char const *const *argv, char const *const *envp, size_t envlen, char const *modif, size_t modiflen, size_t modifn) { diff --git a/src/librandom/random_devurandom.c b/src/librandom/random_devurandom.c index 5f6b791..106c24f 100644 --- a/src/librandom/random_devurandom.c +++ b/src/librandom/random_devurandom.c @@ -4,7 +4,7 @@ #include <errno.h> #include <skalibs/allreadwrite.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #include <skalibs/djbunix.h> #include <skalibs/random.h> diff --git a/src/libstddjb/child_spawn.c b/src/libstddjb/child_spawn.c index 5a157a8..aa70deb 100644 --- a/src/libstddjb/child_spawn.c +++ b/src/libstddjb/child_spawn.c @@ -20,7 +20,7 @@ #else #include <skalibs/sig.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #include <skalibs/exec.h> #endif diff --git a/src/libstddjb/child_spawn0.c b/src/libstddjb/child_spawn0.c index 927bb0e..5b59b20 100644 --- a/src/libstddjb/child_spawn0.c +++ b/src/libstddjb/child_spawn0.c @@ -47,7 +47,7 @@ pid_t child_spawn0 (char const *prog, char const *const *argv, char const *const #include <string.h> #include <skalibs/allreadwrite.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #include <skalibs/sig.h> #include <skalibs/djbunix.h> #include <skalibs/exec.h> diff --git a/src/libstddjb/child_spawn1_internal.c b/src/libstddjb/child_spawn1_internal.c index 436d19e..be154f0 100644 --- a/src/libstddjb/child_spawn1_internal.c +++ b/src/libstddjb/child_spawn1_internal.c @@ -71,7 +71,7 @@ pid_t child_spawn1_internal (char const *prog, char const *const *argv, char con #include <string.h> #include <skalibs/allreadwrite.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #include <skalibs/sig.h> #include <skalibs/djbunix.h> #include <skalibs/exec.h> diff --git a/src/libstddjb/child_spawn2.c b/src/libstddjb/child_spawn2.c index d35b4a6..bddd97f 100644 --- a/src/libstddjb/child_spawn2.c +++ b/src/libstddjb/child_spawn2.c @@ -21,7 +21,7 @@ #include <string.h> #include <skalibs/allreadwrite.h> #include <skalibs/sig.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #include <skalibs/exec.h> #endif diff --git a/src/libstddjb/child_spawn3.c b/src/libstddjb/child_spawn3.c index 255e3c1..733df74 100644 --- a/src/libstddjb/child_spawn3.c +++ b/src/libstddjb/child_spawn3.c @@ -20,7 +20,7 @@ #include <string.h> #include <skalibs/sig.h> -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> #include <skalibs/exec.h> #endif diff --git a/src/libstddjb/hiercopy_tmp.c b/src/libstddjb/hiercopy_tmp.c index 79b7b46..4e69bbe 100644 --- a/src/libstddjb/hiercopy_tmp.c +++ b/src/libstddjb/hiercopy_tmp.c @@ -5,7 +5,7 @@ #include <sys/stat.h> #include <errno.h> #include <fcntl.h> -#include <skalibs/strerr2.h> + #include <skalibs/stralloc.h> #include <skalibs/direntry.h> #include <skalibs/djbunix.h> diff --git a/src/libstddjb/prog.c b/src/libstddjb/prog.c index f6c683c..3c5f7f5 100644 --- a/src/libstddjb/prog.c +++ b/src/libstddjb/prog.c @@ -2,6 +2,6 @@ /* MT-unsafe */ -#include <skalibs/strerr2.h> +#include <skalibs/strerr.h> char const *PROG = "(none)" ; diff --git a/src/libstddjb/strerr.c b/src/libstddjb/strerr.c deleted file mode 100644 index ae70477..0000000 --- a/src/libstddjb/strerr.c +++ /dev/null @@ -1,35 +0,0 @@ -/* ISC license. */ - -/* MT-unsafe */ - -#include <unistd.h> -#include <errno.h> -#include <skalibs/buffer.h> -#include <skalibs/strerr.h> - -void strerr_warn (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10, char const *se) -{ - int e = errno ; - if (x1) buffer_puts(buffer_2, x1) ; - if (x2) buffer_puts(buffer_2, x2) ; - if (x3) buffer_puts(buffer_2, x3) ; - if (x4) buffer_puts(buffer_2, x4) ; - if (x5) buffer_puts(buffer_2, x5) ; - if (x6) buffer_puts(buffer_2, x6) ; - if (x7) buffer_puts(buffer_2, x7) ; - if (x8) buffer_puts(buffer_2, x8) ; - if (x9) buffer_puts(buffer_2, x9) ; - if (x10) buffer_puts(buffer_2, x10) ; - if (se) buffer_puts(buffer_2, se) ; - buffer_putflush(buffer_2, "\n", 1) ; - errno = e ; -} - -void strerr_die (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10, char const *se) -{ - strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, se) ; - _exit(e) ; - - /* No, OpenBSD, this noreturn function does NOT return. - Please learn what _exit() does. */ -} diff --git a/src/libstddjb/strerr_sys.c b/src/libstddjb/strerr_sys.c deleted file mode 100644 index e388f5a..0000000 --- a/src/libstddjb/strerr_sys.c +++ /dev/null @@ -1,22 +0,0 @@ -/* ISC license. */ - -/* MT-unsafe */ - -#include <unistd.h> -#include <string.h> -#include <errno.h> -#include <skalibs/strerr.h> - -void strerr_warnsys (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10) -{ - strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, strerror(errno)) ; -} - -void strerr_diesys (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10) -{ - strerr_warnsys(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) ; - _exit(e) ; - - /* No, OpenBSD, this noreturn function does NOT return. - Please learn what _exit() does. */ -} diff --git a/src/libstrerr/strerr_die10sys.c b/src/libstrerr/strerr_die10sys.c new file mode 100644 index 0000000..a4801dd --- /dev/null +++ b/src/libstrerr/strerr_die10sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die10sys (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10) +{ + char const *v[10] = { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 } ; + strerr_dievsys(e, v, 10) ; +} diff --git a/src/libstrerr/strerr_die10x.c b/src/libstrerr/strerr_die10x.c new file mode 100644 index 0000000..6999dfe --- /dev/null +++ b/src/libstrerr/strerr_die10x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die10x (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10) +{ + char const *v[10] = { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 } ; + strerr_diev(e, v, 10) ; +} diff --git a/src/libstrerr/strerr_die11sys.c b/src/libstrerr/strerr_die11sys.c new file mode 100644 index 0000000..71da57d --- /dev/null +++ b/src/libstrerr/strerr_die11sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die11sys (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10, char const *x11) +{ + char const *v[11] = { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11 } ; + strerr_dievsys(e, v, 11) ; +} diff --git a/src/libstrerr/strerr_die11x.c b/src/libstrerr/strerr_die11x.c new file mode 100644 index 0000000..a18e0fa --- /dev/null +++ b/src/libstrerr/strerr_die11x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die11x (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10, char const *x11) +{ + char const *v[11] = { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11 } ; + strerr_diev(e, v, 11) ; +} diff --git a/src/libstrerr/strerr_die1sys.c b/src/libstrerr/strerr_die1sys.c new file mode 100644 index 0000000..1ec5ea1 --- /dev/null +++ b/src/libstrerr/strerr_die1sys.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die1sys (int e, char const *x1) +{ + strerr_dievsys(e, &x1, 1) ; +} diff --git a/src/libstrerr/strerr_die1x.c b/src/libstrerr/strerr_die1x.c new file mode 100644 index 0000000..b56dd53 --- /dev/null +++ b/src/libstrerr/strerr_die1x.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die1x (int e, char const *x1) +{ + strerr_diev(e, &x1, 1) ; +} diff --git a/src/libstrerr/strerr_die2sys.c b/src/libstrerr/strerr_die2sys.c new file mode 100644 index 0000000..ffe25af --- /dev/null +++ b/src/libstrerr/strerr_die2sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die2sys (int e, char const *x1, char const *x2) +{ + char const *v[2] = { x1, x2 } ; + strerr_dievsys(e, v, 2) ; +} diff --git a/src/libstrerr/strerr_die2x.c b/src/libstrerr/strerr_die2x.c new file mode 100644 index 0000000..8113818 --- /dev/null +++ b/src/libstrerr/strerr_die2x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die2x (int e, char const *x1, char const *x2) +{ + char const *v[2] = { x1, x2 } ; + strerr_diev(e, v, 2) ; +} diff --git a/src/libstrerr/strerr_die3sys.c b/src/libstrerr/strerr_die3sys.c new file mode 100644 index 0000000..17bae5c --- /dev/null +++ b/src/libstrerr/strerr_die3sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die3sys (int e, char const *x1, char const *x2, char const *x3) +{ + char const *v[3] = { x1, x2, x3 } ; + strerr_dievsys(e, v, 3) ; +} diff --git a/src/libstrerr/strerr_die3x.c b/src/libstrerr/strerr_die3x.c new file mode 100644 index 0000000..25f5612 --- /dev/null +++ b/src/libstrerr/strerr_die3x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die3x (int e, char const *x1, char const *x2, char const *x3) +{ + char const *v[3] = { x1, x2, x3 } ; + strerr_diev(e, v, 3) ; +} diff --git a/src/libstrerr/strerr_die4sys.c b/src/libstrerr/strerr_die4sys.c new file mode 100644 index 0000000..0f5a3de --- /dev/null +++ b/src/libstrerr/strerr_die4sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die4sys (int e, char const *x1, char const *x2, char const *x3, char const *x4) +{ + char const *v[4] = { x1, x2, x3, x4 } ; + strerr_dievsys(e, v, 4) ; +} diff --git a/src/libstrerr/strerr_die4x.c b/src/libstrerr/strerr_die4x.c new file mode 100644 index 0000000..bd330a3 --- /dev/null +++ b/src/libstrerr/strerr_die4x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die4x (int e, char const *x1, char const *x2, char const *x3, char const *x4) +{ + char const *v[4] = { x1, x2, x3, x4 } ; + strerr_diev(e, v, 4) ; +} diff --git a/src/libstrerr/strerr_die5sys.c b/src/libstrerr/strerr_die5sys.c new file mode 100644 index 0000000..a4635ba --- /dev/null +++ b/src/libstrerr/strerr_die5sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die5sys (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5) +{ + char const *v[5] = { x1, x2, x3, x4, x5 } ; + strerr_dievsys(e, v, 5) ; +} diff --git a/src/libstrerr/strerr_die5x.c b/src/libstrerr/strerr_die5x.c new file mode 100644 index 0000000..30055d7 --- /dev/null +++ b/src/libstrerr/strerr_die5x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die5x (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5) +{ + char const *v[5] = { x1, x2, x3, x4, x5 } ; + strerr_diev(e, v, 5) ; +} diff --git a/src/libstrerr/strerr_die6sys.c b/src/libstrerr/strerr_die6sys.c new file mode 100644 index 0000000..bf5ab7d --- /dev/null +++ b/src/libstrerr/strerr_die6sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die6sys (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6) +{ + char const *v[6] = { x1, x2, x3, x4, x5, x6 } ; + strerr_dievsys(e, v, 6) ; +} diff --git a/src/libstrerr/strerr_die6x.c b/src/libstrerr/strerr_die6x.c new file mode 100644 index 0000000..294d236 --- /dev/null +++ b/src/libstrerr/strerr_die6x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die6x (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6) +{ + char const *v[6] = { x1, x2, x3, x4, x5, x6 } ; + strerr_diev(e, v, 6) ; +} diff --git a/src/libstrerr/strerr_die7sys.c b/src/libstrerr/strerr_die7sys.c new file mode 100644 index 0000000..27c305e --- /dev/null +++ b/src/libstrerr/strerr_die7sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die7sys (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7) +{ + char const *v[7] = { x1, x2, x3, x4, x5, x6, x7 } ; + strerr_dievsys(e, v, 7) ; +} diff --git a/src/libstrerr/strerr_die7x.c b/src/libstrerr/strerr_die7x.c new file mode 100644 index 0000000..e367313 --- /dev/null +++ b/src/libstrerr/strerr_die7x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die7x (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7) +{ + char const *v[7] = { x1, x2, x3, x4, x5, x6, x7 } ; + strerr_diev(e, v, 7) ; +} diff --git a/src/libstrerr/strerr_die8sys.c b/src/libstrerr/strerr_die8sys.c new file mode 100644 index 0000000..2d7971f --- /dev/null +++ b/src/libstrerr/strerr_die8sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die8sys (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8) +{ + char const *v[8] = { x1, x2, x3, x4, x5, x6, x7, x8 } ; + strerr_dievsys(e, v, 8) ; +} diff --git a/src/libstrerr/strerr_die8x.c b/src/libstrerr/strerr_die8x.c new file mode 100644 index 0000000..bf49c5b --- /dev/null +++ b/src/libstrerr/strerr_die8x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die8x (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8) +{ + char const *v[8] = { x1, x2, x3, x4, x5, x6, x7, x8 } ; + strerr_diev(e, v, 8) ; +} diff --git a/src/libstrerr/strerr_die9sys.c b/src/libstrerr/strerr_die9sys.c new file mode 100644 index 0000000..9dd745f --- /dev/null +++ b/src/libstrerr/strerr_die9sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die9sys (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9) +{ + char const *v[9] = { x1, x2, x3, x4, x5, x6, x7, x8, x9 } ; + strerr_dievsys(e, v, 9) ; +} diff --git a/src/libstrerr/strerr_die9x.c b/src/libstrerr/strerr_die9x.c new file mode 100644 index 0000000..669723e --- /dev/null +++ b/src/libstrerr/strerr_die9x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_die9x (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9) +{ + char const *v[9] = { x1, x2, x3, x4, x5, x6, x7, x8, x9 } ; + strerr_diev(e, v, 9) ; +} diff --git a/src/libstrerr/strerr_diel.c b/src/libstrerr/strerr_diel.c new file mode 100644 index 0000000..d142402 --- /dev/null +++ b/src/libstrerr/strerr_diel.c @@ -0,0 +1,24 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <stdarg.h> +#include <unistd.h> + +#include <skalibs/strerr.h> + +void strerr_diel (int e, unsigned int n, ...) +{ + if (n) + { + va_list ap ; + char const *v[n] ; + va_start(ap, n) ; + va_arg(ap, unsigned int) ; + for (unsigned int i = 0 ; i < n ; i++) + v[i++] = va_arg(ap, char const *) ; + va_end(ap) ; + strerr_warnv(v, n) ; + } + _exit(e) ; +} diff --git a/src/libstrerr/strerr_dielsys.c b/src/libstrerr/strerr_dielsys.c new file mode 100644 index 0000000..5c0e334 --- /dev/null +++ b/src/libstrerr/strerr_dielsys.c @@ -0,0 +1,23 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <stdarg.h> +#include <string.h> +#include <unistd.h> +#include <errno.h> + +#include <skalibs/strerr.h> + +void strerr_dielsys (int e, unsigned int n, ...) +{ + va_list ap ; + char const *v[n+1] ; + va_start(ap, n) ; + va_arg(ap, unsigned int) ; + for (unsigned int i = 0 ; i < n ; i++) + v[i++] = va_arg(ap, char const *) ; + va_end(ap) ; + v[n] = strerror(errno) ; + strerr_diev(e, v, n+1) ; +} diff --git a/src/libstrerr/strerr_diev.c b/src/libstrerr/strerr_diev.c new file mode 100644 index 0000000..bf1e8fc --- /dev/null +++ b/src/libstrerr/strerr_diev.c @@ -0,0 +1,13 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <unistd.h> + +#include <skalibs/strerr.h> + +void strerr_diev (int e, char const *const *v, unsigned int n) +{ + strerr_warnv(v, n) ; + _exit(e) ; +} diff --git a/src/libstrerr/strerr_dievsys.c b/src/libstrerr/strerr_dievsys.c new file mode 100644 index 0000000..10437f9 --- /dev/null +++ b/src/libstrerr/strerr_dievsys.c @@ -0,0 +1,13 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <unistd.h> + +#include <skalibs/strerr.h> + +void strerr_dievsys (int e, char const *const *v, unsigned int n) +{ + strerr_warnvsys(v, n) ; + _exit(e) ; +} diff --git a/src/libstrerr/strerr_warn10sys.c b/src/libstrerr/strerr_warn10sys.c new file mode 100644 index 0000000..f9a448e --- /dev/null +++ b/src/libstrerr/strerr_warn10sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn10sys (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10) +{ + char const *v[10] = { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 } ; + strerr_warnvsys(v, 10) ; +} diff --git a/src/libstrerr/strerr_warn10x.c b/src/libstrerr/strerr_warn10x.c new file mode 100644 index 0000000..4139f63 --- /dev/null +++ b/src/libstrerr/strerr_warn10x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn10x (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10) +{ + char const *v[10] = { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 } ; + strerr_warnv(v, 10) ; +} diff --git a/src/libstrerr/strerr_warn11sys.c b/src/libstrerr/strerr_warn11sys.c new file mode 100644 index 0000000..588df28 --- /dev/null +++ b/src/libstrerr/strerr_warn11sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn11sys (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10, char const *x11) +{ + char const *v[11] = { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11 } ; + strerr_warnvsys(v, 11) ; +} diff --git a/src/libstrerr/strerr_warn11x.c b/src/libstrerr/strerr_warn11x.c new file mode 100644 index 0000000..9b4ba90 --- /dev/null +++ b/src/libstrerr/strerr_warn11x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn11x (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10, char const *x11) +{ + char const *v[11] = { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11 } ; + strerr_warnv(v, 11) ; +} diff --git a/src/libstrerr/strerr_warn1sys.c b/src/libstrerr/strerr_warn1sys.c new file mode 100644 index 0000000..211bfb4 --- /dev/null +++ b/src/libstrerr/strerr_warn1sys.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn1sys (char const *x1) +{ + strerr_warnvsys(&x1, 1) ; +} diff --git a/src/libstrerr/strerr_warn1x.c b/src/libstrerr/strerr_warn1x.c new file mode 100644 index 0000000..dd54048 --- /dev/null +++ b/src/libstrerr/strerr_warn1x.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn1x (char const *x1) +{ + strerr_warnv(&x1, 1) ; +} diff --git a/src/libstrerr/strerr_warn2sys.c b/src/libstrerr/strerr_warn2sys.c new file mode 100644 index 0000000..0efb546 --- /dev/null +++ b/src/libstrerr/strerr_warn2sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn2sys (char const *x1, char const *x2) +{ + char const *v[2] = { x1, x2 } ; + strerr_warnvsys(v, 2) ; +} diff --git a/src/libstrerr/strerr_warn2x.c b/src/libstrerr/strerr_warn2x.c new file mode 100644 index 0000000..936c876 --- /dev/null +++ b/src/libstrerr/strerr_warn2x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn2x (char const *x1, char const *x2) +{ + char const *v[2] = { x1, x2 } ; + strerr_warnv(v, 2) ; +} diff --git a/src/libstrerr/strerr_warn3sys.c b/src/libstrerr/strerr_warn3sys.c new file mode 100644 index 0000000..b011f2d --- /dev/null +++ b/src/libstrerr/strerr_warn3sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn3sys (char const *x1, char const *x2, char const *x3) +{ + char const *v[3] = { x1, x2, x3 } ; + strerr_warnvsys(v, 3) ; +} diff --git a/src/libstrerr/strerr_warn3x.c b/src/libstrerr/strerr_warn3x.c new file mode 100644 index 0000000..f9b95d7 --- /dev/null +++ b/src/libstrerr/strerr_warn3x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn3x (char const *x1, char const *x2, char const *x3) +{ + char const *v[3] = { x1, x2, x3 } ; + strerr_warnv(v, 3) ; +} diff --git a/src/libstrerr/strerr_warn4sys.c b/src/libstrerr/strerr_warn4sys.c new file mode 100644 index 0000000..2172363 --- /dev/null +++ b/src/libstrerr/strerr_warn4sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn4sys (char const *x1, char const *x2, char const *x3, char const *x4) +{ + char const *v[4] = { x1, x2, x3, x4 } ; + strerr_warnvsys(v, 4) ; +} diff --git a/src/libstrerr/strerr_warn4x.c b/src/libstrerr/strerr_warn4x.c new file mode 100644 index 0000000..20d8b28 --- /dev/null +++ b/src/libstrerr/strerr_warn4x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn4x (char const *x1, char const *x2, char const *x3, char const *x4) +{ + char const *v[4] = { x1, x2, x3, x4 } ; + strerr_warnv(v, 4) ; +} diff --git a/src/libstrerr/strerr_warn5sys.c b/src/libstrerr/strerr_warn5sys.c new file mode 100644 index 0000000..722d4b7 --- /dev/null +++ b/src/libstrerr/strerr_warn5sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn5sys (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5) +{ + char const *v[5] = { x1, x2, x3, x4, x5 } ; + strerr_warnvsys(v, 5) ; +} diff --git a/src/libstrerr/strerr_warn5x.c b/src/libstrerr/strerr_warn5x.c new file mode 100644 index 0000000..79d5402 --- /dev/null +++ b/src/libstrerr/strerr_warn5x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn5x (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5) +{ + char const *v[5] = { x1, x2, x3, x4, x5 } ; + strerr_warnv(v, 5) ; +} diff --git a/src/libstrerr/strerr_warn6sys.c b/src/libstrerr/strerr_warn6sys.c new file mode 100644 index 0000000..4150646 --- /dev/null +++ b/src/libstrerr/strerr_warn6sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn6sys (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6) +{ + char const *v[6] = { x1, x2, x3, x4, x5, x6 } ; + strerr_warnvsys(v, 6) ; +} diff --git a/src/libstrerr/strerr_warn6x.c b/src/libstrerr/strerr_warn6x.c new file mode 100644 index 0000000..5d94d9e --- /dev/null +++ b/src/libstrerr/strerr_warn6x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn6x (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6) +{ + char const *v[6] = { x1, x2, x3, x4, x5, x6 } ; + strerr_warnv(v, 6) ; +} diff --git a/src/libstrerr/strerr_warn7sys.c b/src/libstrerr/strerr_warn7sys.c new file mode 100644 index 0000000..e9da56b --- /dev/null +++ b/src/libstrerr/strerr_warn7sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn7sys (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7) +{ + char const *v[7] = { x1, x2, x3, x4, x5, x6, x7 } ; + strerr_warnvsys(v, 7) ; +} diff --git a/src/libstrerr/strerr_warn7x.c b/src/libstrerr/strerr_warn7x.c new file mode 100644 index 0000000..f963323 --- /dev/null +++ b/src/libstrerr/strerr_warn7x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warnv2 (char const *x1, char const *x2) +{ + char const *v[2] = { x1, x2 } ; + strerr_warnv(v, 2) ; +} diff --git a/src/libstrerr/strerr_warn8sys.c b/src/libstrerr/strerr_warn8sys.c new file mode 100644 index 0000000..33ce86c --- /dev/null +++ b/src/libstrerr/strerr_warn8sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn8sys (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8) +{ + char const *v[8] = { x1, x2, x3, x4, x5, x6, x7, x8 } ; + strerr_warnvsys(v, 8) ; +} diff --git a/src/libstrerr/strerr_warn8x.c b/src/libstrerr/strerr_warn8x.c new file mode 100644 index 0000000..f4519cd --- /dev/null +++ b/src/libstrerr/strerr_warn8x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn8x (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8) +{ + char const *v[8] = { x1, x2, x3, x4, x5, x6, x7, x8 } ; + strerr_warnv(v, 8) ; +} diff --git a/src/libstrerr/strerr_warn9sys.c b/src/libstrerr/strerr_warn9sys.c new file mode 100644 index 0000000..a5920eb --- /dev/null +++ b/src/libstrerr/strerr_warn9sys.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn9sys (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9) +{ + char const *v[9] = { x1, x2, x3, x4, x5, x6, x7, x8, x9 } ; + strerr_warnvsys(v, 9) ; +} diff --git a/src/libstrerr/strerr_warn9x.c b/src/libstrerr/strerr_warn9x.c new file mode 100644 index 0000000..956bd4e --- /dev/null +++ b/src/libstrerr/strerr_warn9x.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/strerr.h> + +void strerr_warn9x (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9) +{ + char const *v[9] = { x1, x2, x3, x4, x5, x6, x7, x8, x9 } ; + strerr_warnv(v, 9) ; +} diff --git a/src/libstrerr/strerr_warnl.c b/src/libstrerr/strerr_warnl.c new file mode 100644 index 0000000..17c370d --- /dev/null +++ b/src/libstrerr/strerr_warnl.c @@ -0,0 +1,22 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <stdarg.h> + +#include <skalibs/strerr.h> + +void strerr_warnl (unsigned int n, ...) +{ + if (n) + { + va_list ap ; + char const *v[n] ; + va_start(ap, n) ; + va_arg(ap, unsigned int) ; + for (unsigned int i = 0 ; i < n ; i++) + v[i++] = va_arg(ap, char const *) ; + va_end(ap) ; + strerr_warnv(v, n) ; + } +} diff --git a/src/libstrerr/strerr_warnlsys.c b/src/libstrerr/strerr_warnlsys.c new file mode 100644 index 0000000..fbd7a6b --- /dev/null +++ b/src/libstrerr/strerr_warnlsys.c @@ -0,0 +1,22 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <stdarg.h> +#include <string.h> +#include <errno.h> + +#include <skalibs/strerr.h> + +void strerr_warnlsys (unsigned int n, ...) +{ + va_list ap ; + char const *v[n+1] ; + va_start(ap, n) ; + va_arg(ap, unsigned int) ; + for (unsigned int i = 0 ; i < n ; i++) + v[i++] = va_arg(ap, char const *) ; + va_end(ap) ; + v[n] = strerror(errno) ; + strerr_warnv(v, n+1) ; +} diff --git a/src/libstrerr/strerr_warnv.c b/src/libstrerr/strerr_warnv.c new file mode 100644 index 0000000..f59cfe9 --- /dev/null +++ b/src/libstrerr/strerr_warnv.c @@ -0,0 +1,17 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <errno.h> + +#include <skalibs/buffer.h> +#include <skalibs/strerr.h> + +void strerr_warnv (char const *const *v, unsigned int n) +{ + int e = errno ; + for (unsigned int i = 0 ; i < n ; i++) + if (v[i]) buffer_puts(buffer_2, v[i]) ; + buffer_putflush(buffer_2, "\n", 1) ; + errno = e ; +} diff --git a/src/libstrerr/strerr_warnvsys.c b/src/libstrerr/strerr_warnvsys.c new file mode 100644 index 0000000..fcab1b8 --- /dev/null +++ b/src/libstrerr/strerr_warnvsys.c @@ -0,0 +1,20 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <string.h> +#include <errno.h> + +#include <skalibs/buffer.h> +#include <skalibs/strerr.h> + +void strerr_warnvsys (char const *const *v, unsigned int n) +{ + int e = errno ; + for (unsigned int i = 0 ; i < n ; i++) + if (v[i]) buffer_puts(buffer_2, v[i]) ; + buffer_put(buffer_2, ": ", 2) ; + buffer_puts(buffer_2, strerror(e)) ; + buffer_putflush(buffer_2, "\n", 1) ; + errno = e ; +} |