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 __DATATYPES_H
23 #define __DATATYPES_H
24 
25 #define FREE 0
26 #define LOCKED 1
27 
28 #define KEEP_HISTORY 1
29 #define KILL_HISTORY 2
30 
31 #define SOFT_HYPHEN 0xAD
32 #define KEY_NOTHING 99999
33 
34 #define HIGHLIGHT 1000
35 
36 typedef struct
37 {
38 	char lastsearch[256];	/* last searched regexp */
39 	char type;				/* type of the last search (global/local) */
40 	int search;				/* if true -- search again */
41 }
42 SearchAgain;
43 
44 typedef struct
45 {
46 	char filename[256];		/* name of file, where's the given offset */
47 	long offset;			/* offset of the node */
48 }
49 Indirect;
50 
51 typedef struct
52 {
53 	char nodename[256];		/* name of the node */
54 	long offset;			/* offset of the node */
55 }
56 TagTable;
57 
58 typedef struct
59 {
60 	int length;
61 	char **node;	/* array of history of nodes */
62 	char **file;	/* array of history of files, associated with given nodes */
63 	int *pos;		/* history of pos offsets in viewed nodes */
64 	int *cursor;	/* history of cursor offsets in viewed nodes */
65 	int *menu;		/* history of menu positions (in sequential reading) in viewed nodes */
66 }
67 InfoHistory;
68 
69 typedef struct
70 {
71 	unsigned line;			/* line number of the place where the link is */
72 	unsigned col;			/* column number ----||---- */
73 	int breakpos;		/* col number, where the links breaks to next line */
74 	int type;			/* type of link: 0 -  * menu::,
75 						   1 -  * Comment: menu.
76 						   2 -  *note note::
77 						   3 -  *note Comment: note.
78 						   4 -  http url
79 						   5 -  ftp url
80 						   6 -  mailto url */
81 	char node[256];		/* name of the referenced node */
82 	int nodelen;		/* length of string node */
83 	char file[256];		/* name of the referenced file -- none=this file */
84 	int filelen;		/* length of string file */
85 	int tagtableoffset;	/* offset in tag table */
86 }
87 HyperObject;
88 
89 extern int verbose;
90 
91 /*
92  * Prefix directory of the infopage.  It is used when we view a given set of
93  * infopages, eg. bfd* pages. We want all pages to be read from one directory.
94  * And this path points to that directory, and openinfo() will try to open the
95  * file only in this directory (if this variable is set nonzero)
96  */
97 extern char *filenameprefix;
98 
99 /* name of http viewer (i.e. lynx) */
100 extern char *httpviewer;
101 /* name of ftp viewer */
102 extern char *ftpviewer;
103 /* name of maileditor */
104 extern char *maileditor;
105 /* name of the printing utility */
106 extern char *printutility;
107 /* man sections, considered to be highlighted  as links */
108 extern char *manlinks;
109 /* configured paths to infopages */
110 extern char *configuredinfopath;
111 /* groff/troff macros which are removed while preformatting manual page */
112 extern char *ignoredmacros;
113 /* a user specified rc file */
114 extern char *rcfile;
115 
116 /* temporary filename */
117 extern char *tmpfilename1;
118 /* second tmp filename--needed by regexp search, etc */
119 extern char *tmpfilename2;
120 
121 /* a structure for "search again" feature */
122 extern SearchAgain searchagain;
123 
124 /* an array of references for info */
125 extern HyperObject *hyperobjects;
126 extern unsigned long hyperobjectcount;
127 /* an array of indirect entries [1 to n] */
128 extern Indirect *indirect;
129 /* number of indirect entries */
130 extern unsigned IndirectEntries;
131 /* an array of tag table entries [1 to n] */
132 extern TagTable *tag_table;
133 /* offset of the first node in info file */
134 extern long FirstNodeOffset;
135 /* name of the first node in info file */
136 extern char FirstNodeName[256];
137 /* number of tag table entries */
138 extern unsigned TagTableEntries;
139 /* maximum dimensions of screen */
140 extern unsigned int maxx, maxy;
141 extern InfoHistory infohistory;
142 /* position to by set when moving via history */
143 extern int npos;
144 /* cursor pos to be set when..... as above */
145 extern int ncursor;
146 /* sequential reading menu pos..... as above */
147 extern int nmenu;
148 /* determines if the apropos should be called if searching for aproprimate
149  * document fails */
150 extern int use_apropos;
151 /* determines if we want only apropos output to be displayed */
152 extern int plain_apropos;
153 /* determines if man handling routines should try to cut off the repeating
154  * headers */
155 extern int CutManHeaders;
156 /* determines if man loading routines should try to cut out the repeating empty
157  * double-newlines */
158 extern int CutEmptyManLines;
159 /* Determines if you wish to initialize the tag table automaticaly, or you wish
160  * that pinfo does it alone. Some info pages may have corrupt tag table (i.e.
161  * some versions of jed pages */
162 extern int ForceManualTagTable;
163 /* Causes manual link sections to be treated as long names (i.e. 3x11 instead
164  * of 3) */
165 extern int LongManualLinks;
166 /* options passed to the `man' program */
167 extern char *ManOptions;
168 /* shell code to redirect stderr output */
169 extern char *StderrRedirection;
170 /* convert 0xb7 values in man pages to 'o'? */
171 extern int FilterB7;
172 /* determines if pinfo should ask for quit confirmation */
173 extern int ConfirmQuit;
174 /* determines the deafult answer to yes/no dialog, when finishing work with
175  * pinfo */
176 extern int QuitConfirmDefault;
177 /* determines if pinfo should clear the screen at exit */
178 extern int ClearScreenAtExit;
179 /* determines whether when using readline wrapper to call the latest history
180  * entry as default prompt or not */
181 extern int CallReadlineHistory;
182 /* quote ignored macros when watching page */
183 extern int quote_ignored;
184 /* set by SIGWINCH handler */
185 extern int winchanged;
186 /* true if we prefer man pages over info pages */
187 extern int use_manual;
188 /* true if pinfo/curses should grab the mouse and override normal terminal mouse behaviour */
189 extern int grab_mouse;
190 /* if true, search the current directory first, before checking /sur/share/info etc */
191 extern int use_raw_filename;
192 /* If set to true , pinfo will not attempt to display texinfo pages without tag tables */
193 extern int DontHandleWithoutTagTable;
194 
195 
196 /* initialize history (see struct above) * variables for `lastread' history */
197 void inithistory ();
198 /* adds a history entry to the info file `lastread' history */
199 void addinfohistory (char *file, char *node, int cursor, int menu, int pos);
200 /* deletes last history entry */
201 void dellastinfohistory ();
202 
203 /* clears the default searchpath for openinfo() */
204 void clearfilenameprefix ();
205 
206 #endif
207