Changes between Version 22 and Version 23 of ModParrotHLLDocs

Show
Ignore:
Timestamp:
12/25/08 22:22:35 (6 years ago)
Author:
jhorwitz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ModParrotHLLDocs

    v22 v23  
    171171    cmd['req_override'] = $P0 
    172172    $P0 = new 'String' 
    173     $P0 = 'usage: ParrotHeaderParserHandler handler-name' 
     173    $P0 = 'usage: ParrotHandler handler-name' 
    174174    cmd['errmsg'] = $P0 
     175}}} 
     176 
     177Creating a hash for more than a few directives can be cumbersome in PIR.  The PIR HLL module includes a subroutine called {{{new_cmd}}} that does the dirty work for us.  It may eventually be moved to {{{ModParrot;Apache;Module}}} so other modules can use it. 
     178 
     179''{{{new_cmd}}} from the PIR HLL module'' 
     180 
     181{{{ 
     182.sub new_cmd 
     183    .param string name 
     184    .param string how 
     185    .param string func 
     186    .param string override 
     187    .param string errmsg 
     188    .local pmc ap_const 
     189    .local pmc cmd 
     190 
     191    ap_const = get_root_global ['ModParrot'; 'Apache'; 'Constants'], 'table' 
     192 
     193    cmd = new 'Hash' 
     194    $P0 = new 'String' 
     195    $P0 = name 
     196    cmd['name'] = $P0 
     197    $P0 = new 'Integer' 
     198    $P0 = ap_const[how] 
     199    cmd['args_how'] = $P0 
     200    $P0 = get_hll_global [ 'ModParrot'; 'HLL'; 'PIR' ], func 
     201    cmd['func'] = $P0 
     202    $P0 = new 'Integer' 
     203    $P0 = ap_const[override] 
     204    cmd['req_override'] = $P0 
     205    $P0 = new 'String' 
     206    $P0 = errmsg 
     207    cmd['errmsg'] = $P0 
     208 
     209    .return(cmd) 
     210.end 
    175211}}} 
    176212