| Newsgroups |
perl.cvs.mod_parrot |
| Message-ID |
<[email protected]> |
cvsuser 02/05/29 10:28:50
Modified: . apache.ops
eg demo2.pasm
Log:
add the other two ops which exist in apache.pmc
update demo2.pasm to show the shiny new syntax
Revision Changes Path
1.3 +15 -0 mod_parrot/apache.ops
Index: apache.ops
===================================================================
RCS file: /cvs/public/mod_parrot/apache.ops,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- apache.ops 29 May 2002 16:20:21 -0000 1.2
+++ apache.ops 29 May 2002 17:28:47 -0000 1.3
@@ -8,3 +8,18 @@
goto NEXT();
}
+op get_args (out STR, in PMC) {
+ KEY *key = key_new(interpreter);
+ key->atom.type = enum_key_string;
+ key->atom.val.string_val = string_make(interpreter,"get",3,NULL,0,NULL);
+ $1 = ($2->vtable->get_string_keyed)(interpreter, $2, key);
+ goto NEXT();
+}
+
+op get_remoteip (out STR, in PMC) {
+ KEY *key = key_new(interpreter);
+ key->atom.type = enum_key_string;
+ key->atom.val.string_val = string_make(interpreter,"remote_ip",9,NULL,0,NULL);
+ $1 = ($2->vtable->get_string_keyed)(interpreter, $2, key);
+ goto NEXT();
+}
1.3 +4 -4 mod_parrot/eg/demo2.pasm
Index: demo2.pasm
===================================================================
RCS file: /cvs/public/mod_parrot/eg/demo2.pasm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- demo2.pasm 28 May 2002 18:17:28 -0000 1.2
+++ demo2.pasm 29 May 2002 17:28:50 -0000 1.3
@@ -1,8 +1,8 @@
new P0,Apache
- get_keyed S0,P0,"get"
+ get_args S0,P0
concat S0, "you passed me ", S0
- set_keyed P0,"print",S0
- get_keyed S0,P0,"remote_ip"
+ ap_print P0,S0
+ get_remoteip S0,P0
concat S0, "Hello there at ", S0
- set_keyed P0,"print",S0
+ ap_print P0,S0
end