home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Rice_CMS / gopher24 / gopclini.$exec < prev    next >
Encoding:
Text File  |  1993-01-25  |  11.1 KB  |  141 lines

  1. /*                                                                      00010000
  2.  *        Name: GOPCLINI EXEC                                           00020000
  3.  *              CMS InterNet Gopher (client) initialization             00030000
  4.  *      Author: Rick Troth, Rice University, Information Systems        00040000
  5.  *        Date: 1992-Dec-23, 1993-Jan-22                                00050000
  6.  */                                                                     00060000
  7.                                                                         00070000
  8. /*                                                                      00080000
  9.  *      Copyright 1992 Richard M. Troth.   This software was developed  00090000
  10.  *      with resources provided by Rice University and is intended      00100000
  11.  *      to serve Rice's user community.   Rice has benefitted greatly   00110000
  12.  *      from the free distribution of software,  therefore distribution 00120000
  13.  *      of unmodified copies of this material is not restricted.        00130000
  14.  *      You may change your own copy as needed.   Neither Rice          00140000
  15.  *      University nor any of its employees or students shall be held   00150000
  16.  *      liable for damages resulting from the use of this software.     00160000
  17.  */                                                                     00170000
  18.                                                                         00180000
  19. Trace "OFF"                                                             00190000
  20.                                                                         00200000
  21. Address "COMMAND"                                                       00210000
  22.                                                                         00220000
  23. Parse Upper Arg . '(' opts ')' .                                        00230000
  24. fsin = 1;   load = 1                                                    00240000
  25. Do While opts ^= ""                                                     00250000
  26.     Parse Var opts op opts                                              00260000
  27.     Select  /*  op  */                                                  00270000
  28.         When  Abbrev("UNLOAD",op,3)     Then  Signal  UNLOAD            00280000
  29.         When  Abbrev("NOSCREEN",op,3)   Then  fsin = 0                  00290000
  30.         When  Abbrev("NOLOAD",op,3)     Then  load = 0                  00300000
  31.         When  Abbrev("SCREEN",op,3)     Then  fsin = 1                  00310000
  32.         When  Abbrev("LOAD",op,1)       Then  load = 1                  00320000
  33.         Otherwise 'XMITMSG 3 OP (ERRMSG'                                00330000
  34.         End  Select  /*  op  */                                         00340000
  35.     End  /*  Do  While  */                                              00350000
  36.                                                                         00360000
  37. 'SET LANGUAGE (ADD GOP USER'                                            00370000
  38. If rc ^= 0 Then Exit rc                                                 00380000
  39.                                                                         00390000
  40. /*  fetch the program ID string  */                                     00400000
  41. 'PIPE COMMAND XMITMSG 0 (APPLID GOP CALLER CLI NOHEADER | VAR PROGID'   00410000
  42.                                                                         00420000
  43. /*  migrate old bookmarks  */                                           00430000
  44. 'EXEC GOPHMARK'                                                         00440000
  45.                                                                         00450000
  46. Parse Upper Arg tube . '(' . ')' .                                      00460000
  47.                                                                         00470000
  48. 'GLOBALV SELECT GOPHER PUT GOPHER PROGID TUBE'                          00480000
  49. 'GLOBALV SELECT GOPHER SET ITEM'                                        00490000
  50. 'GLOBALV SELECT GOPHER SET COMMAND'                                     00500000
  51.                                                                         00510000
  52. /*  initialize screen variables  */                                     00520000
  53. If fsin Then Do                                                         00530000
  54.     If ^Datatype(tube,'X') Then 'VMFCLEAR'      /*  clear if cons  */   00540000
  55.     Call FSINIT tube            /*  figure out some screen attribs  */  00550000
  56.     'PIPE REXXVARS | DROP | JOIN 1 /,/ | LOCATE /n FS./' ,              00560000
  57.             '| CHANGE /n /GLOBALV SELECT GOPHER SETL / 1' ,             00570000
  58.                     '| CHANGE /,v / / 1 | COMMAND'                      00580000
  59.     End  /*  If  ..  Do  */                                             00590000
  60.                                                                         00600000
  61. /*  load client gems into memory for efficiency  */                     00610000
  62. If load Then                                                            00620000
  63. 'PIPE CMS L GOPCLI* REXX * | SPEC /EXECLOAD / 1 1-* NEXT | COMMAND'     00630000
  64.                                                                         00640000
  65. Exit                                                                    00650000
  66.                                                                         00660000
  67.                                                                         00670000
  68.                                                                         00680000
  69. /* -------------------------------------------------------------- FSINIT00690000
  70.  * Initialize variables used in building screen displays.               00700000
  71.  * (this code comes from Chuck Boeheim's PIPEDEMO; Thanks, Chuck!)      00710000
  72.  */                                                                     00720000
  73. FSINIT:   Procedure Expose fs.                                          00730000
  74. Parse Arg t                                                             00740000
  75. fs.tube = t                                                             00750000
  76.                                                                         00760000
  77. If Datatype(fs.tube,'X') Then Do                                        00770000
  78.                                                                         00780000
  79.     /*----------------------------------------------------------------*/00790000
  80.     /*  a dialed 3270 with pessimistic assumptions                    */00800000
  81.     /*----------------------------------------------------------------*/00810000
  82.                                                                         00820000
  83.     fs.scrrows = 24                                                     00830000
  84.     fs.scrcols = 80                                                     00840000
  85.     fs.write  = '80'x                                                   00850000
  86.     flags = '00'x                                                       00860000
  87.                                                                         00870000
  88.     End  /*  If  ..  Do  */                                             00880000
  89.                                                                         00890000
  90. Else Do                                                                 00900000
  91.                                                                         00910000
  92.     /*----------------------------------------------------------------*/00920000
  93.     /*  Get the screen size from CP.                                  */00930000
  94.     /*----------------------------------------------------------------*/00940000
  95.                                                                         00950000
  96.     Parse Value Diag('8C') with flags +1 3 fs.scrcols +2 fs.scrrows +2 .00960000
  97.     fs.scrrows = c2d(fs.scrrows)                                        00970000
  98.     fs.scrcols = c2d(fs.scrcols)                                        00980000
  99.                                                                         00990000
  100.     If  fs.scrrows > 24 | fs.scrcols > 80   Then fs.write = 'C0'x       01000000
  101.                                             Else fs.write = '80'x       01010000
  102.                                                                         01020000
  103.     End  /*  Else  Do  */                                               01030000
  104.                                                                         01040000
  105. fs.operwa = 'C0'x       /* Erase/Write alternate      */                01050000
  106. fs.operw  = '80'x       /* Erase/Write                */                01060000
  107. fs.opwr   = '00'x       /* Write                      */                01070000
  108. fs.oprd   = '06'x       /* Read modified.             */                01080000
  109.                                                                         01090000
  110. fs.wcc    = '03'x       /* Unlock keyboard, reset mdt */                01100000
  111.                                                                         01110000
  112. fs.high   = '1DE8'x     /* Protected, highlighted.    */                01120000
  113. fs.low    = '1D60'x     /* Protected, normal.         */                01130000
  114. fs.ic     = '13'x       /* Insert cursor.             */                01140000
  115.                                                                         01150000
  116. fs.color = (bitand(flags,'80'x) = '80'x)                                01160000
  117. fs.exthi = (bitand(flags,'40'x) = '40'x)                                01170000
  118. fs.pss   = (bitand(flags,'20'x) = '20'x)                                01180000
  119. fs.7171  = (bitand(flags,'02'x) = '02'x)                                01190000
  120. fs.14bit = (bitand(flags,'01'x) = '01'x)                                01200000
  121.                                                                         01210000
  122. Return                                                                  01220000
  123.                                                                         01230000
  124.                                                                         01240000
  125.                                                                         01250000
  126. /* -------------------------------------------------------------- UNLOAD01260000
  127.  *  Unload Gopher EXECs, pipeline stages, messages to free-up memory.   01270000
  128.  */                                                                     01280000
  129. UNLOAD:                                                                 01290000
  130.                                                                         01300000
  131. 'PIPE COMMAND EXECMAP | LOCATE 1.3 /GOP/' ,                             01310000
  132.         '| SPEC /EXECDROP / 1 1.20 NEXT | COMMAND'                      01320000
  133. If rc ^= 0 Then Exit rc                                                 01330000
  134.                                                                         01340000
  135. 'SET LANGUAGE (DELETE GOP USER'                                         01350000
  136.                                                                         01360000
  137. If rc ^= 0 Then Exit rc                                                 01370000
  138.                                                                         01380000
  139. Exit                                                                    01390000
  140.                                                                         01400000
  141.