home *** CD-ROM | disk | FTP | other *** search
- /*
- * Name: GOPCLINI EXEC
- * CMS InterNet Gopher (client) initialization
- * Author: Rick Troth, Rice University, Information Systems
- * Date: 1992-Dec-23, 1993-Jan-22
- */
-
- /*
- * Copyright 1992 Richard M. Troth. This software was developed
- * with resources provided by Rice University and is intended
- * to serve Rice's user community. Rice has benefitted greatly
- * from the free distribution of software, therefore distribution
- * of unmodified copies of this material is not restricted.
- * You may change your own copy as needed. Neither Rice
- * University nor any of its employees or students shall be held
- * liable for damages resulting from the use of this software.
- */
-
- Trace "OFF"
-
- Address "COMMAND"
-
- Parse Upper Arg . '(' opts ')' .
- fsin = 1; load = 1
- Do While opts ^= ""
- Parse Var opts op opts
- Select /* op */
- When Abbrev("UNLOAD",op,3) Then Signal UNLOAD
- When Abbrev("NOSCREEN",op,3) Then fsin = 0
- When Abbrev("NOLOAD",op,3) Then load = 0
- When Abbrev("SCREEN",op,3) Then fsin = 1
- When Abbrev("LOAD",op,1) Then load = 1
- Otherwise 'XMITMSG 3 OP (ERRMSG'
- End Select /* op */
- End /* Do While */
-
- 'SET LANGUAGE (ADD GOP USER'
- If rc ^= 0 Then Exit rc
-
- /* fetch the program ID string */
- 'PIPE COMMAND XMITMSG 0 (APPLID GOP CALLER CLI NOHEADER | VAR PROGID'
-
- /* migrate old bookmarks */
- 'EXEC GOPHMARK'
-
- Parse Upper Arg tube . '(' . ')' .
-
- 'GLOBALV SELECT GOPHER PUT GOPHER PROGID TUBE'
- 'GLOBALV SELECT GOPHER SET ITEM'
- 'GLOBALV SELECT GOPHER SET COMMAND'
-
- /* initialize screen variables */
- If fsin Then Do
- If ^Datatype(tube,'X') Then 'VMFCLEAR' /* clear if cons */
- Call FSINIT tube /* figure out some screen attribs */
- 'PIPE REXXVARS | DROP | JOIN 1 /,/ | LOCATE /n FS./' ,
- '| CHANGE /n /GLOBALV SELECT GOPHER SETL / 1' ,
- '| CHANGE /,v / / 1 | COMMAND'
- End /* If .. Do */
-
- /* load client gems into memory for efficiency */
- If load Then
- 'PIPE CMS L GOPCLI* REXX * | SPEC /EXECLOAD / 1 1-* NEXT | COMMAND'
-
- Exit
-
-
-
- /* -------------------------------------------------------------- FSINIT
- * Initialize variables used in building screen displays.
- * (this code comes from Chuck Boeheim's PIPEDEMO; Thanks, Chuck!)
- */
- FSINIT: Procedure Expose fs.
- Parse Arg t
- fs.tube = t
-
- If Datatype(fs.tube,'X') Then Do
-
- /*----------------------------------------------------------------*/
- /* a dialed 3270 with pessimistic assumptions */
- /*----------------------------------------------------------------*/
-
- fs.scrrows = 24
- fs.scrcols = 80
- fs.write = '80'x
- flags = '00'x
-
- End /* If .. Do */
-
- Else Do
-
- /*----------------------------------------------------------------*/
- /* Get the screen size from CP. */
- /*----------------------------------------------------------------*/
-
- Parse Value Diag('8C') with flags +1 3 fs.scrcols +2 fs.scrrows +2 .
- fs.scrrows = c2d(fs.scrrows)
- fs.scrcols = c2d(fs.scrcols)
-
- If fs.scrrows > 24 | fs.scrcols > 80 Then fs.write = 'C0'x
- Else fs.write = '80'x
-
- End /* Else Do */
-
- fs.operwa = 'C0'x /* Erase/Write alternate */
- fs.operw = '80'x /* Erase/Write */
- fs.opwr = '00'x /* Write */
- fs.oprd = '06'x /* Read modified. */
-
- fs.wcc = '03'x /* Unlock keyboard, reset mdt */
-
- fs.high = '1DE8'x /* Protected, highlighted. */
- fs.low = '1D60'x /* Protected, normal. */
- fs.ic = '13'x /* Insert cursor. */
-
- fs.color = (bitand(flags,'80'x) = '80'x)
- fs.exthi = (bitand(flags,'40'x) = '40'x)
- fs.pss = (bitand(flags,'20'x) = '20'x)
- fs.7171 = (bitand(flags,'02'x) = '02'x)
- fs.14bit = (bitand(flags,'01'x) = '01'x)
-
- Return
-
-
-
- /* -------------------------------------------------------------- UNLOAD
- * Unload Gopher EXECs, pipeline stages, messages to free-up memory.
- */
- UNLOAD:
-
- 'PIPE COMMAND EXECMAP | LOCATE 1.3 /GOP/' ,
- '| SPEC /EXECDROP / 1 1.20 NEXT | COMMAND'
- If rc ^= 0 Then Exit rc
-
- 'SET LANGUAGE (DELETE GOP USER'
-
- If rc ^= 0 Then Exit rc
-
- Exit
-
-