Index: trunk/thirds/cgic206/Makefile
===================================================================
--- trunk/thirds/cgic206/Makefile	(revision 986)
+++ trunk/thirds/cgic206/Makefile	(revision 1)
@@ -1,22 +1,15 @@
-OS:=$(shell uname -s)
-CPU:=$(shell uname -m)
-ifeq ($(OS),Darwin)
-	MACOS_CFLAGS=-arch x86_64
-	LIBS= -L./ -lcgic /usr/local/lib/libfcgi.dylib
-else
-	LIBS= -L./ -lcgic /usr/lib/libfcgi.a
-endif
-CFLAGS=-I/usr/local/include -g -Wall ${MACOS_CFLAGS}
+CFLAGS=-g -Wall
 CC=gcc
 AR=ar
 RANLIB=ranlib
+LIBS=-L./ -lcgic ../fcgi-2.4.0/libfcgi/.libs/libfcgi.a 
+CFLAGS=-I//var/www/localhost/include
 
 all: libcgic.a cgictest.cgi capture
 
 install: libcgic.a
-	mkdir -p ../../dist/lib
 	cp libcgic.a  ../../dist/lib
-	cp cgic.h  ../../dist/include
-	@echo libcgic.a is in  ../../dist/lib/ and cgic.h is in  ../../dist/include/
+	cp cgic.h  ../../dist//include
+	@echo libcgic.a is in  ../../dist/lib and cgic.h is in  ../../dist//include.
 
 libcgic.a: cgic.o cgic.h
Index: trunk/thirds/cgic206/cgic.c
===================================================================
--- trunk/thirds/cgic206/cgic.c	(revision 986)
+++ trunk/thirds/cgic206/cgic.c	(revision 1)
@@ -23,8 +23,4 @@
 #define CGICDEBUGEND
 #endif /* CGICDEBUG */
-
-#ifdef WIN32
-#define _INC_STDIO
-#endif
 
 #include <stdio.h>
@@ -72,5 +68,4 @@
 char *cgiUserAgent;
 char *cgiReferrer;
-char *cgiSid;
 
 FILE *cgiIn;
@@ -79,5 +74,4 @@
 /* True if CGI environment was restored from a file. */
 static int cgiRestored = 0;
-static int cgiTreatUrlEncoding;
 
 static void cgiGetenv(char **s, char *var);
@@ -142,17 +136,8 @@
 	cgiGetenv(&cgiServerPort, "SERVER_PORT");
 	cgiGetenv(&cgiRequestMethod, "REQUEST_METHOD");
-	if(strcmp(cgiRequestMethod,"")==0 && argc>=1)
-		cgiRequestMethod="GET";
 	cgiGetenv(&cgiPathInfo, "PATH_INFO");
 	cgiGetenv(&cgiPathTranslated, "PATH_TRANSLATED");
 	cgiGetenv(&cgiScriptName, "SCRIPT_NAME");
 	cgiGetenv(&cgiQueryString, "QUERY_STRING");
-	cgiSid=NULL;
-	if(cgiQueryString!=NULL && argc>=2){
-		cgiQueryString=argv[1];
-		if(argc>2){
-		  cgiSid=argv[2];
-		}
-	}
 	cgiGetenv(&cgiRemoteHost, "REMOTE_HOST");
 	cgiGetenv(&cgiRemoteAddr, "REMOTE_ADDR");
@@ -205,7 +190,4 @@
 	cgiGetenv(&cgiContentLengthString, "CONTENT_LENGTH");
 	cgiContentLength = atoi(cgiContentLengthString);	
-	if(cgiContentLength==0 && argc>=2){
-		cgiContentLength=strlen(argv[1]);
-	}
 	cgiGetenv(&cgiAccept, "HTTP_ACCEPT");
 	cgiGetenv(&cgiUserAgent, "HTTP_USER_AGENT");
@@ -226,6 +208,6 @@
 #endif /* WIN32 */
 	cgiFormEntryFirst = 0;
