1 /*************************************************************************** 2 * Pinfo is a ncurses based lynx style info documentation browser 3 * 4 * Copyright (C) 1999 Przemek Borys <pborys@dione.ids.pl> 5 * Copyright (C) 2005 Bas Zoetekouw <bas@debian.org> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of version 2 of the GNU General Public License as 9 * published by the Free Software Foundation. 10 * 11 * This program is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * 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, write to the Free Software 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 19 * USA 20 ***************************************************************************/ 21 22 #ifndef __COMMON_INCLUDES_H 23 #define __COMMON_INCLUDES_H 24 25 /* make sure unistd.h defines sbrk() */ 26 #define _DEFAULT_SOURCE 1 27 #define _BSD_SOURCE 1 28 29 #include <stdio.h> 30 #include <libgen.h> 31 #include <string.h> 32 #include <strings.h> 33 #include <stdlib.h> 34 #include <signal.h> 35 #include <unistd.h> 36 #include <ctype.h> 37 #include <sys/types.h> 38 #include <sys/stat.h> 39 #include <pwd.h> 40 #include <grp.h> 41 #include <assert.h> 42 43 #include "../config.h" 44 45 #if HAVE_NCURSESW_H /* if <ncursesw.h> should be used */ 46 # include <ncursesw.h> 47 #elif HAVE_NCURSESW_CURSES_H /* if <ncursesw/curses.h> should be used */ 48 # include <ncursesw/curses.h> 49 #elif HAVE_NCURSES_H /* if <ncurses.h> should be used */ 50 # include <ncurses.h> 51 #elif HAVE_NCURSES_CURSES_H /* if <ncurses/curses.h> should be used */ 52 # include <ncurses/curses.h> 53 #elif HAVE_CURSES_H /* if <curses.h> is present and should be used */ 54 # include <curses.h> 55 #else 56 # error "No valid curses headers detected" 57 #endif 58 59 #include "localestuff.h" 60 61 #include "datatypes.h" 62 #include "filehandling_functions.h" 63 #include "video.h" 64 #include "menu_and_note_utils.h" 65 #include "mainfunction.h" 66 #include "utils.h" 67 #include "signal_handler.h" 68 #include "colors.h" 69 #include "regexp_search.h" 70 #include "manual.h" 71 #include "parse_config.h" 72 #include "keyboard.h" 73 #include "initializelinks.h" 74 #include "printinfo.h" 75 76 /* 77 * Readline isn't safe for nonlinux terminals (i.e. vt100) 78 * But if you have readline linked with ncurses you may enable readline with 79 * ./configure --with-readline 80 * 81 */ 82 #ifndef HAS_READLINE 83 #include "readlinewrapper.h" 84 #endif /* HAS_READLINE */ 85 86 #ifndef HAVE_SIGBLOCK 87 #include "sigblock.h" 88 #endif 89 90 /* I hear voices, that it is needed by RH5.2 ;) */ 91 #define _REGEX_RE_COMP 92 93 /* somewhat portable way of flagging unused vars 94 * from https://stackoverflow.com/questions/7090998/portable-unused-parameter-macro-used-on-function-signature-for-c-and-c 95 */ 96 #ifdef UNUSED 97 #elif defined(__GNUC__) 98 # define UNUSED(x) x __attribute__((unused)) 99 #elif defined(__LCLINT__) 100 # define UNUSED(x) /*@unused@*/ x 101 #elif defined(__cplusplus) 102 # define UNUSED(x) 103 #else 104 # define UNUSED(x) x 105 #endif 106 107 #endif 108