Index: htdig3/htdig/Makefile.am
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htdig/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- htdig3/htdig/Makefile.am	1999/07/19 09:28:10	1.1
+++ htdig3/htdig/Makefile.am	1999/08/10 17:21:32
@@ -10,4 +10,4 @@
 noinst_HEADERS = Document.h ExternalParser.h HTML.h HtHTTP.h Images.h PDF.h \
 	Parsable.h Plaintext.h Retriever.h Server.h Transport.h URLRef.h htdig.h
 htdig_DEPENDENCIES = $(HTLIBS)
-htdig_LDADD = $(HTLIBS)
+htdig_LDADD = $(HTLIBS) -ll
Index: htdig3/htdig/Server.cc
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htdig/Server.cc,v
retrieving revision 1.9
diff -u -r1.9 Server.cc
--- htdig3/htdig/Server.cc	1999/07/03 20:56:39	1.9
+++ htdig3/htdig/Server.cc	1999/08/10 17:21:33
@@ -39,8 +39,8 @@
     _documents = 0;
     if (!config.Boolean("case_sensitive"))
       _disallow.IgnoreCase();
-    _max_documents = config.Value("server_max_docs", -1);
-    _connection_space = config.Value("server_wait_time", 0);
+    _max_documents = config.Value("server",host,"server_max_docs", -1);
+    _connection_space = config.Value("server",host,"server_wait_time", 0);
     _last_connection = time(0);  // For getting robots.txt
 
     //
Index: htdig3/htfuzzy/Makefile.am
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htfuzzy/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- htdig3/htfuzzy/Makefile.am	1999/07/19 09:28:10	1.1
+++ htdig3/htfuzzy/Makefile.am	1999/08/10 17:21:33
@@ -27,4 +27,4 @@
 
 htfuzzy_SOURCES = htfuzzy.cc
 htfuzzy_DEPENDENCIES = libfuzzy.la $(HTLIBS)
-htfuzzy_LDADD = libfuzzy.la $(HTLIBS)
+htfuzzy_LDADD = libfuzzy.la $(HTLIBS) -ll
Index: htdig3/htlib/Configuration.cc
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htlib/Configuration.cc,v
retrieving revision 1.12
diff -u -r1.12 Configuration.cc
--- htdig3/htlib/Configuration.cc	1999/06/24 01:24:44	1.12
+++ htdig3/htlib/Configuration.cc	1999/08/10 17:21:33
@@ -9,6 +9,7 @@
 static char	RCSid[] = "$Id: Configuration.cc,v 1.12 1999/06/24 01:24:44 ghutchis Exp $";
 #endif
 
+#include <stdio.h>
 #include "Configuration.h"
 #include "htString.h"
 #include "ParsedString.h"
@@ -183,6 +184,22 @@
     dict.Add(name, ps);
 }
 
+//********************************************************************
+//  Add complex entry to the configuration
+//
+void
+Configuration::Add(char *name, char *value, Configuration *aList) {
+
+  Object *treeEntry=dict[name];
+
+  if (treeEntry!=NULL) {
+    ((Dictionary *)treeEntry)->Add(value,aList);
+  } else {
+    treeEntry=new Dictionary(16);
+    ((Dictionary *)treeEntry)->Add(value,aList);
+    dict.Add(name, treeEntry);
+  }
+}
 
 //*********************************************************************
 // int Configuration::Remove(char *name)
@@ -215,8 +232,34 @@
     }
 }
 
+//*********************************************************************
+Object *Configuration::Get_Object(char *name) {
+return dict[name];
+}
 
 //*********************************************************************
+char *Configuration::Find(char *blockName,char *name,char *value) {
+Object *tmpPtr=dict[blockName];
+ if (tmpPtr) {
+   tmpPtr=((Dictionary *)tmpPtr)->Find(name);
+   if (tmpPtr) {
+     tmpPtr=(Object *)((Configuration *)tmpPtr)->Find(value);
+     if (tmpPtr)
+       return (char *)tmpPtr;
+   }
+ }
+ // If this parameter is defined in global then return it
+ if ((char *)tmpPtr=Find(value)) {
+   return (char *)tmpPtr;
+ }
+#ifdef DEBUG
+ cerr << "Could not find configuration option " << blockName<<":"
+      <<name<<":"<<value<< "\n";
+#endif
+return NULL;
+}
+
+//*********************************************************************
 // int Configuration::Value(char *name, int default_value)
 //
 int Configuration::Value(char *name, int default_value)
