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