1 /* $Cambridge: exim/src/exim_monitor/em_hdr.h,v 1.6 2007/01/08 10:50:17 ph10 Exp $ */
3 /*************************************************
5 *************************************************/
7 /* Copyright (c) University of Cambridge 1995 - 2007 */
8 /* See the file NOTICE for conditions of use and distribution. */
11 /* This is the general header file for all the modules that comprise
12 the exim monitor program. */
14 /* If this macro is defined, Eximon will anonymize all email addresses. This
15 feature is just so that screen shots can be obtained for documentation
18 /* #define ANONYMIZE */
20 /* System compilation parameters */
22 #define queue_index_size 10 /* Size of index into queue */
24 /* Assume most systems have statfs() unless os.h undefines this macro */
28 /* Bring in the system-dependent stuff */
44 /* Not-fully-ANSI systems (e.g. SunOS4 are missing some things) */
54 #include <sys/types.h>
60 #include <sys/param.h>
64 /* The new standard is statvfs; some OS have statfs. Also arrange
65 to be able to cut it out altogether for way-out OS that don't have
69 #ifdef HAVE_SYS_STATVFS_H
70 #include <sys/statvfs.h>
73 #define statvfs statfs
76 #ifdef HAVE_SYS_STATFS_H
77 #include <sys/statfs.h>
80 #ifdef HAVE_SYS_MOUNT_H
81 #include <sys/mount.h>
88 /* Regular expression include */
90 #include "pcre/pcre.h"
92 /* Includes from the main source of Exim. We need to have MAXPACKET defined for
93 the benefit of structs.h. One of these days I should tidy up this interface so
94 that this kind of kludge isn't needed. */
96 #define MAXPACKET 1024
102 #include "local_scan.h"
105 #include "functions.h"
106 #include "osfunctions.h"
109 /* The sys/resource.h header on SunOS 4 causes trouble with the gcc
110 compiler. Just stuff the bit we want in here; pragmatic easy way out. */
112 #ifdef NO_SYS_RESOURCE_H
113 #define RLIMIT_NOFILE 6 /* maximum descriptor index + 1 */
115 int rlim_cur; /* current (soft) limit */
116 int rlim_max; /* maximum value for rlim_cur */
119 #include <sys/time.h>
120 #include <sys/resource.h>
125 #include <X11/Xlib.h>
126 #include <X11/Intrinsic.h>
127 #include <X11/StringDefs.h>
128 #include <X11/cursorfont.h>
129 #include <X11/keysym.h>
130 #include <X11/Shell.h>
131 #include <X11/Xaw/AsciiText.h>
132 #include <X11/Xaw/Command.h>
133 #include <X11/Xaw/Form.h>
134 #include <X11/Xaw/Dialog.h>
135 #include <X11/Xaw/Label.h>
136 #include <X11/Xaw/SimpleMenu.h>
137 #include <X11/Xaw/SmeBSB.h>
138 #include <X11/Xaw/SmeLine.h>
139 #include <X11/Xaw/TextSrc.h>
140 #include <X11/Xaw/TextSink.h>
142 /* These are required because exim monitor has its own munged
143 version of the stripchart widget. */
145 #include <X11/IntrinsicP.h>
146 #include <X11/StringDefs.h>
147 #include <X11/Xaw/XawInit.h>
148 #include <X11/Xaw/StripCharP.h>
150 extern WidgetClass mystripChartWidgetClass;
154 /*************************************************
156 *************************************************/
158 /* Operations on the in-store message queue */
160 enum { queue_noop, queue_add };
162 /* Operations on the destinations queue */
164 enum { dest_noop, dest_add, dest_remove };
167 /*************************************************
168 * Structure for destinations *
169 *************************************************/
171 typedef struct dest_item {
172 struct dest_item *next;
173 struct dest_item *parent;
179 /*************************************************
180 * Structure for queue items *
181 *************************************************/
183 typedef struct queue_item {
184 struct queue_item *next;
185 struct queue_item *prev;
186 struct dest_item *destinations;
198 /*************************************************
199 * Structure for queue skip items *
200 *************************************************/
202 typedef struct skip_item {
203 struct skip_item *next;
209 /*************************************************
210 * Structure for delivery displays *
211 *************************************************/
213 typedef struct pipe_item {
214 struct pipe_item *next;
221 /*************************************************
223 *************************************************/
225 extern Display *X_display; /* Current display */
226 extern XtAppContext X_appcon; /* Application context */
227 extern XtActionsRec actionTable[]; /* Actions table */
229 extern XtTranslations queue_trans; /* translation table for queue text widget */
230 extern XtTranslations text_trans; /* translation table for other text widgets */
232 extern Widget dialog_ref_widget; /* for positioning dialog box */
233 extern Widget toplevel_widget;
234 extern Widget log_widget; /* widget for tail display */
235 extern Widget queue_widget; /* widget for queue display */
236 extern Widget unhide_widget; /* widget for unhide button */
240 extern int action_output; /* TRUE when wanting action command output */
241 extern int action_queue_update; /* controls auto updates */
242 extern int actionTableSize; /* # entries in actionTable */
243 extern uschar actioned_message[]; /* For menu handling */
244 extern uschar *action_required;
245 extern uschar *alternate_config; /* Alternate Exim configuration file */
247 extern int body_max; /* Max size of body to display */
249 extern int eximon_initialized; /* TRUE when initialized */
251 extern int log_buffer_size; /* size of log buffer */
252 extern BOOL log_datestamping; /* TRUE if logs are datestamped */
253 extern int log_depth; /* depth of log tail window */
254 extern uschar *log_display_buffer; /* to hold display text */
255 extern uschar *log_file; /* supplied name of exim log file */
256 extern uschar log_file_open[256]; /* actual open file */
257 extern uschar *log_font; /* font for log display */
258 extern ino_t log_inode; /* the inode of the log file */
259 extern long int log_position; /* position in log file */
260 extern int log_width; /* width of log tail window */
262 extern uschar *menu_event; /* name of menu event */
263 extern int menu_is_up; /* TRUE when menu displayed */
264 extern int min_height; /* min window height */
265 extern int min_width; /* min window width */
267 extern pipe_item *pipe_chain; /* for delivery displays */
269 extern uschar *qualify_domain;
270 extern int queue_depth; /* depth of queue window */
271 extern uschar *queue_font; /* font for queue display */
272 extern int queue_max_addresses; /* limit on per-message list */
273 extern skip_item *queue_skip; /* for hiding bits of queue */
274 extern uschar *queue_stripchart_name; /* sic */
275 extern int queue_update; /* update interval */
276 extern int queue_width; /* width of queue window */
278 extern pcre *yyyymmdd_regex; /* for matching yyyy-mm-dd */
280 extern uschar *size_stripchart; /* path for size monitoring */
281 extern uschar *size_stripchart_name; /* name for size stripchart */
282 extern uschar *spool_directory; /* Name of exim spool directory */
283 extern int spool_is_split; /* True if detected split spool */
284 extern int start_small; /* True to start with small window */
285 extern int stripchart_height; /* height of stripcharts */
286 extern int stripchart_number; /* number of stripcharts */
287 extern pcre **stripchart_regex; /* vector of regexps */
288 extern uschar **stripchart_title; /* vector of titles */
289 extern int *stripchart_total; /* vector of accumulating values */
290 extern int stripchart_update; /* update interval */
291 extern int stripchart_width; /* width of stripcharts */
292 extern int stripchart_varstart; /* starting number for variable charts */
294 extern int text_depth; /* depth of text windows */
295 extern int tick_queue_accumulator; /* For timing next auto update */
297 extern uschar *window_title; /* title of the exim monitor window */
300 /*************************************************
302 *************************************************/
304 extern XtActionProc dialogAction(Widget, XEvent *, String *, Cardinal *);
306 extern uschar *copystring(uschar *);
307 extern void create_dialog(uschar *, uschar *);
308 extern void create_stripchart(Widget, uschar *);
309 extern void debug(char *, ...);
310 extern dest_item *find_dest(queue_item *, uschar *, int, BOOL);
311 extern queue_item *find_queue(uschar *, int, int);
312 extern void init(int, uschar **);
313 extern void menu_create(Widget, XEvent *, String *, Cardinal *);
314 extern void NonMessageDialogue(uschar *);
315 extern void queue_display(void);
316 extern void read_log(void);
317 extern int read_spool(uschar *);
318 extern int read_spool_init(uschar *);
319 extern void read_spool_tidy(void);
320 extern int repaint_window(StripChartWidget, int, int);
321 extern void scan_spool_input(int);
322 extern void stripchart_init(void);
323 extern void text_empty(Widget);
324 extern void text_show(Widget, uschar *);
325 extern void text_showf(Widget, char *, ...);
326 extern void xs_SetValues(Widget, Cardinal, ...);
328 /* End of em_hdr.h */