1 /* Color and styling handling. 2 Copyright (C) 2006, 2019 Free Software Foundation, Inc. 3 Written by Bruno Haible <bruno@clisp.org>, 2006. 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 17 18 #ifndef _COLOR_H 19 #define _COLOR_H 20 21 #include <stdbool.h> 22 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 29 /* Whether to output a test page. */ 30 extern LIBTEXTSTYLE_DLL_VARIABLE bool color_test_mode; 31 32 /* Color option. */ 33 enum color_option { color_no, color_tty, color_yes, color_html }; 34 extern LIBTEXTSTYLE_DLL_VARIABLE enum color_option color_mode; 35 36 /* Style to use when coloring. */ 37 extern LIBTEXTSTYLE_DLL_VARIABLE const char *style_file_name; 38 39 /* --color argument handling. Return an error indicator. */ 40 extern bool handle_color_option (const char *option); 41 42 /* --style argument handling. */ 43 extern void handle_style_option (const char *option); 44 45 /* Print a color test page. */ 46 extern void print_color_test (void); 47 48 /* Assign a default value to style_file_name if necessary. 49 STYLE_FILE_ENVVAR is an environment variable that, when set to a non-empty 50 value, specifies the style file to use. This environment variable is meant 51 to be set by the user. 52 STYLESDIR_ENVVAR is an environment variable that, when set to a non-empty 53 value, specifies the directory with the style files, or NULL. This is 54 necessary for running the testsuite before "make install". 55 STYLESDIR_AFTER_INSTALL is the directory with the style files after 56 "make install". 57 DEFAULT_STYLE_FILE is the file name of the default style file, relative to 58 STYLESDIR. */ 59 extern void style_file_prepare (const char *style_file_envvar, 60 const char *stylesdir_envvar, 61 const char *stylesdir_after_install, 62 const char *default_style_file); 63 64 65 #ifdef __cplusplus 66 } 67 #endif 68 69 70 #endif /* _COLOR_H */ 71