Disable graph drawing for reverse log order
[tig.git] / util.h
blob7e7539d87f9fd26da2c6a09321c894f3bc9d22e5
1 /* Copyright (c) 2006-2013 Jonas Fonseca <fonseca@diku.dk>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #ifndef TIG_UTIL_H
15 #define TIG_UTIL_H
17 #include "tig.h"
19 #define STATUS_CODE_INFO(_) \
20 _(INTEGER_VALUE_OUT_OF_BOUND, "Integer value out of bound"), \
21 _(INVALID_STEP_VALUE, "Invalid step value"), \
22 _(NO_OPTION_VALUE, "No option value"), \
23 _(NO_VALUE_ASSIGNED, "No value assigned"), \
24 _(OBSOLETE_REQUEST_NAME, "Obsolete request name"), \
25 _(OUT_OF_MEMORY, "Out of memory"), \
26 _(TOO_MANY_OPTION_ARGUMENTS, "Too many option arguments"), \
27 _(FILE_DOES_NOT_EXIST, "File does not exist"), \
28 _(UNKNOWN_ATTRIBUTE, "Unknown attribute"), \
29 _(UNKNOWN_COLOR, "Unknown color"), \
30 _(UNKNOWN_COLOR_NAME, "Unknown color name"), \
31 _(UNKNOWN_KEY, "Unknown key"), \
32 _(UNKNOWN_KEY_MAP, "Unknown key map"), \
33 _(UNKNOWN_OPTION_COMMAND, "Unknown option command"), \
34 _(UNKNOWN_REQUEST_NAME, "Unknown request name"), \
35 _(UNKNOWN_VARIABLE_NAME, "Unknown variable name"), \
36 _(UNMATCHED_QUOTATION, "Unmatched quotation"), \
37 _(WRONG_NUMBER_OF_ARGUMENTS, "Wrong number of arguments"), \
38 _(HOME_UNRESOLVABLE, "HOME environment variable could not be resolved"),
40 enum status_code {
41 SUCCESS,
42 #define STATUS_CODE_ENUM(name, msg) ERROR_ ## name
43 STATUS_CODE_INFO(STATUS_CODE_ENUM)
46 const char *get_status_message(enum status_code code);
48 typedef void (*die_fn)(void);
49 extern die_fn die_callback;
50 void TIG_NORETURN die(const char *err, ...) PRINTF_LIKE(1, 2);
51 void warn(const char *msg, ...) PRINTF_LIKE(1, 2);
53 #endif
54 /* vim: set ts=8 sw=8 noexpandtab: */