-	cgiIn = FCGI_stdin;
-	cgiOut = FCGI_stdout;
+	cgiIn = stdin;
+	cgiOut = stdout;
 	cgiRestored = 0;
 
@@ -241,7 +223,5 @@
 
 
-	cgiTreatUrlEncoding=0;
 	if (cgiStrEqNc(cgiRequestMethod, "post")) {
-		cgiTreatUrlEncoding=0;
 #ifdef CGICDEBUG
 		CGICDEBUGSTART
@@ -313,5 +293,4 @@
 	cgiFreeResources();
 	}
-	FCGI_Finish();
 	return result;
 }
@@ -1118,5 +1097,4 @@
 	while (srcPos < len) {
 		int ch = cp[srcPos];
-		if(cgiTreatUrlEncoding==1)
 		switch (escapeState) {
 			case cgiEscapeRest:
@@ -1126,5 +1104,5 @@
 				s[dstPos++] = ' ';
 			} else {
-				s[dstPos++] = ch;
+				s[dstPos++] = ch;	
 			}
 			break;
@@ -1139,6 +1117,4 @@
 			break;
 		}
-		else
-		  s[dstPos++] = ch;
 		srcPos++;
 	}
Index: trunk/thirds/cgic206/cgic.h
===================================================================
--- trunk/thirds/cgic206/cgic.h	(revision 986)
+++ trunk/thirds/cgic206/cgic.h	(revision 1)
@@ -124,10 +124,4 @@
 #endif
 char *cgiCookie;
