Changes between Version 9 and Version 10 of ModParrotHLLDocs

Show
Ignore:
Timestamp:
12/25/08 20:46:24 (6 years ago)
Author:
jhorwitz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ModParrotHLLDocs

    v9 v10  
    175175}}} 
    176176 
     177We now turn our focus to the callback functions.  The prototype for a callback function is: 
     178 
     179{{{VOID callback(PMC dircfg, PMC args)}}} 
     180 * {{{dircfg}}}: the current directory configuration 
     181 * {{{args}}}: an array of arguments 
     182 
     183In a server scope, {{{dircfg}}} will be populated with that server's document root directory configuration (XXX verify this). 
     184 
     185Directive callbacks are responsible for updating the module configuration based on the arguments provided from the Apache config.  In the case of {{{ParrotHandler}}}, {{{func}}} references the {{{cmd_parrothandler}}} subroutine, which will be called each time the {{{ParrotHandler}}} directive is encountered in the Apache configuration.  Since it's a {{{TAKE1}}} callback, {{{args}}} will have one element.  When called, it updates the directory configuration with the name of the response handler from {{{args}}}. 
     186 
     187''Example: The {{{ParrotHandler}}} directive callback'' 
     188 
     189{{{ 
     190.sub cmd_parrothandler 
     191    .param pmc dircfg 
     192    .param pmc args 
     193 
     194    $S0 = args[0] 
     195    dircfg['response_handler'] = $S0 
     196.end 
     197}}} 
     198 
    177199=== Accessing mod_parrot's Configuration === 
    178200