Instead of having the normal-weight and bold fonts set separately,
[metze/wireshark/wip.git] / globals.h
1 /* globals.h
2  * Global defines, etc.
3  *
4  * $Id: globals.h,v 1.21 2000/08/20 07:53:30 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 #include <stdio.h>
30 #include "packet.h"
31 #include "file.h"
32 #include "timestamp.h"
33
34 #define MIN_PACKET_SIZE 68      /* minimum amount of packet data we can read */
35
36 /* Byte swapping routines */
37 #define SWAP16(x) \
38   ( (((x) & 0x00ff) << 8) | \
39     (((x) & 0xff00) >> 8) )
40 #define SWAP32(x) \
41   ( (((x) & 0x000000ff) << 24) | \
42     (((x) & 0x0000ff00) <<  8) | \
43     (((x) & 0x00ff0000) >>  8) | \
44     (((x) & 0xff000000) >> 24) )
45
46 /* Byte ordering */
47 #ifndef BYTE_ORDER
48 # define LITTLE_ENDIAN 4321
49 # define BIG_ENDIAN 1234
50 # ifdef WORDS_BIGENDIAN
51 #  define BYTE_ORDER BIG_ENDIAN
52 # else
53 #  define BYTE_ORDER LITTLE_ENDIAN
54 # endif
55 #endif
56
57 /* From the K&R book, p. 89 */
58 #ifndef MAX
59 # define MAX(x, y) ((x) > (y) ? (x) : (y))
60 #endif
61
62 #ifndef MIN
63 # define MIN(x, y) ((x) < (y) ? (x) : (y))
64 #endif
65
66 extern packet_info  pi;
67 extern capture_file cfile;
68 extern guint        main_ctx, file_ctx;
69 extern gchar        comp_info_str[256];
70 extern gchar       *ethereal_path;
71 extern gchar       *last_open_dir;
72 extern gboolean     auto_scroll_live;
73 extern int          g_resolving_actif;
74 extern gboolean     g_ip_dscp_actif;
75 extern field_info  *finfo_selected;
76
77 extern ts_type timestamp_type;
78
79 #define PF_DIR ".ethereal"
80
81 #endif