home *** CD-ROM | disk | FTP | other *** search
- /* 00010000
- * Name: GOPCLITM REXX 00020000
- * VM TCP/IP Network GOPHER Client item processor 00030000
- * Author: Rick Troth, Rice University, Information Systems 00040000
- * Date: 1992-Dec-23 00050000
- * 00060000
- * Input: one or more gopher menu lines 00070000
- * Output: zero or more information or error messages 00080000
- * (EOF does not propagate back to input) 00090000
- */ 00100000
- 00110000
- /* 00120000
- * Copyright 1992 Richard M. Troth. This software was developed 00130000
- * with resources provided by Rice University and is intended 00140000
- * to serve Rice's user community. Rice has benefitted greatly 00150000
- * from the free distribution of software, therefore distribution 00160000
- * of unmodified copies of this material is not restricted. 00170000
- * You may change your own copy as needed. Neither Rice 00180000
- * University nor any of its employees or students shall be held 00190000
- * liable for damages resulting from the use of this software. 00200000
- */ 00210000
- 00220000
- Trace "OFF" 00230000
- 00240000
- Parse Upper Arg disp . '(' . ')' . 00250000
- If disp = "" Then disp = "OPEN" 00260000
- /* Say open */ 00270000
- 00280000
- /* sync with input so that 'CALLPIPE COMMAND' will work */ 00290000
- 'PEEKTO' 00300000
- 00310000
- 'CALLPIPE COMMAND GLOBALV SELECT GOPHER GET GOPHER PROGID' 00320000
- 00330000
- /* fetch fs. stem variable from GlobalVs */ 00340000
- 'CALLPIPE COMMAND GLOBALV SELECT GOPHER LIST | DROP' , 00350000
- '| LOCATE 1-4 / FS./ | SPEC /=/ 1 2-* NEXT | VARLOAD' 00360000
- If ^Datatype(fs.tube,'X') Then fs.tube = "" 00370000
- 00380000
- /* prepare for dynamic connection statistics */ 00390000
- stat = 'STEM STAT. | GOPCLIST' 00400000
- 00410000
- Do Forever 00420000
- 00430000
- 'PEEKTO ITEM' 00440000
- If rc ^= 0 Then Leave 00450000
- 00460000
- 'CALLPIPE COMMAND GLOBALV SELECT GOPHER PUT ITEM' 00470000
- 00480000
- Parse Var item name '05'x path '05'x host '05'x port '05'x xtra 00490000
- Parse Var name 1 type 2 name 00500000
- 00510000
- stat.0 = 0 00520000
- 00530000
- Select /* type */ 00540000
- 00550000
- When type = '0' Then Call OPENFILE 00560000
- 00570000
- When type = '1' Then Call OPENMENU 00580000
- 00590000
- When type = '2' Then Call LOOKUP 00600000
- 00610000
- When type = '4' Then Call OPENFILE /* MAC */ 00620000
- 00630000
- When type = '5' Then Call OPENFILE /* DOS */ 00640000
- 00650000
- When type = '6' Then Call OPENFILE /* UUE */ 00660000
- 00670000
- When type = '7' Then Call SEARCH 00680000
- 00690000
- When type = '8' Then Call TELNET 00700000
- 00710000
- When type = '9' Then Call BINARY 00720000
- 00730000
- When type = 'T' Then Call TN3270 00740000
- 00750000
- When type = 'r' | , 00760000
- type = 'v' Then Call CMSBLOCK 00770000
- 00780000
- When type = 'I' | , 00790000
- type = ':' | , 00800000
- type = 'g' Then Call GRAPHICS 00810000
- 00820000
- Otherwise Call OPENFILE 00830000
- 00840000
- End /* Select type */ 00850000
- 00860000
- If rc ^= 0 Then 'CALLPIPE STEM STAT. | *:' 00870000
- 00880000
- 'READTO' 00890000
- 00900000
- End /* Do Forever */ 00910000
- 00920000
- Exit rc * (rc ^= 12) 00930000
- 00940000
- 00950000
- 00960000
- /* ------------------------------------------------------------ OPENFILE00970000
- * View or retrieve a plain text file. 00980000
- */ 00990000
- OPENFILE: 01000000
- 01010000
- filter = 'GOPCLITX' 01020000
- 01030000
- If disp = "KEEP" Then Signal KEEPFILE 01040000
- 01050000
- 'CALLPIPE (END !) VAR ITEM | E: GOPCLISX' , 01060000
- '| GOPCLITX | GOPCLIFV | *:' , 01070000
- '! E: |' stat 01080000
- 01090000
- Return 01100000
- 01110000
- 01120000
- 01130000
- /* ------------------------------------------------------------ OPENMENU01140000
- * View or retrieve a plain text file. 01150000
- */ 01160000
- OPENMENU: 01170000
- 01180000
- filter = 'GOPCLITX' 01190000
- 01200000
- If disp = "KEEP" Then Signal KEEPFILE 01210000
- 01220000
- 'CALLPIPE (END !) VAR ITEM | E: GOPCLISX' , 01230000
- '| GOPCLITX | GOPCLIMB | *:' , 01240000
- '! E: |' stat 01250000
- 01260000
- Return 01270000
- 01280000
- 01290000
- 01300000
- /* -------------------------------------------------------------- LOOKUP01310000
- * Perform user lookup. (punt to PH EXEC or equivalent) 01320000
- */ 01330000
- LOOKUP: 01340000
- 01350000
- host = Strip(host) 01360000
- port = Strip(port) 01370000
- 'CALLPIPE COMMAND GLOBALV SELECT PHCMS PUT HOST PORT' 01380000
- Address "CMS" 'PH' 01390000
- 01400000
- Return 01410000
- 01420000
- 01430000
- 01440000
- /* -------------------------------------------------------------- SEARCH01450000
- */ 01460000
- SEARCH: 01470000
- 01480000
- 'CALLPIPE COMMAND XMITMSG 601 (APPLID GOP NOHEADER' , 01490000
- '| GOPCLIUI | VAR KEYWORDS' 01500000
- keywords = Strip(keywords) 01510000
- If keywords = "" Then Return 01520000
- 01530000
- /* prepend a path<TAB> to search string for WAIS servers */ 01540000
- /* path = path || '05'x || keywords */ 01550000
- item = item || '05'x || keywords 01560000
- 01570000
- 'CALLPIPE (END !) VAR ITEM | E: GOPCLISX' , 01580000
- '| GOPCLITX | GOPCLIMB | *:' 01590000
- '! E: |' stat 01600000
- 01610000
- Return 01620000
- 01630000
- 01640000
- 01650000
- /* -------------------------------------------------------------- TELNET01660000
- */ 01670000
- TELNET: 01680000
- 01690000
- If fs.tube ^= "" Then Do 01700000
- /* 'OUTPUT' "Can't TELNET from this screen" */ 01710000
- 'CALLPIPE COMMAND XMITMSG 512 "TELNET"' , 01720000
- '(APPLID GOP CALLER CLI ERRMSG | *:' 01730000
- Return 01740000
- End /* If .. Do */ 01750000
- 01760000
- Address "COMMAND" 01770000
- 01780000
- 'VMFCLEAR' 01790000
- If port = 0 Then port = "" 01800000
- /* Say progid "TELNET" host port */ 01810000
- 'XMITMSG 30 HOST PORT (APPLID GOP CALLER CLI ERRMSG' 01820000
- /* Say name */ 01830000
- 'XMITMSG 7 NAME (APPLID GOP CALLER CLI ERRMSG NOCOMP' 01840000
- 01850000
- If path ^= "" Then Do 01860000
- /* Say "login with:" path */ 01870000
- 'XMITMSG 32 PATH (APPLID GOP CALLER CLI NOHEADER' 01880000
- /* Say "Press ENTER to continue ... " */ 01890000
- 'XMITMSG 33 (APPLID GOP CALLER CLI NOHEADER' 01900000
- Parse External 01910000
- End /* If .. Do */ 01920000
- 01930000
- 'GLOBALV SELECT GOPHER GET TELNET' 01940000
- If telnet = "" Then telnet = "TELNET" 01950000
- Address "CMS" telnet host port 01960000
- 'VMFCLEAR' 01970000
- 01980000
- Address 01990000
- 02000000
- Return 02010000
- 02020000
- 02030000
- 02040000
- /* -------------------------------------------------------------- BINARY02050000
- * Load a "binary" (byte stream) file onto disk. 02060000
- */ 02070000
- BINARY: 02080000
- 02090000
- filter = "" 02100000
- 02110000
- If disp = "KEEP" Then Signal KEEPFILE 02120000
- 02130000
- 'CALLPIPE (END !) VAR ITEM | E: GOPCLISX' , 02140000
- '| GOPCLIFV | *:' , 02150000
- '! E: |' stat 02160000
- 02170000
- Return 02180000
- 02190000
- 02200000
- 02210000
- /* -------------------------------------------------------------- TN327002220000
- * This is almost exactly the same as the TELNET routine, 02230000
- * but we let the user run a different program, specified in 02240000
- * global variable TN3270, if they wish. 02250000
- */ 02260000
- TN3270: 02270000
- 02280000
- If fs.tube ^= "" Then Do 02290000
- /* 'OUTPUT' "Can't TN3270 from this screen" */ 02300000
- 'CALLPIPE COMMAND XMITMSG 512 "TN3270"' , 02310000
- '(APPLID GOP CALLER CLI ERRMSG | *:' 02320000
- Return 02330000
- End /* If .. Do */ 02340000
- 02350000
- Address "COMMAND" 02360000
- 02370000
- 'VMFCLEAR' 02380000
- If port = 0 Then port = "" 02390000
- /* Say progid "TN3270" host port */ 02400000
- 'XMITMSG 31 HOST PORT (APPLID GOP CALLER CLI ERRMSG' 02410000
- /* Say name */ 02420000
- 'XMITMSG 7 NAME (APPLID GOP CALLER CLI ERRMSG NOCOMP' 02430000
- If path ^= "" Then Do 02440000
- /* Say "login with:" path */ 02450000
- 'XMITMSG 32 PATH (APPLID GOP CALLER CLI NOHEADER' 02460000
- /* Say "Press ENTER to continue ... " */ 02470000
- 'XMITMSG 33 (APPLID GOP CALLER CLI NOHEADER' 02480000
- Parse External 02490000
- End /* If .. Do */ 02500000
- 02510000
- 'GLOBALV SELECT GOPHER GET TN3270' 02520000
- If tn3270 = "" Then Do 02530000
- 'GLOBALV SELECT GOPHER GET TELNET' 02540000
- If telnet = "" Then telnet = "TELNET" 02550000
- tn3270 = telnet 02560000
- End /* If .. Do */ 02570000
- Address "CMS" tn3270 host port 02580000
- 'VMFCLEAR' 02590000
- 02600000
- Address 02610000
- 02620000
- Return 02630000
- 02640000
- 02650000
- 02660000
- /* ------------------------------------------------------------ CMSBLOCK02670000
- * Save a record oriented file (type 'r' or type 'v') onto disk. 02680000
- */ 02690000
- CMSBLOCK: 02700000
- 02710000
- filter = 'DEBLOCK CMS' 02720000
- 02730000
- If disp = "KEEP" Then Signal KEEPFILE 02740000
- 02750000
- 'CALLPIPE (END !) VAR ITEM | E: GOPCLISX' , 02760000
- '| DEBLOCK CMS | GOPCLIFV | *:' , 02770000
- '! E: |' stat 02780000
- 02790000
- Return 02800000
- 02810000
- 02820000
- 02830000
- /* ------------------------------------------------------------ GRAPHICS02840000
- * Display or save a graphics (type 'I') file. 02850000
- */ 02860000
- GRAPHICS: 02870000
- 02880000
- filter = "" /* same as for "binary" files */ 02890000
- 02900000
- If disp = "KEEP" Then Signal KEEPFILE 02910000
- 02920000
- 'CALLPIPE (END !) VAR ITEM | E: GOPCLISX' , 02930000
- '| GOPCLIGV | *: ! E: |' stat 02940000
- 02950000
- Return 02960000
- 02970000
- 02980000
- 02990000
- /* ------------------------------------------------------------ KEEPFILE03000000
- * Save the selected file on disk. 03010000
- */ 03020000
- KEEPFILE: 03030000
- 03040000
- If fs.tube ^= "" Then Do 03050000
- 'CALLPIPE COMMAND XMITMSG 508 (APPLID GOP CALLER CLI ERRMSG | *:' 03060000
- Return 03070000
- End /* If .. Do */ 03080000
- 03090000
- Parse Var path 1 . 2 path /* discard type indicator */ 03100000
- file = gopclifi(path) 03110000
- 'CALLPIPE CMS STATE' file 'A | VAR NOTFOUND' 03120000
- If rc ^= 0 & rc ^= 28 Then 'CALLPIPE VAR NOTFOUND | *:' 03130000
- If rc = 0 Then 'CALLPIPE COMMAND XMITMSG 594 FILE' , 03140000
- '(APPLID GOP CALLER CLI ERRMSG | *:' 03150000
- If rc ^= 28 Then Return 03160000
- 03170000
- If filter = "" Then 03180000
- 'CALLPIPE (END !) VAR ITEM | E: GOPCLISX' , 03190000
- '| >' file 'A' , 03200000
- '! E: |' stat 03210000
- Else 03220000
- 'CALLPIPE (END !) VAR ITEM | E: GOPCLISX' , 03230000
- '|' filter '| >' file 'A' , 03240000
- '! E: |' stat 03250000
- 03260000
- If rc = 0 Then 'CALLPIPE COMMAND XMITMSG 571 FILE PATH' , 03270000
- '(APPLID GOP CALLER CLI ERRMSG | *:' 03280000
- /* If rc = 0 Then errmsg = "Created" fn ft fm "from" path */ 03290000
- 03300000
- Return 03310000
- 03320000
-