/****************************************************************/
/*                Web Interface Header                          */
/*              (c) COPYRIGHT KORDIC 1996                       */
/*                                                              */
/*              Authors: armian@www.kordic.re.kr                */
/*              History: July 24 96 First Version               */
/* 		Modified by jskim@bulls.kordic.re.kr		*/
/****************************************************************/

#include <stdio.h>
#include <time.h>
#include <sys/types.h>
#ifndef NO_STDLIB_H
#include <stdlib.h>
#else
char *getenv();
#endif
#include <string.h>

#define KOR_ENG_DICT	"./Keywords/HanAPA"
#define CGI_APA_SEARCH  "APAsrch2.cgi"
#define MAX_DIR_NUM     7
#define CGI_PREVIEW     "preview.cgi"
#define CGI_UU2MAIL     "uu2mail.cgi"
#define ARCH_DIR "animal"   /* virtual directory of the archive */
#define APA_HOME "/animal"
#define BIOINFO_HOME "http://www.best5.net"
#define MOVIE_HOME "/animal/AnimMovie"
#define WEB_MASTER "jskim@AnimalPicturesArchive.com" /* Web master's email */
#define ACC_NUM_FILE "log/cgi_counter.dat"
#define QUERY_LOG_FILE "log/query_log"
#define LIST "sizeANDlist"  /* file name list by  '\ls -FCs1 > sizeANDlist'  */

#define BLUE	"blue"
#define RED	"red"
#define WHITE	"white"
#define BLACK	"black"
#define YELLOW	"yellow"
#define BROWN	"brown"
#define CYAN	"cyan"

#define RIGHT	"RIGHT"
#define CENTER	"CENTER"
#define LEFT	"LEFT"

#define TRUE	1
#define FALSE	0
#define YES	1
#define NO	0

#define LF 10
#define CR 13

#define MAX_ENTRY_NUM 20

/* my own */
void DelSpace(char *line);

/* ÇÑ¿µ »çÀü ±¸Á¶Ã¼ */
typedef struct {
	char han[10][60];
	char eng[10][60];
	char sci[60];
	char desc[1024];
} KorEngDic;

/* for Get method */
typedef struct {
	char name[256];
	char val[256];
} getentry;

/* for Post method */
typedef struct {
	char *name;
	char *val;
} postentry;

/* For Using Get Method */
void getword(char *word, char *line, char stop);
char x2c(char *what);
void unescape_url(char *url);
void plustospace(char *str);

/* For Using Post Method */
char *makeword(char *line, char stop);
char *fmakeword(FILE *f, char stop, int *len);
char x2c(char *what);
void unescape_url(char *url);
void plustospace(char *str);

int CompareString(char *str1, char *str2);
void APAsrch(getentry *entries, int i);