-
-extern 
-#ifdef __cplusplus
-"C" 
-#endif
-char *cgiSid;
 
 /* A macro providing the same incorrect spelling that is
Index: trunk/thirds/cgic206/cgic.html
===================================================================
--- trunk/thirds/cgic206/cgic.html	(revision 986)
+++ trunk/thirds/cgic206/cgic.html	(revision 1)
@@ -1630,5 +1630,5 @@
 </strong><br><dd>
 cgiHeaderLocation() should be called if the programmer wishes to
-redirect the user to a different URL. No further output
+redirect the user to a different URL. No futher output
 is needed in this case.
 <p>
Index: trunk/thirds/cgic206/cgictest.c
===================================================================
--- trunk/thirds/cgic206/cgictest.c	(revision 986)
+++ trunk/thirds/cgic206/cgictest.c	(revision 1)
@@ -23,10 +23,8 @@
 	cgiReadEnvironment("/home/boutell/public_html/capcgi.dat");
 #endif
-	dup2(cgiOut,stdout);
-	printf("Content-Type: text/html; charset=utf-8\r\nStatus: 200 OK\r\n\r\n");
-	//cgiHeaderContentType("text/html");
-	printf( "<HTML><HEAD>\n");
-	printf( "<TITLE>cgic test</TITLE></HEAD>\n");
-	printf( "<BODY><H1>cgic test</H1>\n");
+	cgiHeaderContentType("text/html");
+	fprintf(cgiOut, "<HTML><HEAD>\n");
+	fprintf(cgiOut, "<TITLE>cgic test</TITLE></HEAD>\n");
+	fprintf(cgiOut, "<BODY><H1>cgic test</H1>\n");
 	Name();
 	Address();
@@ -38,5 +36,5 @@
 	NonExButtons();
 	RadioButtons();
-	printf( "</BODY></HTML>\n");
+	fprintf(cgiOut, "</BODY></HTML>\n");
 	return 0;
 }
@@ -47,23 +45,23 @@
 	switch (result) {
 		case cgiFormSuccess:
-		printf( "Name fetched, result code: cgiFormSuccess<br>\n");
+		fprintf(cgiOut, "Name fetched, result code: cgiFormSuccess<br>\n");
 		break;
 		case cgiFormTruncated:
-		printf( "Name fetched, result code: cgiFormTruncated<br>\n");
+		fprintf(cgiOut, "Name fetched, result code: cgiFormTruncated<br>\n");
 		break;
 		case cgiFormEmpty:
-		printf( "Name fetched, result code: cgiFormEmpty<br>\n");
+		fprintf(cgiOut, "Name fetched, result code: cgiFormEmpty<br>\n");
 		break;
 		case cgiFormNotFound:
-		printf( "Name fetched, result code: cgiFormNotFound<br>\n");
+		fprintf(cgiOut, "Name fetched, result code: cgiFormNotFound<br>\n");
 		break;
 		case cgiFormMemory:
-		printf( "Name fetched, result code: cgiFormMemory<br>\n");
+		fprintf(cgiOut, "Name fetched, result code: cgiFormMemory<br>\n");
 		break;
 		default:
-		printf( "Name fetched, unexpected result code: %d\n", result);
+		fprintf(cgiOut, "Name fetched, unexpected result code: %d\n", result);
 		break;
 	}	
-	printf( "Name: %s<BR>\n", name);
+	fprintf(cgiOut, "Name: %s<BR>\n", name);
 }
 	
@@ -71,12 +69,12 @@
 	char address[241];
 	cgiFormString("address", address, 241);
-	printf( "Address: <PRE>\n%s</PRE>\n", address);
+	fprintf(cgiOut, "Address: <PRE>\n%s</PRE>\n", address);
 }
 
 void Hungry() {
 	if (cgiFormCheckboxSingle("hungry") == cgiFormSuccess) {
-		printf( "I'm Hungry!<BR>\n");
+		fprintf(cgiOut, "I'm Hungry!<BR>\n");
 	} else {
-		printf( "I'm Not Hungry!<BR>\n");
+		fprintf(cgiOut, "I'm Not Hungry!<BR>\n");
 	}
 }
@@ -85,5 +83,5 @@
 	double temperature;
 	cgiFormDoubleBounded("temperature", &temperature, 80.0, 120.0, 98.6);
-	printf( "My temperature is %f.<BR>\n", temperature);
+	fprintf(cgiOut, "My temperature is %f.<BR>\n", temperature);
 }
 	
@@ -91,5 +89,5 @@
 	int frogsEaten;
 	cgiFormInteger("frogs", &frogsEaten, 0);
-	printf( "I have eaten %d frogs.<BR>\n", frogsEaten);
+	fprintf(cgiOut, "I have eaten %d frogs.<BR>\n", frogsEaten);
 }
 
@@ -103,5 +101,5 @@
 	int colorChoice;
 	cgiFormSelectSingle("colors", colors, 3, &colorChoice, 0);
-	printf( "I am: %s<BR>\n", colors[colorChoice]);
+	fprintf(cgiOut, "I am: %s<BR>\n", colors[colorChoice]);
 }	 
 
@@ -120,14 +118,14 @@
 		flavorChoices, &invalid);
 	if (result == cgiFormNotFound) {
-		printf( "I hate ice cream.<p>\n");
+		fprintf(cgiOut, "I hate ice cream.<p>\n");
 	} else {	
-		printf( "My favorite ice cream flavors are:\n");
-		printf( "<ul>\n");
+		fprintf(cgiOut, "My favorite ice cream flavors are:\n");
+		fprintf(cgiOut, "<ul>\n");
 		for (i=0; (i < 3); i++) {
 			if (flavorChoices[i]) {
-				printf( "<li>%s\n", flavors[i]);
+				fprintf(cgiOut, "<li>%s\n", flavors[i]);
 			}
 		}
-		printf( "</ul>\n");
+		fprintf(cgiOut, "</ul>\n");
 	}
 }
@@ -148,5 +146,5 @@
 	cgiFormRadio("age", ages, 4, &ageChoice, 0);
 
-	printf( "Age of Truck: %s (method #1)<BR>\n", 
+	fprintf(cgiOut, "Age of Truck: %s (method #1)<BR>\n", 
 		ages[ageChoice]);
 
@@ -159,5 +157,5 @@
 	cgiFormString("age", ageText, 10);
 
-	printf( "Age of Truck: %s (method #2)<BR>\n", ageText);
+	fprintf(cgiOut, "Age of Truck: %s (method #2)<BR>\n", ageText);
 }
 
@@ -180,18 +178,18 @@
 		since votes for nonexistent candidates should probably
 		be discounted... */
