]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/blob - src/constants.h
675864c6219e0056752f63b5d65f0b2baa5d65f2
[coloredstderr/coloredstderr.git] / src / constants.h
1 /*
2  * Global constants and defines.
3  *
4  * Copyright (C) 2013-2015  Simon Ruderich
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20 #ifndef CONSTANTS_H
21 #define CONSTANTS_H 1
22
23 /* Names of used environment variables. */
24 #define ENV_NAME_FDS              "COLORED_STDERR_FDS"
25 #define ENV_NAME_PRE_STRING       "COLORED_STDERR_PRE"
26 #define ENV_NAME_POST_STRING      "COLORED_STDERR_POST"
27 #define ENV_NAME_FORCE_WRITE      "COLORED_STDERR_FORCE_WRITE"
28 #define ENV_NAME_IGNORED_BINARIES "COLORED_STDERR_IGNORED_BINARIES"
29 #define ENV_NAME_PRIVATE_FDS      "COLORED_STDERR_PRIVATE_FDS"
30
31 /* Strings written before/after each matched function. */
32 #define DEFAULT_PRE_STRING  "\033[31m" /* red */
33 #define DEFAULT_POST_STRING "\033[0m"  /* default */
34
35 /* Number of elements to allocate statically. Highest descriptor observed in
36  * normal use was 255 (by bash), which yielded this limit to prevent
37  * unnecessary calls to malloc() whenever possible. */
38 #define TRACKFDS_STATIC_COUNT 256
39 /* Number of new elements to allocate per realloc(). */
40 #define TRACKFDS_REALLOC_STEP 10
41
42 #ifdef DEBUG
43 # define DEBUG_FILE "colored_stderr_debug_log.txt"
44 #endif
45 #ifdef WARNING
46 /* Created in the user's home directory, appends to existing file. */
47 # define WARNING_FILE "colored_stderr_warning_log.txt"
48 #endif
49
50 #endif