Include <time.h> to declare "gmtime()".
[obnox/wireshark/wip.git] / globals.h
1 /* globals.h
2  * Global defines, etc.
3  *
4  * $Id: globals.h,v 1.13 1999/12/29 05:48:25 guy Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@zing.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * 
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  * 
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  * 
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifndef __GLOBALS_H__
27 #define __GLOBALS_H__
28
29 #ifndef _STDIO_H_
30 #include <stdio.h>
31 #endif
32
33 #ifndef __PACKET_H__
34 #include "packet.h"
35 #endif
36
37 #ifndef __PRINT_H__
38 #include "print.h"
39 #endif
40
41 #ifndef __FILE_H__
42 #include "file.h"
43 #endif
44
45 #ifndef __TIMESTAMP_H__
46 #include "timestamp.h"
47 #endif
48
49 #define MIN_PACKET_SIZE 68      /* minimum amount of packet data we can read */
50
51 /* Byte swapping routines */
52 #define SWAP16(x) \
53   ( (((x) & 0x00ff) << 8) | \
54     (((x) & 0xff00) >> 8) )
55 #define SWAP32(x) \
56   ( (((x) & 0x000000ff) << 24) | \
57     (((x) & 0x0000ff00) <<  8) | \
58     (((x) & 0x00ff0000) >>  8) | \
59     (((x) & 0xff000000) >> 24) )
60
61 /* Byte ordering */
62 #ifndef BYTE_ORDER
63 # define LITTLE_ENDIAN 4321
64 # define BIG_ENDIAN 1234
65 # ifdef WORDS_BIGENDIAN
66 #  define BYTE_ORDER BIG_ENDIAN
67 # else
68 #  define BYTE_ORDER LITTLE_ENDIAN
69 # endif
70 #endif
71
72 /* From the K&R book, p. 89 */
73 #ifndef MAX
74 # define MAX(x, y) ((x) > (y) ? (x) : (y))
75 #endif
76
77 #ifndef MIN
78 # define MIN(x, y) ((x) < (y) ? (x) : (y))
79 #endif
80
81 extern FILE        *data_out_file;
82 extern packet_info  pi;
83 extern capture_file cf;
84 extern guint        main_ctx, file_ctx;
85 extern gchar        comp_info_str[256];
86 extern gchar       *ethereal_path;
87 extern gchar       *medium_font;
88 extern gchar       *bold_font;
89 extern gchar       *last_open_dir;
90 extern gboolean     auto_scroll_live;
91 extern int          g_resolving_actif;
92 extern field_info  *finfo_selected;
93
94 extern ts_type timestamp_type;
95
96 #define PF_DIR ".ethereal"
97
98 #endif