Common subdirectories: gopher1.01/doc and gopher1.01.q/doc
Common subdirectories: gopher1.01/examples and gopher1.01.q/examples
Common subdirectories: gopher1.01/gopher and gopher1.01.q/gopher
Common subdirectories: gopher1.01/gopherd and gopher1.01.q/gopherd
Common subdirectories: gopher1.01/mindexd and gopher1.01.q/mindexd
Common subdirectories: gopher1.01/misc and gopher1.01.q/misc
Common subdirectories: gopher1.01/object and gopher1.01.q/object
Common subdirectories: gopher1.01/examples/.cap and gopher1.01.q/examples/.cap
Common subdirectories: gopher1.01/examples/Sample Directory and gopher1.01.q/examples/Sample Directory
Common subdirectories: gopher1.01/examples/Sample Directory/.cap and gopher1.01.q/examples/Sample Directory/.cap
Common subdirectories: gopher1.01/examples/Sample Directory/wais-index and gopher1.01.q/examples/Sample Directory/wais-index
diff -cr gopher1.01/gopher/gopher.c gopher1.01.q/gopher/gopher.c
*** gopher1.01/gopher/gopher.c	Mon Jun 22 09:17:30 1992
--- gopher1.01.q/gopher/gopher.c	Mon Jul 20 11:57:47 1992
***************
*** 10,15 ****
--- 10,76 ----
  #include <sys/file.h>
  void describe_gopher();
  
+ #define MAX_PROMPTS 12
+ 
+ void do_query(InGopher,ZeGopher)
+ GopherStruct *InGopher,*ZeGopher;
+ {
+    char *Option[MAX_PROMPTS];
+    int i;
+    char Response[MAX_PROMPTS][MAXSTR];
+    char sErrMsg[MAXSTR];          /* Error line on screen */
+    int NumPrompts;
+    char ReturnType;
+    char *p;
+    char selector[1024];
+    char return_selector[1024];
+ 
+    GScpy(ZeGopher,InGopher);
+ 
+    for(i=0; i<MAX_PROMPTS;i++) Response[i][0]='\0';
+    sErrMsg[0]='\0';
+    strcpy(selector,GSgetPath(ZeGopher));
+    p=strtok(selector,"|");
+    if (!p) return;
+    ReturnType= *p;
+    p=strtok(NULL,"|");
+    if (!p) return;
+    NumPrompts=atoi(p);
+    i=0;
+    while(i<NumPrompts) {
+        p=strtok(NULL,"|");
+        Option[i]=p;
+        i++;
+    }
+    Option[i]='\0';
+    p=strtok(NULL,"|"); /* p now equals selector (if any) */
+ 
+    if (p!=NULL) {
+       strcpy(return_selector,p);
+    } else {
+        return_selector[0]='\0';
+    }
+ 
+    if (NumPrompts == 1)  {
+      strcat(Option[0],": ");
+      CURGetOneOption(CursesScreen, Option[0], Response[0]);
+    } else {
+      Get_Options(GSgetTitle(ZeGopher), sErrMsg,NumPrompts,Option,Response);
+    }
+ 
+    GSsetType(ZeGopher,ReturnType);
+ 
+    for (i=0; i<NumPrompts; i++) {
+        if (i>0 || return_selector[0]) strcat(return_selector,"\t");
+        strcat(return_selector,Response[i]);
+    }   
+ 
+    GSsetPath(ZeGopher,return_selector);
+    return;
+ 
+ }
+ 
+ 
  /*
  ** Open a connection to another host using telnet or tn3270
  */
***************
*** 675,681 ****
       int iNum=0;
       BOOLEAN bDone = FALSE;
       char sTmp[80];
!      GopherStruct *RootGopher;
       int TypedChar;
       /*** for getopt processing ***/
       int c;
--- 736,742 ----
       int iNum=0;
       BOOLEAN bDone = FALSE;
       char sTmp[80];
!      GopherStruct *RootGopher,*QueryGopher,*SelectedGopher;
       int TypedChar;
       /*** for getopt processing ***/
       int c;
***************
*** 685,690 ****
--- 746,753 ----
       int Garbled = TRUE;
  
       RootGopher = GSnew();
+      QueryGopher = GSnew();
+ 
       SavedLinenum[SavedLinePtr] = 1;
  
  
***************
*** 774,785 ****
  	  case '\n':
  	       /*** Select the designated item ***/
  	       iNum = iLine - 1;
