Adding comments
authorjongfoster <jongfoster@users.sourceforge.net>
Tue, 4 Jun 2002 17:22:37 +0000 (17:22 +0000)
committerjongfoster <jongfoster@users.sourceforge.net>
Tue, 4 Jun 2002 17:22:37 +0000 (17:22 +0000)
src/errlog.h
src/loadcfg.c
src/loaders.c
src/loaders.h
src/miscutil.c

index 2f02493..3441fd2 100644 (file)
@@ -1,9 +1,9 @@
 #ifndef ERRLOG_H_INCLUDED
 #define ERRLOG_H_INCLUDED
-#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.13 2002/03/26 22:29:54 swa Exp $"
+#define ERRLOG_H_VERSION "$Id: errlog.h,v 2.0 2002/06/04 14:34:21 jongfoster Exp $"
 /*********************************************************************
  *
- * File        :  $Source: /cvsroot/ijbswa/current/errlog.h,v $
+ * File        :  $Source: /cvsroot/ijbswa/current/src/errlog.h,v $
  *
  * Purpose     :  Log errors to a designated destination in an elegant,
  *                printf-like fashion.
@@ -35,6 +35,9 @@
  *
  * Revisions   :
  *    $Log: errlog.h,v $
+ *    Revision 2.0  2002/06/04 14:34:21  jongfoster
+ *    Moving source files to src/
+ *
  *    Revision 1.13  2002/03/26 22:29:54  swa
  *    we have a new homepage!
  *
@@ -133,31 +136,57 @@ extern "C" {
 
 /* Debug level for errors */
 
-#define LOG_LEVEL_GPC        0x0001
+/** Log GET/POST/CONNECT requests. */
+#define LOG_LEVEL_GPC        0x0001 
+
+/** Log connecting to the server. */
 #define LOG_LEVEL_CONNECT    0x0002
+
+/** Log ... what? FIXME. */
 #define LOG_LEVEL_IO         0x0004
+
+/** Log header parsing and modifying. */
 #define LOG_LEVEL_HEADER     0x0008
+
+/** Log ... what? FIXME. */
 #define LOG_LEVEL_LOG        0x0010
+
 #ifdef FEATURE_FORCE_LOAD
+/** Log forced page load feature. */
 #define LOG_LEVEL_FORCE      0x0020
 #endif /* def FEATURE_FORCE_LOAD */
+
+/** Log PCRS feature. */
 #define LOG_LEVEL_RE_FILTER  0x0040
+
 #ifdef FEATURE_FAST_REDIRECTS
+/** Log fast redirects feature. */
 #define LOG_LEVEL_REDIRECTS  0x0080
 #endif /* def FEATURE_FAST_REDIRECTS */
+
+/** Log GIF deanimation. */
 #define LOG_LEVEL_DEANIMATE  0x0100
 
-#define LOG_LEVEL_CLF        0x0200 /* Common Log File format */
+/** Log in Common Log File format. Note that for properly formatted log files
+    you should disable all the other log settings. */
+#define LOG_LEVEL_CLF        0x0200
+
+/** Log popup-killing feature */
 #ifdef FEATURE_KILL_POPUPS
-#define LOG_LEVEL_POPUPS     0x0400 /* Kill Popups */
+#define LOG_LEVEL_POPUPS     0x0400
 #endif /* def FEATURE_KILL_POPUPS */
 
-#define LOG_LEVEL_CGI   0x0800 /* CGI / templates */
+/** Log CGI and template handling features */
+#define LOG_LEVEL_CGI   0x0800
 
-/* Following are always on: */
+/** Log informative messages (program version etc). */
 #define LOG_LEVEL_INFO    0x1000
+
+/** Log error messages. */
 #define LOG_LEVEL_ERROR   0x2000
-#define LOG_LEVEL_FATAL   0x4000 /* Exits after writing log */
+
+/** Write a message to the log and exit the program. */
+#define LOG_LEVEL_FATAL   0x4000
 
 extern void init_error_log(const char *prog_name, const char *logfname, int debuglevel);
 extern void log_error(int loglevel, char *fmt, ...);
