home *** CD-ROM | disk | FTP | other *** search
/ Hacker Chronicles 1 / HACKER1.ISO / hack / primecpl.txt < prev    next >
Text File  |  1992-09-08  |  12KB  |  306 lines

  1. _______________________________________________________________________________ 
  2.  
  3.  
  4.                   An Introduction to PRIMOS CPL Directives 
  5.                          Written by Necrovore
  6.  
  7.                  A Telecom Computer Security Bulletin File 
  8. _______________________________________________________________________________ 
  9.  
  10.  
  11.  
  12. PREFACE 
  13.  
  14. This text file is intended to serve as a reference guide for the aspiring CPL 
  15. programmer.  It is a full listing of CPL commands and discusses all arguments 
  16. rather thoroughly.  The following directives may be used within CPL programs 
  17. only (for information on writing CPL programs, see the CPL User's Guide). 
  18.  
  19. This file was to be released in Phrack Issue 20 but certain members of that 
  20. organization decided that this information was "too valuable for release to the
  21. general public".  You know what I think of that?  Utter bullshit.  Sounds more 
  22. like a bad case of information hoarding to me.  That is not very cool.  They 
  23. appear to be afraid that Primes will be abused by people.  Tell me, is it not 
  24. better to teach everyone what CPL is and what it can do and how to PROPERLY use
  25. it?  Thus, this file is not being released in Phrack.  It is being released as 
  26. part of TCSB Volume One. 
  27.  
  28.  
  29. CPL COMMANDS 
  30.  
  31. &ARGS [name[;[type][=default] ]...]~ 
  32. [name: -control_list [name[;[type][=default] ];...] ] 
  33.  
  34. Defines names (plus types, default values, and keywords, if desired) for arg- 
  35. uments to be passed to a CPL program.  Type may be any type shown below.  If 
  36. type is not specified the argument defaults to type char.  If default is not 
  37. specified, the system defaults are assigned as shown below: 
  38.  
  39.      Argument                                         CPL 
  40.        Type              Explanation             Default Value 
  41.  
  42.      CHAR          Any character string up to          " 
  43.                    1024 characters long, mapped 
  44.                    to upper case (default). 
  45.      CHARL         Any character string up to          " 
  46.                    1024 characters long, no 
  47.                    case shifting. 
  48.      TREE          A filename, directory name,         " 
  49.                    or pathname, up to 128 char- 
  50.                    acters long.  The last element 
  51.                    of the pathname (that is, the 
  52.                    final file or directory name) 
  53.                    may contain wildcard characters. 
  54.      ENTRY         A filename up 32 characters         " 
  55.                    long; may contain wildcard
  56.                    characters. 
  57.      DEC           A decimal integer (A).              0 
  58.      OCT           An octal integer (A).               0 
  59.      HEX           A hexadecimal integer (A).          0 
  60.      PTR           Pointer; a virtual address        7777/0 
  61.                    in the format "octal/octal" 
  62.                    (segno/wordno) (B). 
  63.      DATE          Calendar date in the format         " 
  64.                    mm/dd/yy.hh:mm:ss or yy-mm- 
  65.                    dd.hh:mm:ss.                        " 
  66.      REST          The remainder of the command 
  67.                    line. 
  68.      UNCL          All tokens not accounted for        " 
  69.                    in the &ARGS picture. 
  70.  
  71.      (A)  Numeric arguments must be within the range if -2**31+1...2**331-1 
  72.      (B)  User specified default values are not supported for this datatype. 
  73.  
  74.  
  75. &CALL routine_name 
  76.  
  77. Transfers control of the internal routine designated by routine_name.  See also
  78. &ROUTINE. 
  79.  
  80.  
  81. &CHECK expression &ROUTINE routine_name 
  82.  
  83. Defines an error condition (expression) and a routine (routine_name) to handle 
  84. the condition.  When this directive is present, the CPL interpreter evaluates 
  85. expression after executing each PRIMOS command.  If expression is true, control
  86. passes to routine_name. 
  87.  
  88.  
  89. &DATA statement 
  90.  statement1 
  91.     . 
  92.     . 
  93.     . 
  94.  statement-n 
  95. [&TTY] 
  96. &END 
  97.  
  98. Groups of statements to be treated as data or subcommands for user programs or 
  99. PRIMOS utilities.  The statement immediately following &DATA must invoke the 
  100. program or utility.  All other statements between &DATA and &END are evaluated,
  101. and the results written into a temporary file.  The program (or utility) is 
  102. then invoked and information passed to it, a line at a time, when called for. 
  103.  
  104. The &TTY directive may be used as the last statement preceding the &END.  When 
  105. it is reached, control passes to the user at the terminal.  When the user exits
  106. from the program or utility, control returns to the CPL program. 
  107.  
  108.  
  109. &DEBUG [option-list]
  110.  
  111. Enables debugging for the CPL procedure containing the &DEBUG directive.  If 
  112. given without options, &DEBUG is equivalent to &DEBUG NO_EXECUTE &ECGI ALL. 
  113. Options are: 
  114.  
  115.          OPTION                      ACTION 
  116.  
  117.      &OFF                            Turns off all debugging options. 
  118.                                      Initially all options are off. 
  119.      &NO_EXECUTE, &NEX               Suppresses execution of PRIMOS 
  120.                                      commands, but interprets CPL 
  121.                                      directives. 
  122.      &EXECUTE, &EX                   Enables execution of PRIMOS 
  123.                                      commands. 
  124.            {ALL}                     If ALL is specified, echoes PRIMOS 
  125.      &ECHO {COM}                     commands and CPL directives.  If COM 
  126.            {DIR}                     is specified, echoes only PRIMOS 
  127.                                      commands.  If DIR is specified, 
  128.                                      echoes CPL directives.  Default is ALL. 
  129.               {ALL}                  ALL cansels all echoing.  COM cancels 
  130.      &NO_ECHO {COM}                  echoing of PRIMOS commands.  DIR 
  131.               {DIR}                  cancels echoing of CPL directives. 
  132.                                      Default is ALL. 
  133.      &WATCH                          Adds the specified variables to the 
  134.      [var1 var2 ... var16]           watchlist  When the value of a 
  135.                                      watched variable is changed using 
  136.                                      the &SET_VAR directive (not the &SET_ 
  137.                                      VAR command), CPL reports this fact 
  138.                                      and the new value of the variable. 
  139.                                      At most 16 variables can be on the 
  140.                                      watchlist.  If no vari are present, 
  141.                                      all variables are watched. 
  142.      &NO_WATCH                       Removes the specified variable(s) 
  143.      [var1 var2 ... var16]           from the watchlist.  If no variables 
  144.                                      are specified, watching is turned 
  145.                                      off completely. 
  146.  
  147.  
  148. &DO [iteration] 
  149.  statement-1 
  150.     . 
  151.     . 
  152.     . 
  153.  statement-n 
  154. &END 
  155.  
  156. Allows a group of statements to be used anywhere a single statement can be 
  157. used.  If iteration is present, allows conditionally repeated execution of the 
  158. statements contained between the &DO and the &END, iteration may be any of: 
  159.  
  160.      1.  null (statement grouping) 
  161.      2.  [&WHILE while] [&UNTIL until] 
  162.      3.  var := start [&TO to] [&BY by] 
  163.             [&WHILE while] [&UNTIL until]
  164.      4.  var &LIST list [&WHILE while] [&UNTIL until] 
  165.      5.  var &ITEMS items [&WHILE while]  [&UNTIL until] 
  166.      6.  car := start &REPEAT repeat~ 
  167.             [&WHILE while] [&UNTIL until] 
  168.  
  169.  
  170. &EXPAND {ON} 
  171.         {OFF} 
  172.  
  173. Turns abbreviation expansion on or off.  Default is OFF. 
  174.  
  175.  
  176. &GOTO label_name 
  177.  
  178. Transfers control to the statement following the &LABEL label_name directive. 
  179.  
  180.  
  181. &IF expression &THEN true-statement 
  182. [&ELSE false-statement] 
  183.  
  184. Evaluates expression.  If expression is true, true-statement is executed.  If 
  185. expression is false, then: 
  186.  
  187.      o  If &ELSE is present, false-statement is executed. 
  188.      o  If &ELSE is not present, control passes to the next 
  189.         statement in the CPL program. 
  190.  
  191.  
  192. &LABEL label_name 
  193.  stateent 
  194.  
  195. Defines a label, label_name to which a &GOTO can go.  (When &GOTO is reached, 
  196. control passes to the statement following the &LABEL directive) 
  197.  
  198.  
  199. &ON condition &ROUTINE routine_label 
  200.  
  201. Defines an internal routine to act as condition-handler (or on-unit) for the 
  202. defined condition.  (See the PRIMOS Subroutines Reference Guide for a list of 
  203. PRIMOS-defined conditions and an explanation of PRIMOS's Condition Mechanism) 
  204.  
  205.  
  206. &RESULT expression 
  207.  
  208. Used only in CPL programs designed to invoke via function calls from other CPL 
  209. programs.  (For example, "&IF A<50 &THEN &S B := [R program]"). 
  210.  
  211. When the &RESULT directive is reached, expression is evaluated and its value 
  212. returned as the result of the function call. 
  213.  
  214.  
  215. &RETURN [severity] [&MESSAGE text] 
  216.  
  217. Halts execution of procedure in which it occurs.  Returns control to procedures
  218. called. 
  219.  
  220. If &MESSAGE is present, prints text on terminal when control returns.  If sev- 
  221. erity is present returns its value as a severity code to the procedures caller.
  222. Severity must be an integer. 
  223.  
  224.  
  225. &REVERT condition 
  226.  
  227. Disables the latest condition handler defibed (via the &ON directive) for the 
  228. named condition. 
  229.  
  230.  
  231. &ROUTINE routine_name 
  232.  
  233. Names and defines entry point for an internal routine. 
  234.  
  235.  
  236. &SELECT test_expression 
  237.  &WHEN expression-1 [,expression-2, ... ,expression-n] 
  238.  statement
  239.  &WHEN expression-1 [,expression-2, ... ,expression-n] 
  240.  statement 
  241.     . 
  242.     . 
  243.     . 
  244.  [&OTHERWISE statement] 
  245. &END 
  246.  
  247. Test_expression is evaluated and tested against expression-1, expression-2, and
  248. in turn until expression-n is reached.  When a match for test_expression is 
  249. found, the statement following the matching expression is executed. 
  250.  
  251. If no match is found, then: 
  252.  
  253.      o  If an &OTHERWISE directive is present, the statement following 
  254.         it is executed. 
  255.      o  If no &OTHERWISE directive is present, control passes to the 
  256.         statement following the &END of the &SELECT group. 
  257.  
  258.  
  259. &SET_VAR var-1 [, var-2, ... , var-n] := value 
  260.  
  261. Sets the value of the named variables to value.  The variables need not exist 
  262. previously.  May be abbreviated to &S. 
  263.  
  264.  
  265. &SEVERITY [level] [action] 
  266.  
  267. Checks for severity codes other than 0 (where codes > 0 indicate errors and 
  268. codes < 0 indicate warnings) after execution of each PRIMOS command.  If a code
  269. >= level is found, takes the specified action. 
  270.  
  271.      Level may be:
  272.  
  273.         &ERROR                  Ignore warnings, take action on errors. 
  274.         &WARNING                Take action on warnings and errors both. 
  275.  
  276.      Action may be: 
  277.  
  278.         &FAIL                   Halt execution, return a positive severity 
  279.                                 code to the routine's caller. 
  280.         &IGNORE                 Continue execution. 
  281.         &ROUTINE routine_name   Pass control to the designated routine. 
  282.  
  283. If neither level nor action is given, all severity codes are ignored.  If no 
  284. &SEVERITY directive is given, warnings are ignored and errors halt execution. 
  285.  
  286.  
  287. &SIGNAL condition [&NO_RETURN] 
  288.  
  289. Raises the condition "condition" and causes the CPL mechanism to search for a 
  290. handler for that condition.  If &NO_RETURN is specified, execution of the 
  291. error-causing procedure cannot be resumed. 
  292.  
  293.  
  294. &STOP [severity] [&MESSAGE text] 
  295.  
  296. Halts execution of procedure in which it occurs.  If this procedure is a rout- 
  297. ine, &STOP also halts the execution of the program containing the routine and 
  298. any of the other routines that program may have active.  Control returns to the
  299. caller of the mail program. 
  300.  
  301. If severity is present, specified severity code is returned to program's 
  302. caller.  Severity must be an integer.  If &MESSAGE is present, text is printed 
  303. at the caller's terminal. 
  304.  
  305. Downloaded From P-80 Systems 304-744-2253
  306.