perl.cvs.mod_parrot
[Top] [All Lists]

[svn:mod_parrot] r370 - mod_parrot/trunk/lib/ModParrot/HLL

Subject: [svn:mod_parrot] r370 - mod_parrot/trunk/lib/ModParrot/HLL
From: jhorwitz@xxxxxxxxxxxx
Date: Mon, 21 Jul 2008 11:59:04 -0700 (PDT)
Newsgroups: perl.cvs.mod_parrot

Author: jhorwitz
Date: Mon Jul 21 11:59:04 2008
New Revision: 370

Modified:
   mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir

Log:
add a proof-of-concept implementation of Perl6ResponseHandler


Modified: mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir
==============================================================================
--- mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir        (original)
+++ mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir        Mon Jul 21 11:59:04 2008
@@ -38,6 +38,42 @@
     $P0.'register'($P1)
     $P1 = get_class ['ModParrot'; 'Context']
     $P0.'register'($P1)
+
+    # register apache directives
+    .local pmc add_module, cmds
+
+    load_bytecode 'Apache/Module.pbc'
+
+    cmds = new 'Array'
+    cmds = 1
+    $P0 = new 'Hash'
+
+    $P1 = new 'String'
+    $P1 = 'Perl6ResponseHandler'
+    $P0['name'] = $P1
+    $P1 = new 'Integer'
+    $P1 = 1 # TAKE1
+    $P0['args_how'] = $P1
+    $P1 = get_hll_global 'cmd_perl6responsehandler'
+    $P0['func'] = $P1
+    $P1 = new 'Integer'
+    $P1 = 8 # OR_AUTHCFG
+    $P0['req_override'] = $P1
+    $P1 = new 'String'
+    $P1 = "usage: Perl6ResponseHandler handler-name"
+    $P0['errmsg'] = $P1
+    cmds[0] = $P0
+
+    add_module = get_hll_global [ 'Apache'; 'Module' ], 'add'
+    $P1 = add_module("modparrot_perl6_module", cmds)
+.end
+
+.sub cmd_perl6responsehandler
+    .param pmc args
+    .local string handler
+    handler = args[0]
+    $P0 = get_hll_global ['Apache'; 'Module'], 'modparrot_dircfg_handler'
+    $P1 = $P0('perl6', handler)
 .end
 
 # declare namespace AFTER loading compiler

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:mod_parrot] r370 - mod_parrot/trunk/lib/ModParrot/HLL, jhorwitz <=