1b1892773SAxel Dörfler/* -*- c-basic-offset: 8; -*- */
2b1892773SAxel Dörfler#ifndef	GLOBAL_H
3b1892773SAxel Dörfler#define	GLOBAL_H
4b1892773SAxel Dörfler
5b1892773SAxel Dörfler#include "config.h"   /* configuration options for current OS */
6b1892773SAxel Dörfler
7b1892773SAxel Dörfler#ifdef HAVE_SYS_TYPES_H
8b1892773SAxel Dörfler#include <sys/types.h>
9b1892773SAxel Dörfler#endif
10b1892773SAxel Dörfler#include <errno.h>
11b1892773SAxel Dörfler#include <sys/socket.h>
12b1892773SAxel Dörfler
13b1892773SAxel Dörfler#ifndef	HAVE_ADDRINFO_STRUCT
14b1892773SAxel Dörfler#include "addrinfo.h"
15b1892773SAxel Dörfler#endif
16b1892773SAxel Dörfler
17b1892773SAxel Dörfler/* Older resolvers do not have gethostbyname2() */
18b1892773SAxel Dörfler#ifndef	HAVE_GETHOSTBYNAME2
19b1892773SAxel Dörfler#define	gethostbyname2(host,family)		gethostbyname((host))
20b1892773SAxel Dörfler#endif
21b1892773SAxel Dörfler
22b1892773SAxel Dörfler/* This avoids a warning with glibc compilation */
23b1892773SAxel Dörfler#ifndef errno
24b1892773SAxel Dörflerextern int errno;
25b1892773SAxel Dörfler#endif
26b1892773SAxel Dörfler
27b1892773SAxel Dörfler
28b1892773SAxel Dörfler/* Miscellaneous constants */
29b1892773SAxel Dörfler#define	MAXLINE	     4096	/* max text line length */
30b1892773SAxel Dörfler#define	MAXSOCKADDR  128	/* max socket address structure size */
31b1892773SAxel Dörfler#define	BUFFSIZE     8192	/* buffer size for reads and writes */
32b1892773SAxel Dörfler
33b1892773SAxel Dörfler/* stdin and stdout file descriptors */
34b1892773SAxel Dörfler#define STDIN_FILENO  0
35b1892773SAxel Dörfler#define STDOUT_FILENO 1
36b1892773SAxel Dörfler
37b1892773SAxel Dörfler#define	min(a,b)	((a) < (b) ? (a) : (b))
38b1892773SAxel Dörfler#define	max(a,b)	((a) > (b) ? (a) : (b))
39b1892773SAxel Dörfler
40b1892773SAxel Dörfler
41b1892773SAxel Dörfler#endif
42