X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Ferror.h;h=03af109a14fbc3772af12fe2661ab31a2e3d3f9a;hp=f927078f17726f4e4bb4a755ce16c73e3ab93caa;hb=efc18125536a8a4679d78fe90883414f8e34a8f2;hpb=97e190465f6a2a7d5bf72f445bb4d9d8544a0916 diff --git a/src/common/error.h b/src/common/error.h index f927078f1..03af109a1 100644 --- a/src/common/error.h +++ b/src/common/error.h @@ -1,18 +1,18 @@ /* * Copyright (C) 2011 - David Goulet * - * 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; only version 2 of the License. - * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2 only, + * as published by the Free Software Foundation. + * * 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, write to the Free Software Foundation, Inc., 59 Temple - * Place - Suite 330, Boston, MA 02111-1307, USA. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _ERROR_H @@ -20,12 +20,15 @@ #include #include +#include #include #ifndef _GNU_SOURCE #error "lttng-tools error.h needs _GNU_SOURCE" #endif +#include + /* Stringify the expansion of a define */ #define XSTR(d) STR(d) #define STR(s) #s @@ -64,6 +67,8 @@ extern int lttng_opt_verbose; #define MSG(fmt, args...) \ __lttng_print(PRINT_MSG, fmt "\n", ## args) +#define _MSG(fmt, args...) \ + __lttng_print(PRINT_MSG, fmt, ## args) #define ERR(fmt, args...) \ __lttng_print(PRINT_ERR, "Error: " fmt "\n", ## args) #define WARN(fmt, args...) \ @@ -107,4 +112,6 @@ extern int lttng_opt_verbose; } while(0); #endif +const char *error_get_str(int32_t code); + #endif /* _ERROR_H */