index 30ca467..e041463 100644 (file)
@@ -1,7 +1,7 @@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.48 2002/05/14 21:30:38 oes Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 2.0 2002/06/04 14:34:21 jongfoster Exp $";
 /*********************************************************************
  *
- * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
+ * File        :  $Source: /cvsroot/ijbswa/current/src/loadcfg.c,v $
  *
  * Purpose     :  Loads settings from the configuration file into
  *                global variables.  This file contains both the
@@ -35,6 +35,9 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.48 2002/05/14 21:30:38 oes Exp $"
  *
  * Revisions   :
  *    $Log: loadcfg.c,v $
+ *    Revision 2.0  2002/06/04 14:34:21  jongfoster
+ *    Moving source files to src/
+ *
  *    Revision 1.48  2002/05/14 21:30:38  oes
  *    savearg now uses own linking code instead of (now special-cased) add_help_link
  *
@@ -369,20 +372,32 @@ const char loadcfg_h_rcs[] = LOADCFG_H_VERSION;
 #define ijb_tolower(__X) tolower((int)(unsigned char)(__X))
 
 #ifdef FEATURE_TOGGLE
-/* by haroon - indicates if ijb is enabled */
+/**
+ * Indicates if Privoxy is currently enabled.
+ */
 int g_bToggleIJB        = 1;   /* Privoxy is enabled by default. */
 #endif /* def FEATURE_TOGGLE */
 
-/* The filename of the configfile */
+/**
+ * The filename of the config file
+ */
 const char *configfile  = NULL;
 
-/*
- * CGI functions will later need access to the invocation args,
- * so we will make argc and argv global.
+/**
+ * Global argument count, so that CGI functions can access the
+ * command line.
  */
 int Argc = 0;
+
+/**
+ * Global argument list, so that CGI functions can access the
+ * command line.
+ */
 const char **Argv = NULL;
 
+/**
+ * The configuration file which is currently loaded.
+ */
 static struct file_list *current_configfile = NULL;
 
 
@@ -398,40 +413,41 @@ static struct file_list *current_configfile = NULL;
  * console and GUI specific options last).
  */
 
-#define hash_actions_file              1196306641ul /* "actionsfile" */
-#define hash_admin_address             4112573064ul /* "admin-address" */
-#define hash_buffer_limit              1881726070ul /* "buffer-limit */
-#define hash_confdir                      1978389ul /* "confdir" */
-#define hash_debug                          78263ul /* "debug" */
-#define hash_deny_access               1227333715ul /* "deny-access" */
-#define hash_enable_edit_actions       2517097536ul /* "enable-edit-actions" */
-#define hash_enable_remote_toggle      2979744683ul /* "enable-remote-toggle" */
-#define hash_filterfile                 250887266ul /* "filterfile" */
-#define hash_forward                      2029845ul /* "forward" */
-#define hash_forward_socks4            3963965521ul /* "forward-socks4" */
-#define hash_forward_socks4a           2639958518ul /* "forward-socks4a" */
-#define hash_jarfile                      2046641ul /* "jarfile" */
-#define hash_listen_address            1255650842ul /* "listen-address" */
-#define hash_logdir                        422889ul /* "logdir" */
-#define hash_logfile                      2114766ul /* "logfile" */
-#define hash_permit_access             3587953268ul /* "permit-access" */
-#define hash_proxy_info_url            3903079059ul /* "proxy-info-url" */
-#define hash_single_threaded           4250084780ul /* "single-threaded" */
-#define hash_suppress_blocklists       1948693308ul /* "suppress-blocklists" */
-#define hash_toggle                        447966ul /* "toggle" */
-#define hash_trust_info_url             430331967ul /* "trust-info-url" */
-#define hash_trustfile                   56494766ul /* "trustfile" */
-#define hash_usermanual                1416668518ul /* "user-manual" */
-#define hash_activity_animation        1817904738ul /* "activity-animation" */
-#define hash_close_button_minimizes    3651284693ul /* "close-button-minimizes" */
-#define hash_hide_console              2048809870ul /* "hide-console" */
-#define hash_log_buffer_size           2918070425ul /* "log-buffer-size" */
-#define hash_log_font_name             2866730124ul /* "log-font-name" */
-#define hash_log_font_size             2866731014ul /* "log-font-size" */
-#define hash_log_highlight_messages    4032101240ul /* "log-highlight-messages" */
-#define hash_log_max_lines             2868344173ul /* "log-max-lines" */
-#define hash_log_messages              2291744899ul /* "log-messages" */
-#define hash_show_on_task_bar           215410365ul /* "show-on-task-bar" */
+#define hash_actions_file              1196306641ul /**< "actionsfile" */
+#define hash_admin_address             4112573064ul /**< "admin-address" */
+#define hash_buffer_limit              1881726070ul /**< "buffer-limit */
+#define hash_confdir                      1978389ul /**< "confdir" */
+#define hash_debug                          78263ul /**< "debug" */
+#define hash_deny_access               1227333715ul /**< "deny-access" */
+#define hash_enable_edit_actions       2517097536ul /**< "enable-edit-actions" */
+#define hash_enable_remote_toggle      2979744683ul /**< "enable-remote-toggle" */
+#define hash_filterfile                 250887266ul /**< "filterfile" */
+#define hash_forward                      2029845ul /**< "forward" */
+#define hash_forward_socks4            3963965521ul /**< "forward-socks4" */
+#define hash_forward_socks4a           2639958518ul /**< "forward-socks4a" */
+#define hash_jarfile                      2046641ul /**< "jarfile" */
+#define hash_listen_address            1255650842ul /**< "listen-address" */
+#define hash_logdir                        422889ul /**< "logdir" */
+#define hash_logfile                      2114766ul /**< "logfile" */
+#define hash_permit_access             3587953268ul /**< "permit-access" */
+#define hash_proxy_info_url            3903079059ul /**< "proxy-info-url" */
+#define hash_single_threaded           4250084780ul /**< "single-threaded" */
+#define hash_suppress_blocklists       1948693308ul /**< "suppress-blocklists" */
+#define hash_toggle                        447966ul /**< "toggle" */
+#define hash_trust_info_url             430331967ul /**< "trust-info-url" */
+#define hash_trustfile                   56494766ul /**< "trustfile" */
+#define hash_usermanual                1416668518ul /**< "user-manual" */
+
+#define hash_activity_animation        1817904738ul /**< "activity-animation" */
+#define hash_close_button_minimizes    3651284693ul /**< "close-button-minimizes" */
+#define hash_hide_console              2048809870ul /**< "hide-console" */
+#define hash_log_buffer_size           2918070425ul /**< "log-buffer-size" */
+#define hash_log_font_name             2866730124ul /**< "log-font-name" */
+#define hash_log_font_size             2866731014ul /**< "log-font-size" */
+#define hash_log_highlight_messages    4032101240ul /**< "log-highlight-messages" */
+#define hash_log_max_lines             2868344173ul /**< "log-max-lines" */
+#define hash_log_messages              2291744899ul /**< "log-messages" */
+#define hash_show_on_task_bar           215410365ul /**< "show-on-task-bar" */
 
 
 static void savearg(char *command, char *argument, struct configuration_spec * config);
