1/* cgi-lib.h - header file for cgi-lib.c 2 Eugene Kim, <eekim@eekim.com> 3 $Id: file-upload.h,v 1.1.1.1 2008/10/15 03:29:53 james26_jang Exp $ 4 5 Copyright (C) 1996, 1997 Eugene Eric Kim 6 All Rights Reserved 7*/ 8 9#ifndef _CGI_LIB 10#define _CGI_LIB 1 11 12#include <stdlib.h> 13 14/* change this if you are using HTTP upload */ 15//#ifndef UPLOADDIR 16//#define UPLOADDIR "/tmp" 17//#endif 18#define WRITE_FILE 1 19#define NO_WRITE_FILE 0 20 21/* CGI Environment Variables */ 22#define CONTENT_TYPE getenv("CONTENT_TYPE") 23#define CONTENT_LENGTH getenv("CONTENT_LENGTH") 24#define HTTP_USER_AGENT getenv("HTTP_USER_AGENT") 25typedef struct { 26 char *name; 27 char *value; 28} entrytype; 29 30typedef struct _node { 31 entrytype entry; 32 struct _node* next; 33} node; 34 35typedef struct { 36 node* head; 37} llist; 38 39int read_file_upload(llist* entries,char *pUploadDir,int filesize,int flag); 40char *cgi_val(llist l,char *name); 41 42char *newstr(char *str); 43char *lower_case(char *buffer); 44void show_html_page(char *loc); 45 46void list_create(llist *l); 47short on_list(llist *l,node *w); 48node* list_insafter(llist* l, node* w, entrytype item); 49void clear_list(llist* l); 50#endif 51