[svn:mod_parrot] r286 - in mod_parrot/trunk/lib: . APR Apache

[email protected]
Newsgroups perl.cvs.mod_parrot,perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Thu Dec 20 14:22:51 2007
New Revision: 286

Modified:
   mod_parrot/trunk/lib/APR/Table.pir
   mod_parrot/trunk/lib/Apache/RequestRec.pir
   mod_parrot/trunk/lib/mod_parrot.pir

Log:
configure proto-objects so HLLs can instantiate mod_parrot classes


Modified: mod_parrot/trunk/lib/APR/Table.pir
==============================================================================
--- mod_parrot/trunk/lib/APR/Table.pir	(original)
+++ mod_parrot/trunk/lib/APR/Table.pir	Thu Dec 20 14:22:51 2007
@@ -48,6 +48,10 @@
     newclass table_class, [ 'APR'; 'Table' ]
     addattribute table_class, 'apr_table'
 
+    # a proto-object will allow HLLs to create new instances of this class
+    $P0 = get_hll_global 'Protomaker'
+    $P0.'new_proto'(table_class)
+
     dlfunc func, nul, "apr_table_get", "tpt"
     set_root_global [ 'APR'; 'NCI' ], "apr_table_get", func
 

Modified: mod_parrot/trunk/lib/Apache/RequestRec.pir
==============================================================================
--- mod_parrot/trunk/lib/Apache/RequestRec.pir	(original)
+++ mod_parrot/trunk/lib/Apache/RequestRec.pir	Thu Dec 20 14:22:51 2007
@@ -52,6 +52,10 @@
     addattribute rr_class, 'r'
     addattribute rr_class, 'pmc_notes'
 
+    # a proto-object will allow HLLs to create new instances of this class
+    $P0 = get_hll_global 'Protomaker'
+    $P0.'new_proto'(rr_class)
+
     dlfunc func, nul, "ap_rputs", "itp"
     set_root_global [ 'Apache'; 'NCI' ], "ap_rputs", func
 

Modified: mod_parrot/trunk/lib/mod_parrot.pir
==============================================================================
--- mod_parrot/trunk/lib/mod_parrot.pir	(original)
+++ mod_parrot/trunk/lib/mod_parrot.pir	Thu Dec 20 14:22:51 2007
@@ -76,6 +76,7 @@
     set_root_global [ '_modparrot'; 'NCI' ], "csd", func
 
     # load required libraries
+    load_bytecode 'Protoobject.pbc'
     load_bytecode 'Apache/Constants.pbc'
     load_bytecode 'Apache/RequestRec.pbc'
     load_bytecode 'APR/Table.pbc'
@@ -109,4 +110,3 @@
 
     .return(count)
 .end
-
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.