Author: jhorwitz
Date: Fri Jul 27 12:12:48 2007
New Revision: 224
Removed:
mod_parrot/trunk/t/99mod_pugs.t
Modified:
mod_parrot/trunk/build/lib/Generator/ApacheRequestRec.pm
mod_parrot/trunk/call_list.txt
mod_parrot/trunk/lib/APR/Table.pir
mod_parrot/trunk/lib/Apache/RequestRec.pir
mod_parrot/trunk/lib/ModParrot/HLL/pir.pir
mod_parrot/trunk/src/parrot_util.c
mod_parrot/trunk/t/00nci.t
mod_parrot/trunk/t/01RequestRec.t
Log:
first pass at updating for latest parrot trunk
Modified: mod_parrot/trunk/build/lib/Generator/ApacheRequestRec.pm
==============================================================================
--- mod_parrot/trunk/build/lib/Generator/ApacheRequestRec.pm (original)
+++ mod_parrot/trunk/build/lib/Generator/ApacheRequestRec.pm Fri Jul 27 12:12:48 2007
@@ -47,7 +47,7 @@
$record->{'pir_type'} = 'int';
}
else {
- $record->{'sig'} = 'tJpt';
+ $record->{'sig'} = 'tJpti';
$record->{'pir_type'} = 'string';
}
}
@@ -129,7 +129,7 @@
if ($self->{calling_conventions} eq 'new') {
$template = <<'END'
-.sub %%NAME%% method
+.sub %%NAME%% :method
.param int data :optional
.param int update_r :opt_flag
.local pmc r
@@ -153,7 +153,7 @@
}
else {
$template = <<'END'
-.sub %%NAME%% method
+.sub %%NAME%% :method
.param int data
.local pmc r
.local int offset
@@ -189,8 +189,9 @@
my $self = shift;
my $template = <<'END'
-.sub %%NAME%% method
- .param %%PIR_TYPE%% data
+.sub %%NAME%% :method
+ .param %%PIR_TYPE%% data :optional
+ .param int update_r :opt_flag
.local pmc r
.local int offset
.local pmc request_rec_%%NAME%%
@@ -199,8 +200,12 @@
classoffset offset, self, 'Apache::RequestRec'
getattribute r, self, offset
+ if update_r goto call_it
+ data = ""
+
+call_it:
find_global request_rec_%%NAME%%, 'ModParrot::NCI', 'request_rec_%%NAME%%'
- %%NAME%% = request_rec_%%NAME%%( r , data )
+ %%NAME%% = request_rec_%%NAME%%( r , data, update_r )
.pcc_begin_return
.return %%NAME%%
@@ -257,9 +262,9 @@
my $self = shift;
my $template = <<'END'
-%%RETURN_TYPE%%mpnci_request_rec_%%NAME%%(Parrot_Interp interp, request_rec *r, char *%%NAME%%)
+%%RETURN_TYPE%%mpnci_request_rec_%%NAME%%(Parrot_Interp interp, request_rec *r, char *%%NAME%%, int update_r)
{
- if (%%NAME%%) {
+ if (update_r == 1) {
r->%%NAME%% = (char *)apr_pstrdup(r->pool, %%NAME%%);
}
return r->%%NAME%%;
Modified: mod_parrot/trunk/call_list.txt
==============================================================================
--- mod_parrot/trunk/call_list.txt (original)
+++ mod_parrot/trunk/call_list.txt Fri Jul 27 12:12:48 2007
@@ -10,6 +10,7 @@
t Jp
p Jp
t Jpt
+t Jpti
i Jp
i Jpi
i JPip
Modified: mod_parrot/trunk/lib/APR/Table.pir
==============================================================================
--- mod_parrot/trunk/lib/APR/Table.pir (original)
+++ mod_parrot/trunk/lib/APR/Table.pir Fri Jul 27 12:12:48 2007
@@ -54,11 +54,13 @@
store_global "APR::NCI", "apr_table_set", func
.end
-.sub __init method
+.sub init :vtable :method
.param pmc t
.local int offset
+ # why was this here? $I0 isn't used!
$I0 = find_type 'APR::Table'
+
classoffset offset, self, 'APR::Table'
setattribute self, offset, t
.end
@@ -73,7 +75,7 @@
=cut
-.sub get method
+.sub get :method
.param string key
.local pmc t
.local pmc apr_table_get
@@ -100,7 +102,7 @@
=cut
-.sub set method
+.sub set :method
.param string key
.param string val
.local pmc t
Modified: mod_parrot/trunk/lib/Apache/RequestRec.pir
==============================================================================
--- mod_parrot/trunk/lib/Apache/RequestRec.pir (original)
+++ mod_parrot/trunk/lib/Apache/RequestRec.pir Fri Jul 27 12:12:48 2007
@@ -77,8 +77,9 @@
store_global "Apache::NCI", "ap_custom_response", func
.end
-.sub __init method
- .param pmc new_r
+#.sub __init :method
+.sub init :vtable :method
+ .param pmc new_r :optional
.local pmc request_rec
.local pmc r
.local int offset
@@ -106,7 +107,7 @@
=cut
-.sub puts method
+.sub puts :method
.param string data
.local pmc r
.local pmc ap_rputs
@@ -128,7 +129,7 @@
=cut
-.sub putc method
+.sub putc :method
.param int data
.local pmc r
.local pmc ap_rputc
@@ -153,7 +154,7 @@
=cut
-.sub write method
+.sub write :method
.param pmc data
.param int size
.local pmc r
@@ -181,7 +182,7 @@
=cut
-.sub filename method
+.sub filename :method
.param string f
.local pmc r
.local pmc request_rec_filename
@@ -212,7 +213,7 @@
=cut
-.sub log_rerror method
+.sub log_rerror :method
.param string file
.param int line
.param int level
@@ -239,7 +240,7 @@
=cut
-.sub get_basic_auth_pw method
+.sub get_basic_auth_pw :method
.local pmc r
.local int offset
.local pmc request_rec_get_basic_auth_pw
@@ -270,7 +271,7 @@
=cut
-.sub is_initial_req method
+.sub is_initial_req :method
.local pmc r
.local int offset
.local pmc ap_is_initial_req
@@ -296,7 +297,7 @@
=cut
-.sub auth_name method
+.sub auth_name :method
.local pmc r
.local int offset
.local pmc ap_auth_name
@@ -323,7 +324,7 @@
=cut
-.sub note_basic_auth_failure method
+.sub note_basic_auth_failure :method
.local pmc r
.local int offset
.local pmc ap_note_basic_auth_failure
@@ -345,7 +346,7 @@
=cut
-.sub auth_type method
+.sub auth_type :method
.local pmc r
.local int offset
.local pmc ap_auth_type
@@ -371,7 +372,7 @@
=cut
-.sub notes method
+.sub notes :method
.local pmc r
.local pmc notes
.local pmc t
@@ -384,8 +385,7 @@
find_global request_rec_notes, 'ModParrot::NCI', 'request_rec_notes'
notes = request_rec_notes( r )
- find_type $I0, 'APR::Table'
- t = new $I0, notes
+ t = new 'APR::Table', notes
.pcc_begin_return
.return t
@@ -402,7 +402,7 @@
=cut
-.sub main method
+.sub main :method
.local pmc r
.local pmc main_r
.local pmc request_rec_main
@@ -429,7 +429,7 @@
=cut
-.sub next method
+.sub next :method
.local pmc r
.local pmc next_r
.local pmc request_rec_next
@@ -456,7 +456,7 @@
=cut
-.sub prev method
+.sub prev :method
.local pmc r
.local pmc prev_r
.local pmc request_rec_prev
@@ -467,8 +467,7 @@
find_global request_rec_prev, 'ModParrot::NCI', 'request_rec_prev'
$P0 = request_rec_prev( r )
- $I0 = find_type 'Apache::RequestRec'
- prev_r = new $I0, $P0
+ prev_r = new 'Apache::RequestRec', $P0
.pcc_begin_return
.return prev_r
@@ -486,7 +485,7 @@
=cut
-.sub custom_response method
+.sub custom_response :method
.param int status
.param string response
.local pmc r
Modified: mod_parrot/trunk/lib/ModParrot/HLL/pir.pir
==============================================================================
--- mod_parrot/trunk/lib/ModParrot/HLL/pir.pir (original)
+++ mod_parrot/trunk/lib/ModParrot/HLL/pir.pir Fri Jul 27 12:12:48 2007
@@ -31,8 +31,7 @@
.local int status
# get the request_rec object
- find_type $I0, 'Apache::RequestRec'
- r = new $I0
+ r = new 'Apache::RequestRec'
# find the handler sub and call it
find_global handler, handler_name, '_handler'
@@ -52,8 +51,7 @@
.local int status
# get the request_rec object
- find_type $I0, 'Apache::RequestRec'
- r = new $I0
+ r = new 'Apache::RequestRec'
# find the handler sub and call it
find_global handler, handler_name, '_handler'
@@ -73,8 +71,7 @@
.local int status
# get the request_rec object
- find_type $I0, 'Apache::RequestRec'
- r = new $I0
+ r = new 'Apache::RequestRec'
# find the handler sub and call it
find_global handler, handler_name, '_handler'
@@ -94,8 +91,7 @@
.local int status
# get the request_rec object
- find_type $I0, 'Apache::RequestRec'
- r = new $I0
+ r = new 'Apache::RequestRec'
# find the handler sub and call it
find_global handler, handler_name, '_handler'
@@ -258,8 +254,7 @@
.local int status
# get the request_rec object
- find_type $I0, 'Apache::RequestRec'
- r = new $I0
+ r = new 'Apache::RequestRec'
# find the handler sub and call it
find_global handler, handler_name, '_handler'
@@ -280,8 +275,7 @@
.local int status
# get the request_rec object
- find_type $I0, 'Apache::RequestRec'
- r = new $I0
+ r = new 'Apache::RequestRec'
# find the handler sub and call it
find_global handler, handler_name, '_handler'
@@ -302,8 +296,7 @@
.local int status
# get the request_rec object
- find_type $I0, 'Apache::RequestRec'
- r = new $I0
+ r = new 'Apache::RequestRec'
# find the handler sub and call it
find_global handler, handler_name, '_handler'
@@ -324,7 +317,7 @@
.local int status
# get the request_rec object
- find_type $I0, 'Apache::RequestRec'
+ r = new 'Apache::RequestRec'
r = new $I0
# find the handler sub and call it
@@ -346,8 +339,7 @@
.local int status
# get the request_rec object
- find_type $I0, 'Apache::RequestRec'
- r = new $I0
+ r = new 'Apache::RequestRec'
# find the handler sub and call it
find_global handler, handler_name, '_handler'
@@ -368,8 +360,7 @@
.local int status
# get the request_rec object
- find_type $I0, 'Apache::RequestRec'
- r = new $I0
+ r = new 'Apache::RequestRec'
# find the handler sub and call it
find_global handler, handler_name, '_handler'
@@ -389,8 +380,7 @@
.local int status
# get the request_rec object
- find_type $I0, 'Apache::RequestRec'
- r = new $I0
+ r = new 'Apache::RequestRec'
# find the handler sub and call it
find_global handler, handler_name, '_handler'
Modified: mod_parrot/trunk/src/parrot_util.c
==============================================================================
--- mod_parrot/trunk/src/parrot_util.c (original)
+++ mod_parrot/trunk/src/parrot_util.c Fri Jul 27 12:12:48 2007
@@ -43,13 +43,18 @@
struct PackFile_Segment *seg;
interp = Parrot_new(NULL);
+#if 0
Parrot_init(interp);
+#endif
imcc_init(interp);
+#if 0
pf = PackFile_new(interp, 0);
seg = PackFile_Segment_new_seg(interp, &pf->directory, PF_BYTEC_SEG,
"mod_parrot_code", 1);
pf->cur_cs = (struct PackFile_ByteCode *)seg;
Parrot_loadbc(interp, pf);
+#endif
+ pf = PackFile_new_dummy(interp, "mod_parrot_code");
return(interp);
}
Modified: mod_parrot/trunk/t/00nci.t
==============================================================================
--- mod_parrot/trunk/t/00nci.t (original)
+++ mod_parrot/trunk/t/00nci.t Fri Jul 27 12:12:48 2007
@@ -8,8 +8,8 @@
my @bad;
# test each signature
-#plan tests => $#sigs+1;
-plan skip_all => 'NCI signature tests are broken';
+plan tests => $#sigs+1;
+#plan skip_all => 'NCI signature tests are broken';
foreach my $sig (@sigs) {
$sig =~ s/\s//g;
if (system('./t/src/nci_sig_test', $sig)) {
Modified: mod_parrot/trunk/t/01RequestRec.t
==============================================================================
--- mod_parrot/trunk/t/01RequestRec.t (original)
+++ mod_parrot/trunk/t/01RequestRec.t Fri Jul 27 12:12:48 2007
@@ -32,7 +32,7 @@
# Apache::RequestRec->hostname
$res = GET '/parrot-test/RequestRec-hostname';
chomp($content = $res->content);
-like($content, qr/^localhost/, 'verify hostname');
+like($content, qr/^[\w\d\-_]+(?:\.[\w\d\-_]+)*$/, 'verify hostname');
# Apache::RequestRec->notes
$res = GET '/parrot-test/RequestRec-notes';
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.