-	printf( "Votes (method 1):<BR>\n");
+	fprintf(cgiOut, "Votes (method 1):<BR>\n");
 	result = cgiFormCheckboxMultiple("vote", votes, 4, 
 		voteChoices, &invalid);
 	if (result == cgiFormNotFound) {
-		printf( "I hate them all!<p>\n");
+		fprintf(cgiOut, "I hate them all!<p>\n");
 	} else {	
-		printf( "My preferred candidates are:\n");
-		printf( "<ul>\n");
+		fprintf(cgiOut, "My preferred candidates are:\n");
+		fprintf(cgiOut, "<ul>\n");
 		for (i=0; (i < 4); i++) {
 			if (voteChoices[i]) {
-				printf( "<li>%s\n", votes[i]);
+				fprintf(cgiOut, "<li>%s\n", votes[i]);
 			}
 		}
-		printf( "</ul>\n");
+		fprintf(cgiOut, "</ul>\n");
 	}
 
@@ -200,17 +198,17 @@
 		than the code and invented responses are not a danger
 		or can be checked in some other way. */
-	printf( "Votes (method 2):<BR>\n");
+	fprintf(cgiOut, "Votes (method 2):<BR>\n");
 	result = cgiFormStringMultiple("vote", &responses);
 	if (result == cgiFormNotFound) {	
-		printf( "I hate them all!<p>\n");
+		fprintf(cgiOut, "I hate them all!<p>\n");
 	} else {
 		int i = 0;
-		printf( "My preferred candidates are:\n");
-		printf( "<ul>\n");
+		fprintf(cgiOut, "My preferred candidates are:\n");
+		fprintf(cgiOut, "<ul>\n");
 		while (responses[i]) {
-			printf( "<li>%s\n", responses[i]);
+			fprintf(cgiOut, "<li>%s\n", responses[i]);
 			i++;
 		}
-		printf( "</ul>\n");
+		fprintf(cgiOut, "</ul>\n");
 	}
 	/* We must be sure to free the string array or a memory
Index: trunk/thirds/cgic206/makefile.vc
===================================================================
--- trunk/thirds/cgic206/makefile.vc	(revision 986)
+++ trunk/thirds/cgic206/makefile.vc	(revision 1)
@@ -1,13 +1,13 @@
-GEODIR=\MMBK\SRCS\fcgi-2.4.1-SNAP-0311112127\ 
-DESTDIR=..
+GEODIR=C:/OSGeo4W
+DESTDIR=C:\OSGeo4W
 CFLAGS=-g -Wall
 CC=cl /TP
-LIBS=$(GEODIR)/libfcgi/Release/libfcgi.lib /nologo
+LIBS=$(GEODIR)/lib/libfcgi.lib /nologo
 LIBS1=./libcgic.lib
 
-CFLAGS=/EHa /nologo /DCRT_SECURE_NO_WARNING /MD /W2 /O2 /D "WIN32" \
-	-I $(GEODIR)\include 
+CFLAGS=/EHa /nologo /DCRT_SECURE_NO_WARNING /MT /W2 /O2 /D "WIN32" \
+	-I $(GEODIR)/include 
 
-all: libcgic.lib #cgictest.exe capture.exe 
+all: libcgic.lib cgictest.exe capture.exe
 
 install: libcgic.lib
@@ -24,5 +24,5 @@
 
 cgictest.exe: cgictest.obj 
-	link cgictest.obj $(LIBS) /out:cgictest.exe
+	link cgictest.obj $(LIBS1) /out:cgictest.exe
 
 cgic.obj: 
@@ -30,5 +30,5 @@
 
 capture.exe: capture.obj libcgic.lib
-	$(CC) $(CFLAGS) capture.c $(LIBS)
+	$(CC) $(CFLAGS) capture.c $(LIBS1)
 
 clean:
