Removed the "bool_t" type since it conflicts with the newer C standards.

The type was just replaced by "unsigned int" types.
This commit is contained in:
Robert James Kaes 2002-12-04 17:06:14 +00:00
parent 02d7474a09
commit 0a20bdd5b4
7 changed files with 35 additions and 31 deletions

View File

@ -1,4 +1,4 @@
/* $Id: common.h,v 1.2 2002-05-26 18:49:19 rjkaes Exp $ /* $Id: common.h,v 1.3 2002-12-04 17:06:13 rjkaes Exp $
* *
* This file groups all the headers required throughout the tinyproxy * This file groups all the headers required throughout the tinyproxy
* system. All this information use to be in the "tinyproxy.h" header, * system. All this information use to be in the "tinyproxy.h" header,
@ -175,14 +175,16 @@
#define MAXLISTEN 1024 /* Max number of connections */ #define MAXLISTEN 1024 /* Max number of connections */
/* Define boolean values */
#ifndef FALSE
# define FALSE 0
# define TRUE (!FALSE)
#endif
/* Useful function macros */ /* Useful function macros */
#if !defined(min) || !defined(max)
# define min(a,b) ((a) < (b) ? (a) : (b)) # define min(a,b) ((a) < (b) ? (a) : (b))
# define max(a,b) ((a) > (b) ? (a) : (b)) # define max(a,b) ((a) > (b) ? (a) : (b))
#endif
/* Make a new type: bool_t */
typedef enum {
FALSE = 0,
TRUE = 1
} bool_t;
#endif #endif

View File

@ -1,4 +1,4 @@
/* $Id: conns.h,v 1.10 2002-05-23 18:23:29 rjkaes Exp $ /* $Id: conns.h,v 1.11 2002-12-04 17:06:13 rjkaes Exp $
* *
* See 'conns.c' for a detailed description. * See 'conns.c' for a detailed description.
* *
@ -33,8 +33,9 @@ struct conn_s {
/* The request line (first line) from the client */ /* The request line (first line) from the client */
char *request_line; char *request_line;
bool_t connect_method; /* Booleans */
bool_t show_stats; unsigned int connect_method;
unsigned int show_stats;
/* Store the error response if there is one */ /* Store the error response if there is one */
char *error_string; char *error_string;

View File

@ -1,4 +1,4 @@
/* $Id: reqs.c,v 1.87 2002-11-29 19:25:59 rjkaes Exp $ /* $Id: reqs.c,v 1.88 2002-12-04 17:06:13 rjkaes Exp $
* *
* This is where all the work in tinyproxy is actually done. Incoming * This is where all the work in tinyproxy is actually done. Incoming
* connections have a new child created for them. The child then * connections have a new child created for them. The child then
@ -605,7 +605,7 @@ get_all_headers(int fd, hashmap_t hashofheaders)
{ {
char *header; char *header;
ssize_t len; ssize_t len;
bool_t double_cgi = FALSE; unsigned int double_cgi = FALSE; /* boolean */
assert(fd >= 0); assert(fd >= 0);
assert(hashofheaders != NULL); assert(hashofheaders != NULL);

View File

@ -1,4 +1,4 @@
/* $Id: tinyproxy.c,v 1.41 2002-11-21 21:52:59 rjkaes Exp $ /* $Id: tinyproxy.c,v 1.42 2002-12-04 17:06:14 rjkaes Exp $
* *
* The initialize routine. Basically sets up all the initial stuff (logfile, * The initialize routine. Basically sets up all the initial stuff (logfile,
* listening socket, config options, etc.) and then sits there and loops * listening socket, config options, etc.) and then sits there and loops
@ -46,8 +46,8 @@ extern FILE *yyin;
*/ */
struct config_s config; struct config_s config;
float load = 0.00; float load = 0.00;
bool_t received_sighup = FALSE; unsigned int received_sighup = FALSE; /* boolean */
bool_t processed_config_file = FALSE; unsigned int processed_config_file = FALSE; /* boolean */
/* /*
* Handle a signal * Handle a signal
@ -150,7 +150,7 @@ int
main(int argc, char **argv) main(int argc, char **argv)
{ {
int optch; int optch;
bool_t godaemon = TRUE; unsigned int godaemon = TRUE; /* boolean */
struct passwd *thisuser = NULL; struct passwd *thisuser = NULL;
struct group *thisgroup = NULL; struct group *thisgroup = NULL;
char *conf_file = DEFAULT_CONF_FILE; char *conf_file = DEFAULT_CONF_FILE;

