home *** CD-ROM | disk | FTP | other *** search
- /* 00010000
- * Name: GOPSRVGL REXX 00020000
- * read and process a GOPHER (link) file for GOPHERD 00030000
- * Author: Rick Troth, Rice University, Information Systems 00040000
- * Date: 1993-Jan-15 00050000
- */ 00060000
- 00070000
- /* 00080000
- * Copyright 1993 Richard M. Troth. This software was developed 00090000
- * with resources provided by Rice University and is intended 00100000
- * to serve Rice's user community. Rice has benefitted greatly 00110000
- * from the free distribution of software, therefore distribution 00120000
- * of unmodified copies of this material is not restricted. 00130000
- * You may change your own copy as needed. Neither Rice 00140000
- * University nor any of its employees or students shall be held 00150000
- * liable for damages resulting from the use of this software. 00160000
- */ 00170000
- 00180000
- Address "COMMAND" 'GLOBALV SELECT GOPHERD GET HOST PORT' 00190000
- localhost = host; localport = port 00200000
- host = ""; port = ""; path = ""; name = ""; type = "" 00210000
- 00220000
- Do Forever 00230000
- 00240000
- 'PEEKTO RECORD' 00250000
- If rc ^= 0 Then Leave 00260000
- 00270000
- If Left(record,1) = '*' Then Call WRITELINK 00280000
- If Left(record,1) = '#' Then Call WRITELINK 00290000
- If rc ^= 0 Then Leave 00300000
- 00310000
- Parse Var record var '=' val 00320000
- Upper var; var = Strip(var) 00330000
- Select /* var */ 00340000
- When var = "TYPE" Then type = Strip(val) 00350000
- When var = "NAME" Then name = val 00360000
- When var = "PATH" Then path = val 00370000
- When var = "HOST" Then host = Strip(val) 00380000
- When var = "PORT" Then port = Strip(val) 00390000
- Otherwise nop /* ignore invalid lines */ 00400000
- End /* Select var */ 00410000
- 00420000
- 'READTO' 00430000
- If rc ^= 0 Then Leave 00440000
- 00450000
- End /* Do Forever */ 00460000
- 00470000
- If rc = 12 Then Call WRITELINK 00480000
- 00490000
- Exit rc * (rc ^= 12) 00500000
- 00510000
- 00520000
- 00530000
- /* ----------------------------------------------------------- WRITELINK00540000
- * Looks like a break. Iff we have everthing, 00550000
- * then write this link and reset the variables to empty strings. 00560000
- */ 00570000
- WRITELINK: 00580000
- If name = "" | type = "" Then Return 00590000
- If host = "" Then host = localhost 00600000
- If host = "+" Then host = localhost 00610000
- If type = "FILE" Then type = '0' 00620000
- If type = "DIRECTORY" Then type = '1' 00630000
- If port = "" Then 00640000
- Select /* type */ 00650000
- When type = '2' Then port = '105' 00660000
- When type = '8' Then port = '23' 00670000
- When type = 'T' Then port = '23' 00680000
- Otherwise port = '70' 00690000
- End /* Select type */ 00700000
- 'OUTPUT' type || name || '05'x || path || '05'x , 00710000
- || host || '05'x || port 00720000
- host = ""; port = ""; path = ""; name = ""; type = "" 00730000
- Return 00740000
- 00750000
-