/usr/include/lime/ErrorReporting.h is in liblimesuite-dev 17.12.0+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | /**
@file ErrorReporting.h
@author Lime Microsystems
@brief API for reporting error codes and error messages.
All calls are thread-safe using thread-local storage.
Code returning with an error should use:
return lime::ReportError(code, message, ...);
*/
#ifndef LIMESUITE_ERROR_REPORTING_H
#define LIMESUITE_ERROR_REPORTING_H
#include "LimeSuiteConfig.h"
#include <cerrno>
#include <string>
#include <stdexcept>
#include <cstdarg>
namespace lime
{
/*!
* Get the error code reported.
*/
LIME_API int GetLastError(void);
/*!
* Get the error code to string + any optional message reported.
*/
LIME_API const char *GetLastErrorMessage(void);
/*!
* Report a typical errno style error.
* The resulting error message comes from strerror().
* \param errnum a recognized error code
* \return a non-zero status code to return
*/
LIME_API int ReportError(const int errnum);
/*!
* Report an error as an integer code and a formatted message string.
* \param errnum a recognized error code
* \param format a format string followed by args
* \return a non-zero status code to return
*/
inline int ReportError(const int errnum, const char *format, ...);
/*!
* Report an error as a formatted message string.
* The reported errnum is 0 - no relevant error code.
* \param format a format string followed by args
* \return a non-zero status code to return
*/
inline int ReportError(const char *format, ...);
/*!
* Report an error as an integer code and message format arguments
* \param errnum a recognized error code
* \param format a printf-style format string
* \param argList the format string args as a va_list
* \return a non-zero status code to return
*/
LIME_API int ReportError(const int errnum, const char *format, va_list argList);
}
inline int lime::ReportError(const int errnum, const char *format, ...)
{
va_list argList;
va_start(argList, format);
int status = lime::ReportError(errnum, format, argList);
va_end(argList);
return status;
}
inline int lime::ReportError(const char *format, ...)
{
va_list argList;
va_start(argList, format);
int status = lime::ReportError(-1, format, argList);
va_end(argList);
return status;
}
#endif //LIMESUITE_ERROR_REPORTING_H
|