File:  [ELWIX - Embedded LightWeight unIX -] / libaitwww / example / test.c
Revision 1.1.2.1: download - view: text, annotated - select for diffs - revision graph
Fri Mar 9 09:38:55 2012 UTC (12 years, 7 months ago) by misho
Branches: www1_0
fix bug into www_initCGI()
fix issues founded by LLVM static code analyzer
add UT

#include <stdio.h>
#include <stdlib.h>
#include <aitwww.h>


int
main()
{
	int i;
	cgi_t *cgi;

	putenv("QUERY_STRING=test1=abra+kadabra&testche=piuk%20mdaa");
	putenv("CONENT_LENGTH=390");
	putenv("REQUEST_METHOD=GET");
	cgi = www_initCGI();
	if (!cgi) {
		printf("Error:: #%d - %s\n", www_GetErrno(), www_GetError());
		return 1;
	}

	/*
	printf("%s\n%s\n", cgigetvalue("something"), cgigetvalue("somethingelse"));
	cginewquerystr("blaha=this is a string&blahb=this is another string");
	printf("\n%s\n%s\n", cgigetvalue("blaha"), cgigetvalue("blahb"));

	cgiclose();
	cginewquerystr("tmpa=another kool string&tmpb=and again");
	printf("\n%s\n%s\n", cgigetvalue("tmpa"), cgigetvalue("tmpb"));
	i=mail("John-Mark Gurney <gurney_j@resnet.uoregon.edu>", "John-Mark Gurney <gurney_j@localhost>", "Test", "this is a test, $tmpa and other junk $tmpb");
	*/

	www_closeCGI(&cgi);
	return 0;
}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>