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