X-Git-Url: http://git.tuebingen.mpg.de/?p=adu.git;a=blobdiff_plain;f=error.h;h=010af4559bcb9b0a4e3ca5f329dd35629be762a7;hp=00bdede471394e7a051a81674bdda18aa4d1c4cd;hb=0ce992a299e8b69a41cb2fb748bd19aee1fe323b;hpb=d2ce6e60cb915dff3a0920a0b48f786435bd4ec8 diff --git a/error.h b/error.h index 00bdede..010af45 100644 --- a/error.h +++ b/error.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Andre Noll + * Copyright (C) 2008 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -33,7 +33,7 @@ _ERROR(EMPTY, "file empty") \ _ERROR(MMAP, "mmap error") \ _ERROR(OSL, "osl error") \ - _ERROR(SIGNAL_SIG_ERR, "signal() returned SIG_ERR") \ + _ERROR(SIGACTION, "could not install signal handler") \ _ERROR(OUTPUT, "error writing output") \ _ERROR(MALFORMED_FORMAT, "malformed format string") \ _ERROR(BAD_ALIGN_SPEC, "bad alignment specifier") \ @@ -42,7 +42,8 @@ _ERROR(BAD_UNIT, "invalid unit specifier") \ _ERROR(BAD_ATOM, "invalid atom") \ _ERROR(BAD_OUTPUT_ARG, "invalid name for output") \ - _ERROR(REGEX, "regular expression error") + _ERROR(REGEX, "regular expression error") \ + _ERROR(MKDIR, "could not create directory") /** @@ -74,25 +75,7 @@ extern int osl_errno; /** Contains the description of all adu error codes. */ extern char *adu_errlist[]; - -/** - * adu's version of strerror(3). - * - * \param num The error number. - * - * \return The error text of \a num. - */ -_static_inline_ const char *adu_strerror(int num) -{ - assert(num > 0); - if (num == E_OSL) { - assert(osl_errno > 0); - return osl_strerror((osl_errno)); - } - if (IS_SYSTEM_ERROR(num)) - return strerror((num) & ((1 << SYSTEM_ERROR_BIT) - 1)); - return adu_errlist[num]; -} +extern const char *adu_strerror(int num); /** * Wrapper for osl library calls.