! 	       if (GSgetType(GDgetEntry(CurrentDir, iNum)) == A_DIRECTORY || 
! 		   GSgetType(GDgetEntry(CurrentDir, iNum)) == A_INDEX) {
  		    SavedLinenum[++SavedLinePtr] = iLine;
  		    iLine=1;
  	       }
! 	       if (process_request(GDgetEntry(CurrentDir, iNum))==1)
  		    iLine= iNum+1;
  	       break;
  	       
--- 837,855 ----
  	  case '\n':
  	       /*** Select the designated item ***/
  	       iNum = iLine - 1;
!                if(GSgetType(GDgetEntry(CurrentDir, iNum)) == A_QUERY) {
!                   do_query(GDgetEntry(CurrentDir,iNum),QueryGopher);
!                   SelectedGopher = QueryGopher;
!                } else {
!                   SelectedGopher = GDgetEntry(CurrentDir,iNum);
!                }
! 
! 	       if (GSgetType(SelectedGopher) == A_DIRECTORY || 
! 		   GSgetType(SelectedGopher) == A_INDEX) {
  		    SavedLinenum[++SavedLinePtr] = iLine;
  		    iLine=1;
  	       }
! 	       if (process_request(SelectedGopher)==1)
  		    iLine= iNum+1;
  	       break;
  	       
***************
*** 1159,1164 ****
--- 1229,1237 ----
  	  showfile(ZeGopher);
  	  break;
  
+      case A_QUERY:
+           do_query(ZeGopher);
+           break;
       case A_INDEX:
  	  Draw_Status("Searching Text...");
  	  refresh();
diff -cr gopher1.01/gopher/manager.c gopher1.01.q/gopher/manager.c
*** gopher1.01/gopher/manager.c	Wed Jun 10 23:03:43 1992
--- gopher1.01.q/gopher/manager.c	Mon Jul 20 11:58:04 1992
***************
*** 72,77 ****
--- 72,78 ----
    int nNewPage, nMaxPages, iPageLen, iLastPageLen;
  {
       int i, iLoop, iOffset;
+      char ch,query;
  
       /*** Clear the screen and redraw the top line **/
       clear();
***************
*** 109,115 ****
  	       printw(" %s", c);
  
       }
! 	  switch(GSgetType(GDgetEntry(gopherdir,iOffset)))
  	     {
  	     case A_DIRECTORY:
  	       addch('/');
--- 110,125 ----
  	       printw(" %s", c);
  
       }
! 
!         ch=GSgetType(GDgetEntry(gopherdir,iOffset));
!         if (ch==A_QUERY) {
!            query=A_QUERY;
!            ch= *GSgetPath(GDgetEntry(gopherdir,iOffset));
!         } else {
!            query='\0';
!         }
!                        
! 	  switch(ch)
  	     {
  	     case A_DIRECTORY:
  	       addch('/');
***************
*** 123,128 ****
--- 133,141 ----
  	     case A_INDEX:
  	       addstr(" <?>");
  	       break;
+ 	     case A_QUERY:
+ 	       addstr(" <QUERY>");
+ 	       break;
               case A_SOUND:
  	       addstr(" <)");  /** It's supposed to look like a speaker! **/
  	       break;
***************
*** 138,144 ****
  	       break;
  
               }
!      }
  }
  
  
--- 151,158 ----
  	       break;
  
               }
!              if (query==A_QUERY) addstr(" [QUERY]");
! 	}
  }
  
  
Common subdirectories: gopher1.01/misc/Logging and gopher1.01.q/misc/Logging
Common subdirectories: gopher1.01/misc/NeXT and gopher1.01.q/misc/NeXT
Common subdirectories: gopher1.01/misc/Radio and gopher1.01.q/misc/Radio
Common subdirectories: gopher1.01/misc/archie-gopher-gw and gopher1.01.q/misc/archie-gopher-gw
Common subdirectories: gopher1.01/misc/go500 and gopher1.01.q/misc/go500
Common subdirectories: gopher1.01/misc/gopher2ftp and gopher1.01.q/misc/gopher2ftp
Common subdirectories: gopher1.01/misc/gopherdist and gopher1.01.q/misc/gopherdist
Common subdirectories: gopher1.01/misc/gopherhunt and gopher1.01.q/misc/gopherhunt
Common subdirectories: gopher1.01/misc/shell-utils and gopher1.01.q/misc/shell-utils
Common subdirectories: gopher1.01/misc/waisgopher and gopher1.01.q/misc/waisgopher
Common subdirectories: gopher1.01/misc/Radio/radio and gopher1.01.q/misc/Radio/radio
Common subdirectories: gopher1.01/misc/Radio/radiod and gopher1.01.q/misc/Radio/radiod
diff -cr gopher1.01/object/GSgopherobj.c gopher1.01.q/object/GSgopherobj.c
*** gopher1.01/object/GSgopherobj.c	Thu Jun 11 17:20:22 1992
--- gopher1.01.q/object/GSgopherobj.c	Mon Jul 20 11:56:26 1992
***************
*** 222,227 ****
--- 222,228 ----
         case A_HTML:
         case A_TN3270:
         case A_MIME:
