home *** CD-ROM | disk | FTP | other *** search
- /* 00010000
- * Name: GOPSRVRP REXX 00020000
- * resolve gopher paths (selector strings) recursively 00030000
- * Author: Rick Troth, Rice University, Information Systems 00040000
- * Date: 1993-Jan-15, 19 00050000
- * 00060000
- * This file is part of CMS Gopher. 00070000
- */ 00080000
- 00090000
- /* 00100000
- * Copyright 1993 Richard M. Troth. This software was developed 00110000
- * with resources provided by Rice University and is intended 00120000
- * to serve Rice's user community. Rice has benefitted greatly 00130000
- * from the free distribution of software, therefore distribution 00140000
- * of unmodified copies of this material is not restricted. 00150000
- * You may change your own copy as needed. Neither Rice 00160000
- * University nor any of its employees or students shall be held 00170000
- * liable for damages resulting from the use of this software. 00180000
- */ 00190000
- 00200000
- Parse Source . . arg0 . 00210000
- Parse Arg nick '/' rest 00220000
- nick = Strip(nick) 00230000
- rest = Strip(rest) 00240000
- 00250000
- Do While nick = "" /* deal with null parts w/o recursion */ 00260000
- If rest = "" Then Do; 'SHORT'; Exit rc; End 00270000
- Parse Var rest nick '/' rest 00280000
- End /* Do While */ 00290000
- /* 00300000
- If nick = "" Then Do ** deal with null parts by recursion ** 00310000
- If rest = "" Then 'SHORT' 00320000
- Else 'CALLPIPE *: |' arg0 rest '| *:' 00330000
- Exit rc 00340000
- End ** If .. Do ** 00350000
- */ 00360000
- 00370000
- /* look for the shortcut on pure LISTFILE ouptut */ 00380000
- 'PEEKTO RECORD' 00390000
- If rc ^= 0 Then Exit rc * (rc ^= 12) 00400000
- If Strip(record) = "" Then Signal SHORTCUT 00410000
- 00420000
- /* part = nick; Upper part */ 00430000
- Parse Upper Var nick part 00440000
- 00450000
- Do Forever 00460000
- 00470000
- 'READTO RECORD' 00480000
- If rc ^= 0 Then Leave 00490000
- If Left(record,1) = '*' Then Iterate 00500000
- If Left(record,1) ^= ' ' Then Leave /* short cut */ 00510000
- 00520000
- Parse Upper Var record fn ft fm fp '"' . "'" . '05'x . 00530000
- If Strip(fn) = "" Then Iterate 00540000
- 00550000
- If fp = "" Then Select /* ft */ 00560000
- When Index(fn,'*') > 0 Then fp = fn || '.' || ft 00570000
- When ft = "" | ft = "*" | , 00580000
- ft = "FILELIST" Then fp = fn 00590000
- Otherwise fp = fn || '.' || ft 00600000
- End /* Select ft */ 00610000
- If Strip(fp) ^= part Then Iterate 00620000
- 00630000
- Say "GOPSRVRP: matched" fn ft fm fp 00640000
- /* found it! */ 00650000
- /* Parse Arg nick '/' . */ 00660000
- Address "COMMAND" 'GLOBALV SELECT GOPHERD PUT NICK' 00670000
- If rest = "" Then 'CALLPIPE GOPSRVLS' fn ft fm '| *:' 00680000
- Else 'CALLPIPE GOPSRVLS' fn ft fm '|' arg0 rest '| *:' 00690000
- /* Leave */ Exit rc 00700000
- 00710000
- End 00720000
- 00730000
- FALLOUT: 00740000
- Say "GOPSRVRP: didn't find a match for" nick 00750000
- /* fallout; we didn't find a match in this menu */ 00760000
- /* Parse Arg nick */ 00770000
- nick = nick || '/' || rest 00780000
- Address "COMMAND" 'GLOBALV SELECT GOPHERD PUT NICK' 00790000
- 'CALLPIPE GOPSRVLS ? ? ? | *:' 00800000
- 00810000
- Exit rc 00820000
- 00830000
- SHORTCUT: 00840000
- Parse Var 00850000
- Say "GOPSRVRP: shortcut to" fn ft fm fp 00860000
- /* found it! */ 00870000
- /* Parse Arg nick '/' . */ 00880000
- Address "COMMAND" 'GLOBALV SELECT GOPHERD PUT NICK' 00890000
- If rest = "" Then 'CALLPIPE GOPSRVLS' fn ft fm '| *:' 00900000
- Else 'CALLPIPE GOPSRVLS' fn ft fm '|' arg0 rest '| *:' 00910000
- /* Leave */ Exit rc 00920000
- 00930000
- 00940000
-