fix for ijbswa-Support Requests-3001830: Activate user.filter by default
[privoxy.git] / win32.c
diff --git a/win32.c b/win32.c
index 9db1ed1..b0c5e9a 100644 (file)
--- a/win32.c
+++ b/win32.c
@@ -1,4 +1,4 @@
-const char win32_rcs[] = "$Id: win32.c,v 1.8 2002/03/26 22:57:10 jongfoster Exp $";
+const char win32_rcs[] = "$Id: win32.c,v 1.16 2009/05/16 13:27:20 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/win32.c,v $
@@ -29,36 +29,8 @@ const char win32_rcs[] = "$Id: win32.c,v 1.8 2002/03/26 22:57:10 jongfoster Exp
  *                or write to the Free Software Foundation, Inc., 59
  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * Revisions   :
- *    $Log: win32.c,v $
- *    Revision 1.8  2002/03/26 22:57:10  jongfoster
- *    Web server name should begin www.
- *
- *    Revision 1.7  2002/03/24 12:03:47  jongfoster
- *    Name change
- *
- *    Revision 1.6  2002/03/16 21:53:28  jongfoster
- *    VC++ Heap debug option
- *
- *    Revision 1.5  2002/03/04 23:47:30  jongfoster
- *    - Rewritten, simpler command-line pre-parser
- *    - not using raise(SIGINT) any more
- *
- *    Revision 1.4  2001/11/30 21:29:33  jongfoster
- *    Fixing a warning
- *
- *    Revision 1.3  2001/11/16 00:46:31  jongfoster
- *    Fixing compiler warnings
- *
- *    Revision 1.2  2001/07/29 19:32:00  jongfoster
- *    Renaming _main() [mingw32 only] to real_main(), for ANSI compliance.
- *
- *    Revision 1.1.1.1  2001/05/15 13:59:08  oes
- *    Initial import of version 2.9.3 source tree
- *
- *
  *********************************************************************/
-\f
+
 
 #include "config.h"
 
@@ -90,31 +62,46 @@ const char win32_rcs[] = "$Id: win32.c,v 1.8 2002/03/26 22:57:10 jongfoster Exp
 
 const char win32_h_rcs[] = WIN32_H_VERSION;
 
+/**
+ * A short introductory text about Privoxy.  Used for the "About" box
+ * or the console startup message.
+ */
 const char win32_blurb[] =
 "Privoxy version " VERSION " for Windows\n"
-"Copyright (C) 2000-2002 by members of the Privoxy Team\n"
-"Copyright (C) 1997-8 by Junkbusters Corp.\n"
+"Copyright (C) 2000-2010 the Privoxy Team (" HOME_PAGE_URL ")\n"
+"Based on the Internet Junkbuster by Junkbusters Corp.\n"
 "This is free software; it may be used and copied under the\n"
-"GNU General Public License: http://www.gnu.org/copyleft/gpl.html .\n"
-"This program comes with ABSOLUTELY NO WARRANTY OF ANY KIND.\n"
-"\n"
-"For information about how to to configure the proxy and your browser, see\n"
-"        " HOME_PAGE_URL "\n"
-"\n";
+"GNU General Public License, version 2: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html\n"
+"This program comes with ABSOLUTELY NO WARRANTY OF ANY KIND.\n";
 
 #ifdef _WIN_CONSOLE
 
+/**
+ * Hide the console.  If set, the program will disconnect from the 
+ * console and run in the background.  This allows the command-prompt
+ * window to close.
+ */
 int hideConsole     = 0;
 
-#else
 
+#else /* ndef _WIN_CONSOLE */
+
+
+/**
+ * The application instance handle.
+ */
 HINSTANCE g_hInstance;
+
+
+/**
+ * The command to show the window that was specified at startup.
+ */
 int g_nCmdShow;
 
 static void  __cdecl UserInterfaceThread(void *);
 
-#endif
 
+#endif /* ndef _WIN_CONSOLE */
 
 /*********************************************************************
  *
@@ -136,11 +123,14 @@ static void  __cdecl UserInterfaceThread(void *);
  *********************************************************************/
 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
 {
+#if 0   /* See comment about __argc & __argv below */
    int i;
-   int res;
    int argc = 1;
    const char *argv[3];
    char szModule[MAX_PATH+1];
+#endif
+
+   int res;
 #ifndef _WIN_CONSOLE
    HANDLE hInitCompleteEvent = NULL;
 #endif
@@ -164,6 +154,16 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
 #endif
 #endif /* defined(_WIN32) && defined(_MSC_VER) && defined(_DEBUG) */
 
+
+/************
+ * I couldn't figure out why the command line was being sorta parsed here
+ * instead of using the __argc & __argv globals usually defined in stdlib.h
+ *
+ * From what I can tell by looking at the MinWG source, it supports these
+ * globals, so i'd hope that the other compilers do so as well.
+ * Obviously, if i'm wrong i'll find out soon enough!  :)
+ ************/
+#if 0
    /*
     * Cheat in parsing the command line.  We only ever have at most one
     * paramater, which may optionally be specified inside double quotes.
@@ -194,6 +194,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
    argv[1] = lpCmdLine;
    argv[2] = NULL;
    argc = ((lpCmdLine != NULL) ? 2 : 1);
+#endif /* -END- 0 */
+
 
 #ifndef _WIN_CONSOLE
    /* Create a user-interface thread and wait for it to initialise */
@@ -206,9 +208,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
 #endif
 
 #ifdef __MINGW32__
-   res = real_main( argc, argv );
+   res = real_main( __argc, __argv );
 #else
-   res = main( argc, argv );
+   res = main( __argc, __argv );
 #endif
 
    return res;
@@ -301,7 +303,7 @@ static void __cdecl UserInterfaceThread(void *pData)
 }
 
 
-#endif
+#endif /* ndef _WIN_CONSOLE */
 
 
 /*