+        case A_QUERY:
  /*     case A_EVENT:
         case A_CALENDAR:   not ready for prime time yet */
  	  break;
***************
*** 353,359 ****
  #define	G_NAME	(1<<2)
  #define	G_PORT	(1<<3)
  #define	G_HOST	(1<<4)
! #define	G_ALL (G_PATH | G_TYPE | G_NAME | G_PORT | G_HOST)
  
  int
  GSfromLink(gs, fd, host, port)
--- 354,362 ----
  #define	G_NAME	(1<<2)
  #define	G_PORT	(1<<3)
  #define	G_HOST	(1<<4)
! #define G_PROMPT      (1<<5)
! #define G_RETURNTYPE  (1<<6)
! #define	G_ALL (G_PATH | G_TYPE | G_NAME | G_PORT | G_HOST | G_PROMPT | G_RETURNTYPE)
  
  int
  GSfromLink(gs, fd, host, port)
***************
*** 364,370 ****
--- 367,378 ----
  {
       int doneflags = 0;
       char buf[1024];
+      char Prompts[1024];
+      char ReturnType;
+      int NumPrompts=0;
  
+      Prompts[0]='\0';
+ 
       while ((doneflags != G_ALL) && readline(fd, buf, 1024)) {
  	  if (buf[0] == '#')
  	       continue;   /* comment */
***************
*** 374,381 ****
  	  if (strncmp(buf, "Type=", 5)==0) {
  	       GSsetType(gs, buf[5]);
  	       doneflags |= G_TYPE;
  	  }
! 	  
  	  if (strncmp(buf, "Name=", 5)==0) {
  	       GSsetTitle(gs, buf+5);
  	       doneflags |= G_NAME;
--- 382,401 ----
  	  if (strncmp(buf, "Type=", 5)==0) {
  	       GSsetType(gs, buf[5]);
  	       doneflags |= G_TYPE;
+                if (buf[5]!=A_QUERY) doneflags |= (G_PROMPT | G_RETURNTYPE);
  	  }
! 	  if (strncmp(buf, "ReturnType=",11)==0) {
!                ReturnType = buf[11];
!                doneflags |= G_RETURNTYPE;
! 	  }
! 
!           if (strncmp(buf,"Prompt=",7)==0) {
!                strcat(Prompts,"|");
!                strcat(Prompts,buf+7);
!                NumPrompts++;
!                doneflags |= G_PROMPT;
!           }
!     
  	  if (strncmp(buf, "Name=", 5)==0) {
  	       GSsetTitle(gs, buf+5);
  	       doneflags |= G_NAME;
***************
*** 406,411 ****
--- 426,443 ----
  	       GSsetNum(gs, atoi(buf+5));
  	  
       }
+ 
+      if (doneflags==G_ALL && GSgetType(gs)==A_QUERY) { /*patch selector */
+        char buffer[1024];
+        sprintf(buffer,"%c|%d",ReturnType,NumPrompts);
+        if (NumPrompts) strcat(buffer,Prompts);
+        if (strcmp(GSgetPath(gs),"")) {
+            strcat(buffer,"|");
+            strcat(buffer,GSgetPath(gs));
+ 	 }
+        GSsetPath(gs,buffer);
+      }
+ 
       return ((doneflags == G_ALL) ? 0 : -1); /* 0 == success */
  }
  
diff -cr gopher1.01/object/GSgopherobj.h gopher1.01.q/object/GSgopherobj.h
*** gopher1.01/object/GSgopherobj.h	Thu Jun 11 17:20:09 1992
--- gopher1.01.q/object/GSgopherobj.h	Mon Jul 20 11:56:24 1992
***************
*** 19,25 ****
  #define A_TN3270    'T'
  #define A_MIME      'M'
  #define A_EOI	    '.'
! 
  
  /** Our Gopher Object Type **/
  
--- 19,25 ----
  #define A_TN3270    'T'
  #define A_MIME      'M'
  #define A_EOI	    '.'
! #define A_QUERY     'q'
  
  /** Our Gopher Object Type **/
  