index 3d7ca63..14a434c 100644 (file)
@@ -1,7 +1,7 @@
-const char loaders_rcs[] = "$Id: loaders.c,v 1.50 2002/04/24 02:12:16 oes Exp $";
+const char loaders_rcs[] = "$Id: loaders.c,v 2.0 2002/06/04 14:34:21 jongfoster Exp $";
 /*********************************************************************
  *
- * File        :  $Source: /cvsroot/ijbswa/current/loaders.c,v $
+ * File        :  $Source: /cvsroot/ijbswa/current/src/loaders.c,v $
  *
  * Purpose     :  Functions to load and unload the various
  *                configuration files.  Also contains code to manage
@@ -35,6 +35,9 @@ const char loaders_rcs[] = "$Id: loaders.c,v 1.50 2002/04/24 02:12:16 oes Exp $"
  *
  * Revisions   :
  *    $Log: loaders.c,v $
+ *    Revision 2.0  2002/06/04 14:34:21  jongfoster
+ *    Moving source files to src/
+ *
  *    Revision 1.50  2002/04/24 02:12:16  oes
  *    Jon's multiple AF patch: Sweep now takes care of all AFs
  *
@@ -296,18 +299,39 @@ const char loaders_rcs[] = "$Id: loaders.c,v 1.50 2002/04/24 02:12:16 oes Exp $"
 
 const char loaders_h_rcs[] = LOADERS_H_VERSION;
 
-/*
- * Currently active files.
- * These are also entered in the main linked list of files.
- */
 
 #ifdef FEATURE_TRUST
+/**
+ * Currently active trust file.
+ * This is also entered in the main linked list of files.
+ */
 static struct file_list *current_trustfile      = NULL;
 #endif /* def FEATURE_TRUST */
 
+
+/**
+ * Currently active re_filter file.
+ * This is also entered in the main linked list of files.
+ */
 static struct file_list *current_re_filterfile  = NULL;
 
 
