/* tinyproxy - A fast light-weight HTTP proxy * Copyright (C) 2002 Robert James Kaes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* This file groups all the headers required throughout the tinyproxy * system. All this information use to be in the "main.h" header, * but various other "libraries" in the program need the same information, * without the tinyproxy specific defines. */ #ifndef COMMON_HEADER_H #define COMMON_HEADER_H #ifdef HAVE_CONFIG_H # include #endif /* * Include standard headers which are used through-out tinyproxy */ /* standard C headers - we can safely assume they exist. */ #include #include #include #include #include #include #include /* standard POSIX headers - they need to be there as well. */ # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include /* rest - some oddball headers */ #ifdef HAVE_VALUES_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_ALLOCA_H # include #endif #ifdef HAVE_MEMORY_H # include #endif #ifdef HAVE_MALLOC_H # include #endif #ifdef HAVE_SYSEXITS_H # include #endif /* * If MSG_NOSIGNAL is not defined, define it to be zero so that it doesn't * cause any problems. */ #ifndef MSG_NOSIGNAL # define MSG_NOSIGNAL (0) #endif #ifndef SHUT_RD /* these three Posix.1g names are quite new */ # define SHUT_RD 0 /* shutdown for reading */ # define SHUT_WR 1 /* shutdown for writing */ # define SHUT_RDWR 2 /* shutdown for reading and writing */ #endif #define MAXLISTEN 1024 /* Max number of connections */ /* * SunOS doesn't have INADDR_NONE defined. */ #ifndef INADDR_NONE # define INADDR_NONE -1 #endif /* Define boolean values */ #ifndef FALSE # define FALSE 0 # define TRUE (!FALSE) #endif /* Useful function macros */ #if !defined(min) || !defined(max) # define min(a,b) ((a) < (b) ? (a) : (b)) # define max(a,b) ((a) > (b) ? (a) : (b)) #endif #endif