@@ -270,7 +313,45 @@
     return value;
 }
 
+//*********************************************************************
+int Configuration::Value(char *blockName,char *name,char *value,
+			 int default_value = 0) {
+int retValue=default_value;
+char *tmpStr=Find(blockName,name,value);
+ if (tmpStr && *tmpStr) {
+   retValue=atoi(tmpStr);
+ }
+return retValue;
+}
+//*********************************************************************
+double Configuration::Double(char *blockName,char *name,char *value,
+				double default_value = 0) {
+double retValue=default_value;
+char *tmpStr=Find(blockName,name,value);
+ if (tmpStr && *tmpStr) {
+   retValue=atof(tmpStr);
+ }
+return retValue;
+}
+//*********************************************************************
+int Configuration::Boolean(char *blockName,char *name,char *value,
+				 int default_value = 0) {
+int retValue=default_value;
+char *tmpStr=Find(blockName,name,value);
+ if (tmpStr && *tmpStr) {
+        if (mystrcasecmp(tmpStr, "true") == 0 ||
+            mystrcasecmp(tmpStr, "yes") == 0 ||
+            mystrcasecmp(tmpStr, "1") == 0)
+            retValue = 1;
+        else if (mystrcasecmp(tmpStr, "false") == 0 ||
+                 mystrcasecmp(tmpStr, "no") == 0 ||
+                 mystrcasecmp(tmpStr, "0") == 0)
+            retValue = 0;
 
+ }
+return retValue;
+}
+
 //*********************************************************************
 // char *Configuration::operator[](char *name)
 //
@@ -285,85 +366,14 @@
 //
 int Configuration::Read(char *filename)
 {
-    ifstream	in(filename);
-
-    if (in.bad() || in.eof())
-        return NOTOK;
-
-    //
-    // Make the line buffer large so that we can read long lists of start
-    // URLs.
-    //
-    char	buffer[50000];
-    char	*current;
-    String	line;
-    String	name;
-    char	*value;
-    int         len;
-    while (!in.bad())
-    {
-        in.getline(buffer, sizeof(buffer));
-        if (in.eof())
-            break;
-        line << buffer;
-        line.chop("\r\n");
-        if (line.last() == '\\')
-        {
-            line.chop(1);
-            continue;			// Append the next line to this one
-        }
-
-        current = line.get();
-        if (*current == '#' || *current == '\0')
-        {
-            line = 0;
-            continue;			// Comments and blank lines are skipped
-        }
-
-        name = strtok(current, ": =\t");
-        value = strtok(0, "\r\n");
-        if (!value)
-            value = "";			// Blank value
-
-        //
-        // Skip any whitespace before the actual text
-        //
-        while (*value == ' ' || *value == '\t')
-            value++;
-	len = strlen(value) - 1;
-	//
-	// Skip any whitespace after the actual text
-	//
-	while (value[len] == ' ' || value[len] == '\t')
-	  {
-	    value[len] = '\0';
-	    len--;
-	  }
-
-	if (mystrcasecmp(name, "include") == 0)
-	{
-	    ParsedString	ps(value);
-	    String		str(ps.get(dict));
-	    if (str[0] != '/')		// Given file name not fully qualified
-	    {
-		str = filename;		// so strip dir. name from current one
-		len = str.lastIndexOf('/') + 1;
-		if (len > 0)
-		    str.chop(str.length() - len);
-		else
-		    str = "";		// No slash in current filename
-		str << ps.get(dict);
-	    }
-	    Read(str.get());
-	    line = 0;
-	    continue;
-	}
-
-        Add(name, value);
-        line = 0;
-    }
-    in.close();
-    return OK;
+extern FILE* yyin;
+extern yyparse(void*);
+if ((yyin=fopen(filename,"r"))==NULL) 
+	return NOTOK;
+
+yyparse(this);
+fclose(yyin);
+return OK;
 }
 
 