+/**
+ * Character code for CR (ASCII 13).
+ * If you have a wierd compiler and this definition is
+ * incorrect, you also need to fix NEWLINE() in loaders.h
+ */
+#define CHAR_CR '\r' /* ASCII 13 */
+
+
+/**
+ * Character code for LF (ASCII 10).
+ * If you have a wierd compiler and this definition is
+ * incorrect, you also need to fix NEWLINE() in loaders.h
+ */
+#define CHAR_LF '\n' /* ASCII 10 */
+
+
 
 /*********************************************************************
  *
@@ -550,13 +574,6 @@ jb_err simple_read_line(FILE *fp, char **dest, int *newline)
 
    p = buf;
 
-/*
- * Character codes.  If you have a wierd compiler and the following are
- * incorrect, you also need to fix NEWLINE() in loaders.h
- */
-#define CHAR_CR '\r' /* ASCII 13 */
-#define CHAR_LF '\n' /* ASCII 10 */
-
    for (;;)
    {
       ch = getc(fp);
index 0b179e9..a3e92c6 100644 (file)
@@ -1,9 +1,9 @@
 #ifndef LOADERS_H_INCLUDED
 #define LOADERS_H_INCLUDED
-#define LOADERS_H_VERSION "$Id: loaders.h,v 1.19 2002/03/26 22:29:55 swa Exp $"
+#define LOADERS_H_VERSION "$Id: loaders.h,v 2.0 2002/06/04 14:34:21 jongfoster Exp $"
 /*********************************************************************
  *
- * File        :  $Source: /cvsroot/ijbswa/current/loaders.h,v $
+ * File        :  $Source: /cvsroot/ijbswa/current/src/loaders.h,v $
  *
  * Purpose     :  Functions to load and unload the various
  *                configuration files.  Also contains code to manage
@@ -37,6 +37,9 @@
  *
  * Revisions   :
  *    $Log: loaders.h,v $
+ *    Revision 2.0  2002/06/04 14:34:21  jongfoster
+ *    Moving source files to src/
+ *
  *    Revision 1.19  2002/03/26 22:29:55  swa
  *    we have a new homepage!
  *
@@ -186,12 +189,12 @@ extern jb_err simple_read_line(FILE *fp, char **dest, int *newline);
 /*
  * Various types of newlines that a file may contain.
  */
-#define NEWLINE_UNKNOWN 0  /* Newline convention in file is unknown */
-#define NEWLINE_UNIX    1  /* Newline convention in file is '\n'   (ASCII 10) */
-#define NEWLINE_DOS     2  /* Newline convention in file is '\r\n' (ASCII 13,10) */
-#define NEWLINE_MAC     3  /* Newline convention in file is '\r'   (ASCII 13) */
+#define NEWLINE_UNKNOWN 0  /**< Newline convention in file is unknown */
+#define NEWLINE_UNIX    1  /**< Newline convention in file is '\n'   (ASCII 10) */
+#define NEWLINE_DOS     2  /**< Newline convention in file is '\r\n' (ASCII 13,10) */
+#define NEWLINE_MAC     3  /**< Newline convention in file is '\r'   (ASCII 13) */
 
-/*
+/**
  * Types of newlines that a file may contain, as strings.  If you have an
  * extremely wierd compiler that does not have '\r' == CR == ASCII 13 and
  * '\n' == LF == ASCII 10), then fix CHAR_CR and CHAR_LF in loaders.c as
index 53b3b4d..483f168 100644 (file)
@@ -1,7 +1,7 @@
-const char miscutil_rcs[] = "$Id: miscutil.c,v 1.37 2002/04/26 18:29:43 jongfoster Exp $";
+const char miscutil_rcs[] = "$Id: miscutil.c,v 2.0 2002/06/04 14:34:21 jongfoster Exp $";
 /*********************************************************************
  *
- * File        :  $Source: /cvsroot/ijbswa/current/miscutil.c,v $
+ * File        :  $Source: /cvsroot/ijbswa/current/src/miscutil.c,v $
  *
  * Purpose     :  zalloc, hash_string, safe_strerror, strcmpic,
  *                strncmpic, chomp, and MinGW32 strdup
@@ -36,6 +36,9 @@ const char miscutil_rcs[] = "$Id: miscutil.c,v 1.37 2002/04/26 18:29:43 jongfost
  *
  * Revisions   :
  *    $Log: miscutil.c,v $
+ *    Revision 2.0  2002/06/04 14:34:21  jongfoster
+ *    Moving source files to src/
+ *
  *    Revision 1.37  2002/04/26 18:29:43  jongfoster
  *    Fixing this Visual C++ warning:
  *    miscutil.c(710) : warning C4090: '=' : different 'const' qualifiers
@@ -296,7 +299,7 @@ void write_pid_file(void)
  *                to "switch" a string the one of my favorites.
  *
  * Parameters  :
- *          1  :  s : string to be hashed.
+ *          1  :  s = string to be hashed.
  *
  * Returns     :  an unsigned long variable with the hashed value.
  *
@@ -454,7 +457,7 @@ int strncmpic(const char *s1, const char *s2, size_t n)
  *                from a string.
  *
  * Parameters  :
- *          1  :  s : string to be chomped.
+ *          1  :  string = string to be chomped.
  *
  * Returns     :  chomped string
  *
@@ -884,8 +887,8 @@ char *bindup(const char *string, size_t len)
  *                the filename. 
  *
  * Parameters  :
- *          1  :  dir: Name of directory or NULL for none.
- *          2  :  file: Name of file.  Should not be NULL or empty.
+ *          1  :  dir = Name of directory or NULL for none.
+ *          2  :  file = Name of file.  Should not be NULL or empty.
  *
  * Returns     :  "dir/file" (Or on windows, "dir\file").
  *                It allocates the string on the heap.  Caller frees.