;ELC   
;;; Compiled by aatharuv@cutter-john.mit.edu on Sun Jan  5 18:16:30 2003
;;; from file /afs/sipb.mit.edu/contrib/emacs/packages/w3-4.0pre.47/lisp/url-gopher.el
;;; in Emacs version 21.1.1
;;; with bytecomp version 2.85
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`url-gopher.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\207" [require url-vars url-parse] 2)
#@117 Return a list of attributes from a gopher url.  List is of the
type: host port selector-string MIME-type extra-info
(defalias 'url-grok-gopher-href #[(url) "\306\211\211\211\211\211\211\211\307\310\"\204  \311\312\"\210\313\314\"G\315\225Z\211\316U\2037 \317\202? \320[\306O!\307\321\n\"\203[ \313\n\314\"\313\n\315\"\313\n\322\"\202c \n\323\306\317\232\203n \306\202\201 \324\232\203y \325\202\201 \326\232\203\201 \327\330	!\204\221 \322	GW\203\225 	\202\231 	\314\306O\331\n\"A\206\252 \317\f\257.\207" [ylen y x extra type selector nil string-match "gopher:/*\\([^/]+\\)\\(/*\\)" error "Can't understand url %s" url-match 1 2 0 "" url-unhex-string "^\\([^:]+\\):\\([0-9]+\\)\\([?+]*\\)" 3 "70" "?" ask-block "+" gopher+ string-to-char assoc port host url url-use-hypertext-gopher url-gopher-to-mime] 9 (#$ . 723)])
(defalias 'url-convert-ask-to-form #[(ask) "\305\306\307\306\310\311\f\"\203\360 \312\f\313\"\314\312\f\315\"\227!	T\f\211G\307\225U\203- \307\225\2020 \307\225T\316O\n\317\230\203@ P\202 \n\320\230\204R \n\321\230\204R \n\322\230\203m \323\324\"\325\326@\206` \327	A@\206h \306%\202 \n\330\230\203\222 \331\332\333\334\"\237\"\325\335@\206\205 \336	A@\206\215 \306%\202 \n\337\230\203\263 \323\324\"\325\340@\206\246 \306	A@\206\256 \306%\202 \n\341\230\204\277 \n\342\230\203 \323\324\"\325\343@	$A\211\204\327 \344\345D\203\351 \346@\347RA\211\204\333 \350P\202 \351\352Q,\207" [parms x type form ask "<form enctype=application/gopher-ask-block\n      method=\"GOPHER-ASK\">\n <ul plain>\n" "" 0 string-match "^\\([^:]+\\): +\\(.*\\)" url-match 2 url-strip-leading-spaces 1 nil "note" "ask" "askf" "choosef" url-string-to-tokens 9 format "%s\n<li>%s<input name=\"%d\" value=\"%s\">" "Text:" "askp" mapcar car url-split "	" "%s\n<li>%s<input name=\"%d\" type=\"password\" value=\"%s\">" "Password:" "askl" "%s\n<li>%s<textarea name=\"%d\">%s</textarea>" "select" "choose" "%s\n<li>%s<select name=\"%d\">" "Yes" "No" "<option>" "\n" "</select>" "\n<li><input type=\"SUBMIT\"" " value=\"Submit Gopher+ Ask Block\"></ul></form>"] 7])
#@124 Return a list of link attributes from a gopher string.  Order is:
title, type, selector string, server, port, gopher-plus?
(defalias 'url-grok-gopher-line #[nil "\306\211\211\211\211\211\211\307 \210`\306\210`\212\310\311\312\"\210	SU?\205* 	{\211\313\314OP\f\n\257.\207" [nd st gopher+ port server selector nil beginning-of-line mapcar #[(var) "b\210\303	w\210\304\n`{\"\210d`T^\211\207" [st nd var "^	\n" set-variable] 4] (type selector server port) 0 1 type] 7 (#$ . 2889)])
(defalias 'url-format-gopher-link #[(gophobj) "@A@@G\306V\203 @\306\307O\202 \310\3118\3128\3138\314\310\232\203= G\306V\203= \306\307O\205G \307\314O\315\316\310#\317\"A\206[ \320\204e \310\202\227 \321\232\203v \322\323	\f%\202\227 \324\232\203\207 \322\325	\f%\202\227 \322\326	\f\nP\327!&.\207" [gophobj desc plus port serv type 0 1 "" 2 3 4 nil mapconcat #[(x) "\301U\203 \302\207\303U\203 \304\207\305U\203 \306\207\307!\207" [x 38 "&amp;" 60 "&lt;" 62 "&gt;" char-to-string] 2] assoc "(UNK)" "8" format "<LI> %s <A HREF=\"telnet://%s:%s/\">%s</A>\n" "T" "<LI> %s <A HREF=\"tn3270://%s:%s/\">%s</A>\n" "<LI> %s <A METHODS=%s HREF=\"gopher://%s:%s/%s\">%s</A>\n" url-hexify-string ref title url-gopher-labels] 8])
#@204 Decode text transmitted by gopher.
0. Delete status line.
1. Delete `^M' at end of line.
2. Delete `.' at end of buffer (end of text mark).
3. Delete `.' at beginning of line.   (does gopher want this?)
(defalias 'url-gopher-clean-text #[(&optional buffer) "\206 	q\210db\210n\204 \302c\210eb\210\303\304\305\306#\203# \307\310!\210\202 db\210\311y\210\312\313!\203< `\314y\210`|\210\311y\210\202) eb\210\315\316\305\306#\205N \317\311!\210\202? \207" [buffer url-working-buffer "\n" re-search-forward "[^\n]*$" nil t replace-match "" -1 looking-at "^\\.$" 1 search-forward "\n.." delete-char] 4 (#$ . 4179)])
(defalias 'url-parse-gopher #[(&optional buffer) "\212\206 	q\210\306\307\310\"\210\306\311\310\"\210\312p!\210db\210\313\314x\210d`|\210\315c\210eb\210\316\314w\210e`|\210\317ed\"\314\320m\204T \321 B\fT\322\323\f\n\324\f\n\"$\210\325y\210\2028 \237\326 \210\327\330H\310\230\204s \330H\331\230\204s \330H\332\230\203{ \333\334HP\202\224 \335\336\337%\"\330H\"\203\221 \330H\340\314O\202\224 \330H\341\342\343\310#\344\261,\207" [buffer url-working-buffer len objs i url-current-object url-replace-regexp "^*$\n" "" "^\\.*$\n" url-gopher-clean-text "\n	 " nil "\n" " 	\n" count-lines 0 url-grok-gopher-line url-lazy-message "Converting gopher listing... %d/%d (%d%%)" url-percentage 1 erase-buffer "<title>" 5 "1/" "1" "Gopher root at " 3 string-match format "^[%s]+/" 2 "</title><ol>" mapconcat url-format-gopher-link "</ol>" url-gopher-types] 7])
(defalias 'url-gopher-retrieve #[(host port selector &optional wait-for) "\306\307	\n;\203 \310\n!\202 \n$\311\211\312 \210/G\313V\203( /\314\311O/\315!\205\354 \212\316\317\"\210\320/\321P\"\2100\203M eb\210\3220\311\323#\204\331 \324!\325>\203\331 \204\274 \314f\326=\203\201 \327f\330\331\332\333\334\335\336\337\340\341\257\n>\203\201 \342\327!\343!e|\210\202\274 \314f\326=\203\240 \327f\344=\203\240 \311\323eb\210e\311\210`|\210\202\274 \314f\344=\203\274 \327f\344=\203\274 \323\311eb\210e\311\210`|\210\f\203\315 \345\346d\f\347d\f\"$\210\202\322 \345\350d\"\210\351!\210\202< \311\352\353\217\210\354\355!\205\353 \356\314!\210\202\336 )+\207" [url-working-buffer host port parsed len proc url-open-stream "*gopher*" string-to-int nil url-clear-tmp-buffer 0 1 processp set-process-sentinel ignore process-send-string "\n" re-search-forward t url-process-status (run open) 43 2 48 49 50 51 52 53 54 55 56 57 copy-marker read 45 url-lazy-message "Reading... %d of %d bytes (%d%%)" url-percentage "Read... %d bytes." url-accept-process-output (url-kill-process proc) ((error)) looking-at "" delete-char selector wait-for] 11])
(defalias 'url-do-gopher-cso-search #[(descr) "@A@\3068\307\211\310\311\"\210\312\313\"\310\314\"\210\312\313\"\315\f\316\317\n	#\320$\210eb\210\321\322\323\"\210\321\324\323\"\210\321\325\326\"\210eb\210\327\330\n\331	\332\261\210db\210\333c-\207" [descr search-term search-type file port host 2 nil string-match "search-by=\\([^&]+\\)" url-match 1 "search-term=\\([^&]+\\)" url-gopher-retrieve format "2query %s=%s" "^[2-9]" url-replace-regexp "^-[0-9][0-9][0-9]:[0-9]*:" "" "^[^15][0-9][0-9]:.*" "^[15][0-9][0-9]:\\(.*\\)" "<H1>\\1</H1>&ensp;<PRE>" "<title>Results of CSO search</title>\n" "<h1>" " = " "</h1>\n" "</pre>"] 7])
(defalias 'url-do-gopher #[(descr) "@A@\3068\3078\3108\311@\312\232\203, \313\314\f\"\203, \315!\210\316\202%\312\232\203Z \317 \210\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347A\350\261\210\316\351\202%\352\232\203u \313\353\f\"\203u \354@\f#\210\355\351\202%\352\232\203\235 \313\356\f\"\203\235 \f\357\211\224O\353\f\357\225\311OQ\354@\f#\210\355\351\202%\352\232\203\306 \316\351\317 \210\320\321\360\323\324\325\361\327\362\363\364\365\366\343\327\344\345\346\347A\350\261\210\202%\n\204\326 \354@\f#\210\351\202%\n\367=\203\352 \354@\f\370P#\210\351\202%\n\371=\203%\354@\f\372P#\210eb\210\373\374\311\351#\203#`T\373\375\311\351#\206d{B\376 \210\377B!c\210\316\351)\202%\351\355\232\204A\201E \232\204A\f\201F \232\204A\316\232\203F\201G  \210	\203j\355\232\204X\f\201F \232\203j\201H  \210\316\201I \311\201J #C\206q\201E D\201I \311\201J #\211C.\207" [descr parse-gopher extr type file port 2 3 4 nil "www/gopher-cso-search" string-match "search-by=" url-do-gopher-cso-search "text/html" url-clear-tmp-buffer "<html>\n" " <head>\n" "  <title>CSO Search</title>\n" " </head>\n" " <body>\n" "  <div>\n" "   <h1>This is a CSO search</h1>\n" "   <hr>\n" "   <form>\n" "    <ul>\n" "     <li> Search by: <select name=\"search-by\">\n" "                      <option>Name\n" "                      <option>Phone\n" "                      <option>Email\n" "                      <option>Address\n" "                     </select>\n" "     <li> Search for: <input name=\"search-term\">\n" "     <li> <input type=\"submit\" value=\"Submit query\">\n" "    </ul>\n" "   </form>\n" "  </div>\n" " </body>\n" "</html>\n" "<!-- Automatically generated by URL v" " -->\n" t "www/gopher-search" "	" url-gopher-retrieve "www/gopher" "\\?" 0 "  <title>Gopher Server</title>\n" "   <h1>Searchable Gopher Index</h1>\n" "   <p>\n" "    Enter the search keywords below\n" "   </p>" "   <form enctype=\"application/x-gopher-query\">\n" "    <input name=\"internal-gopher\">\n" gopher+ "	+" ask-block "	!" re-search-forward "^\\+ASK:[ 	]*" "^\\+[^:]+:" erase-buffer url-convert-ask-to-form host url-version x url-current-mime-viewer url-current-mime-type "text/plain" "" url-gopher-clean-text url-parse-gopher mm-mime-info 5] 26])
(defalias 'url-gopher #[(url) "\305!\211A@\n\235\203 \306\307	A@\"!\203H \f\203! \310	!\202O \311\312\313	8G\314U\2030 \315\2025 \316\313	8!\313	8\313	8	@\317	A@!%p\"\202O \320 \210\321\322\323\")\207" [url descr url-bad-port-list url-confirmation-func url-use-hypertext-gopher url-grok-gopher-href format "Warning!  Trying to connect to port %s - continue? " url-do-gopher gopher-dispatch-object vector 2 0 49 string-to-char string-to-int ding url-warn security "Aborting connection to bad port..."] 9])
(provide 'url-gopher)