Index: htdig3/htlib/Configuration.h
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htlib/Configuration.h,v
retrieving revision 1.2
diff -u -r1.2 Configuration.h
--- htdig3/htlib/Configuration.h	1997/07/03 17:44:38	1.2
+++ htdig3/htlib/Configuration.h	1999/08/10 17:21:33
@@ -45,6 +45,7 @@
     //
     void		Add(char *name, char *value);
     void		Add(char *str);
+    void		Add(char *name, char *value, Configuration *aList);
     int			Remove(char *name);
 
     //
@@ -61,11 +62,16 @@
     // Searching can be done with the Find() member or the array indexing
     // operator
     //
-    char		*Find(char *name);
-    char		*operator[](char *name);
+    char	       *Find(char *name);
+    char	       *Find(char *blockName,char *name,char *value);
+    char	       *operator[](char *name);
     int			Value(char *name, int default_value = 0);
     double		Double(char *name, double default_value = 0);
     int			Boolean(char *name, int default_value = 0);
+    int			Value(char *blockName,char *name,char *value,int default_value = 0);
+    double		Double(char *blockName,char *name,char *value,double default_value = 0);
+    int			Boolean(char *blockName,char *name,char *value,int default_value = 0);
+    Object             *Get_Object(char *name);
 
     //
     // Read defaults from an array
Index: htdig3/htlib/Makefile.am
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htlib/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- htdig3/htlib/Makefile.am	1999/07/19 09:28:10	1.1
+++ htdig3/htlib/Makefile.am	1999/08/10 17:21:33
@@ -10,7 +10,8 @@
 	URL.cc URLTrans.cc cgi.cc good_strtok.cc io.cc strcasecmp.cc \
 	mktime.c strptime.c timegm.c HtCodec.cc HtWordCodec.cc \
 	HtURLCodec.cc HtVector.cc HtHeap.cc regex.c HtSGMLCodec.cc \
-	HtWordType.cc HtPack.cc HtDateTime.cc HtRegex.cc
+	HtWordType.cc HtPack.cc HtDateTime.cc HtRegex.cc \
+	conf.l.cc conf.tab.cc	
 
 libht_la_LDFLAGS = -version-info $(HTDIG_MAJOR_VERSION):$(HTDIG_MINOR_VERSION):$(HTDIG_MICRO_VERSION)
 
@@ -49,3 +50,8 @@
 	io.h \
 	lib.h \
 	regex.h
+
+conf.l.cc:	conf2.l
+	flex -oconf.l.cc conf2.l
+conf.tab.cc:	conf2.y
+	bison -d -o conf.tab.cc conf2.y
Index: htdig3/htmerge/Makefile.am
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htmerge/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- htdig3/htmerge/Makefile.am	1999/07/19 09:28:11	1.1
+++ htdig3/htmerge/Makefile.am	1999/08/10 17:21:34
@@ -8,4 +8,4 @@
 htmerge_SOURCES = db.cc docs.cc htmerge.cc words.cc 
 noinst_HEADERS = htmerge.h
 htmerge_DEPENDENCIES = $(HTLIBS)
-htmerge_LDADD = $(HTLIBS)
+htmerge_LDADD = $(HTLIBS) -ll
Index: htdig3/htnotify/Makefile.am
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htnotify/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- htdig3/htnotify/Makefile.am	1999/07/19 09:28:11	1.1
+++ htdig3/htnotify/Makefile.am	1999/08/10 17:21:34
@@ -7,4 +7,4 @@
 
 htnotify_SOURCES = htnotify.cc
 htnotify_DEPENDENCIES = $(HTLIBS)
-htnotify_LDADD = $(HTLIBS)
+htnotify_LDADD = $(HTLIBS) -ll
Index: htdig3/htsearch/Makefile.am
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htsearch/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- htdig3/htsearch/Makefile.am	1999/07/19 09:28:11	1.1
+++ htdig3/htsearch/Makefile.am	1999/08/10 17:21:35
@@ -13,4 +13,4 @@
 noinst_HEADERS = Display.h DocMatch.h ResultList.h ResultMatch.h \
 	Template.h TemplateList.h WeightWord.h htsearch.h parser.h
 htsearch_DEPENDENCIES = ../htfuzzy/libfuzzy.la $(HTLIBS)
-htsearch_LDADD = ../htfuzzy/libfuzzy.la $(HTLIBS)
+htsearch_LDADD = ../htfuzzy/libfuzzy.la $(HTLIBS) -ll
 
 