View File

@ -1,4 +1,4 @@
/* $Id: tinyproxy.h,v 1.35 2002-11-26 21:44:43 rjkaes Exp $ /* $Id: tinyproxy.h,v 1.36 2002-12-04 17:06:14 rjkaes Exp $
* *
* See 'tinyproxy.c' for a detailed description. * See 'tinyproxy.c' for a detailed description.
* *
@ -27,17 +27,17 @@
struct config_s { struct config_s {
char *logf_name; char *logf_name;
bool_t syslog; unsigned int syslog; /* boolean */
int port; int port;
char *stathost; char *stathost;
bool_t quit; unsigned int quit; /* boolean */
char *username; char *username;
char *group; char *group;
char *ipAddr; char *ipAddr;
#ifdef FILTER_ENABLE #ifdef FILTER_ENABLE
char *filter; char *filter;
bool_t filter_url; unsigned int filter_url; /* boolean */
bool_t filter_extended; unsigned int filter_extended; /* boolean */
#endif /* FILTER_ENABLE */ #endif /* FILTER_ENABLE */
#ifdef XTINYPROXY_ENABLE #ifdef XTINYPROXY_ENABLE
char *my_domain; char *my_domain;
@ -53,12 +53,12 @@ struct config_s {
char* dnsserver_location; char* dnsserver_location;
char* dnsserver_socket; char* dnsserver_socket;
bool_t via_http_header; unsigned int via_http_header; /* boolean */
}; };
/* Global Structures used in the program */ /* Global Structures used in the program */
extern struct config_s config; extern struct config_s config;
extern bool_t received_sighup; extern unsigned int received_sighup; /* boolean */
extern bool_t processed_config_file; extern unsigned int processed_config_file; /* boolean */
#endif #endif

View File

@ -1,4 +1,4 @@
/* $Id: utils.c,v 1.35 2002-11-21 21:51:34 rjkaes Exp $ /* $Id: utils.c,v 1.36 2002-12-04 17:06:14 rjkaes Exp $
* *
* Misc. routines which are used by the various functions to handle strings * Misc. routines which are used by the various functions to handle strings
* and memory allocation and pretty much anything else we can think of. Also, * and memory allocation and pretty much anything else we can think of. Also,
@ -138,7 +138,7 @@ indicate_http_error(struct conn_s* connptr, int number, const char* string)
* Safely creates filename and returns the low-level file descriptor. * Safely creates filename and returns the low-level file descriptor.
*/ */
int int
create_file_safely(const char *filename, bool_t truncate_file) create_file_safely(const char *filename, unsigned int truncate_file)
{ {
struct stat lstatinfo; struct stat lstatinfo;
int fildes; int fildes;

View File

@ -1,4 +1,4 @@
/* $Id: utils.h,v 1.21 2002-11-21 21:52:03 rjkaes Exp $ /* $Id: utils.h,v 1.22 2002-12-04 17:06:14 rjkaes Exp $
* *
* See 'utils.h' for a detailed description. * See 'utils.h' for a detailed description.
* *
@ -27,9 +27,10 @@ struct conn_s;
extern int send_http_message(struct conn_s *connptr, int http_code, extern int send_http_message(struct conn_s *connptr, int http_code,
const char *error_title, const char *message); const char *error_title, const char *message);
extern int send_http_error_message(struct conn_s *connptr); extern int send_http_error_message(struct conn_s *connptr);
extern int indicate_http_error(struct conn_s* connptr, int number, const char *string); extern int indicate_http_error(struct conn_s* connptr, int number,
const char *string);
extern int pidfile_create(const char *path); extern int pidfile_create(const char *path);
extern int create_file_safely(const char *filename, bool_t truncate_file); extern int create_file_safely(const char *filename, unsigned int truncate_file);
#endif #endif