/usr/include/shevek/error.hh is in libshevek-dev 1.4-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 | /* error.hh - error and warning handling
* Copyright 2004 Bas Wijnen <wijnen@debian.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SHEVEK_ERROR_HH
#define SHEVEK_ERROR_HH
#include "iostring.hh"
#include <errno.h>
#include <string.h>
#include <glibmm.h>
namespace shevek
{
/// Set whether shevek_error will throw or not.
/** Note that setting this to false may trigger bugs, as it is not tested much.
*/
bool fatal_errors (bool fatal = true);
/// Internal function for printing the errors.
void _error_impl (Glib::ustring const &msg, bool is_error, char const *file, unsigned line, char const *fun);
/// Give an error message with file, line and function information.
#define shevek_error(x) \
shevek::_error_impl ((x), true, __FILE__, __LINE__, __FUNCTION__)
/// Give a warning message with file, line and function information.
#define shevek_warning(x) \
shevek::_error_impl ((x), false, __FILE__, __LINE__, __FUNCTION__)
/// Give an error message with file, line and function information.
/** Use errno to give extra information about the error.
*/
#define shevek_error_errno(x) \
shevek::_error_impl (shevek::ostring ("%s: %s", Glib::ustring (x), strerror (errno)), true, __FILE__, __LINE__, __FUNCTION__)
/// Give a warning message with file, line and function information.
/** Use errno to give extra information about the error.
*/
#define shevek_warning_errno(x) \
shevek::_error_impl (shevek::ostring ("%s: %s", Glib::ustring (x), strerror (errno)), false, __FILE__, __LINE__, __FUNCTION__)
}
#endif
|