summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2002-12-04 17:06:14 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2002-12-04 17:06:14 +0000
commit0a20bdd5b4ea957e108cbf43725349e2766bd1d1 (patch)
treec684ee0af28e0059fd7c7974775f10af5b4dc644
parent02d7474a0952015971439fce2f24ee66ef0217a3 (diff)
downloadtinyproxy-0a20bdd5b4ea957e108cbf43725349e2766bd1d1.tar.gz
tinyproxy-0a20bdd5b4ea957e108cbf43725349e2766bd1d1.zip
Removed the "bool_t" type since it conflicts with the newer C standards.
The type was just replaced by "unsigned int" types.
Diffstat (limited to '')
-rw-r--r--src/common.h20
-rw-r--r--src/conns.h7
-rw-r--r--src/reqs.c4
-rw-r--r--src/tinyproxy.c8
-rw-r--r--src/tinyproxy.h16
-rw-r--r--src/utils.c4
-rw-r--r--src/utils.h7
7 files changed, 35 insertions, 31 deletions
diff --git a/src/common.h b/src/common.h
index 1489c51..b504ba3 100644
--- a/src/common.h
+++ b/src/common.h
@@ -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
* system. All this information use to be in the "tinyproxy.h" header,
@@ -175,14 +175,16 @@
#define MAXLISTEN 1024 /* Max number of connections */
-/* Useful function macros */
-#define min(a,b) ((a) < (b) ? (a) : (b))
-#define max(a,b) ((a) > (b) ? (a) : (b))
+/* Define boolean values */
+#ifndef FALSE
+# define FALSE 0
+# define TRUE (!FALSE)
+#endif
-/* Make a new type: bool_t */
-typedef enum {
- FALSE = 0,
- TRUE = 1
-} bool_t;
+/* 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
diff --git a/src/conns.h b/src/conns.h
index 59ec8e9..bea6b47 100644
--- a/src/conns.h
+++ b/src/conns.h
@@ -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.
*
@@ -33,8 +33,9 @@ struct conn_s {
/* The request line (first line) from the client */
char *request_line;
- bool_t connect_method;
- bool_t show_stats;
+ /* Booleans */
+ unsigned int connect_method;
+ unsigned int show_stats;
/* Store the error response if there is one */
char *error_string;
diff --git a/src/reqs.c b/src/reqs.c
index f47fcc0..d2fd7e3 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -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
* 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;
ssize_t len;
- bool_t double_cgi = FALSE;
+ unsigned int double_cgi = FALSE; /* boolean */
assert(fd >= 0);
assert(hashofheaders != NULL);
diff --git a/src/tinyproxy.c b/src/tinyproxy.c
index 00e8266..31774b7 100644
--- a/src/tinyproxy.c
+++ b/src/tinyproxy.c
@@ -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,
* listening socket, config options, etc.) and then sits there and loops
@@ -46,8 +46,8 @@ extern FILE *yyin;
*/
struct config_s config;
float load = 0.00;
-bool_t received_sighup = FALSE;
-bool_t processed_config_file = FALSE;
+unsigned int received_sighup = FALSE; /* boolean */
+unsigned int processed_config_file = FALSE; /* boolean */
/*
* Handle a signal
@@ -150,7 +150,7 @@ int
main(int argc, char **argv)
{
int optch;
- bool_t godaemon = TRUE;
+ unsigned int godaemon = TRUE; /* boolean */
struct passwd *thisuser = NULL;
struct group *thisgroup = NULL;
char *conf_file = DEFAULT_CONF_FILE;
diff --git a/src/tinyproxy.h b/src/tinyproxy.h
index 6340488..8edba3a 100644
--- a/src/tinyproxy.h
+++ b/src/tinyproxy.h
@@ -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.
*
@@ -27,17 +27,17 @@
struct config_s {
char *logf_name;
- bool_t syslog;
+ unsigned int syslog; /* boolean */
int port;
char *stathost;
- bool_t quit;
+ unsigned int quit; /* boolean */
char *username;
char *group;
char *ipAddr;
#ifdef FILTER_ENABLE
char *filter;
- bool_t filter_url;
- bool_t filter_extended;
+ unsigned int filter_url; /* boolean */
+ unsigned int filter_extended; /* boolean */
#endif /* FILTER_ENABLE */
#ifdef XTINYPROXY_ENABLE
char *my_domain;
@@ -53,12 +53,12 @@ struct config_s {
char* dnsserver_location;
char* dnsserver_socket;
- bool_t via_http_header;
+ unsigned int via_http_header; /* boolean */
};
/* Global Structures used in the program */
extern struct config_s config;
-extern bool_t received_sighup;
-extern bool_t processed_config_file;
+extern unsigned int received_sighup; /* boolean */
+extern unsigned int processed_config_file; /* boolean */
#endif
diff --git a/src/utils.c b/src/utils.c
index a26f698..62c6797 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -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
* 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.
*/
int
-create_file_safely(const char *filename, bool_t truncate_file)
+create_file_safely(const char *filename, unsigned int truncate_file)
{
struct stat lstatinfo;
int fildes;
diff --git a/src/utils.h b/src/utils.h
index e208a6f..0bbd198 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -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.
*
@@ -27,9 +27,10 @@ struct conn_s;
extern int send_http_message(struct conn_s *connptr, int http_code,
const char *error_title, const char *message);
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 create_file_safely(const char *filename, bool_t truncate_file);
+extern int create_file_safely(const char *filename, unsigned int truncate_file);
#endif