dougm       01/09/28 06:51:57

  Modified:    lib/Apache compat.pm
               todo     api.txt
  Log:
  add $r->header_(in/out)() to Apache::compat
  Submitted by: Philippe M . Chiasson <[EMAIL PROTECTED]>
  Reviewed by:  dougm
  
  Revision  Changes    Path
  1.13      +29 -0     modperl-2.0/lib/Apache/compat.pm
  
  Index: compat.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- compat.pm 2001/09/15 17:57:25     1.12
  +++ compat.pm 2001/09/28 13:51:57     1.13
  @@ -57,6 +57,35 @@
   
   package Apache::RequestRec;
   
  +sub table_set_get {
  +    my($r, $table) = (shift, shift);
  +    my($key, $value) = @_;
  +
  +    if (1 == @_) {
  +        return $table->{$key};
  +    }
  +    elsif (2 == @_) {
  +        return $table->{$key} = $value;
  +    }
  +    elsif (0 == @_) {
  +        return $table;
  +    }
  +    else {
  +        my $name = (caller(1))[3];
  +        warn "Usage: $name([key [,val]])";
  +    }
  +}
  +
  +sub header_out {
  +    my $r = shift;
  +    return $r->table_set_get(scalar $r->headers_out, @_);
  +}
  +
  +sub header_in {
  +    my $r = shift;
  +    return $r->table_set_get(scalar $r->headers_in, @_);
  +}
  +
   sub register_cleanup {
       shift->pool->cleanup_register(@_);
   }
  
  
  
  1.6       +0 -3      modperl-2.0/todo/api.txt
  
  Index: api.txt
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/todo/api.txt,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- api.txt   2001/09/25 19:44:03     1.5
  +++ api.txt   2001/09/28 13:51:57     1.6
  @@ -9,9 +9,6 @@
   need apr_finfo_t <-> struct stat conversion (might already be there,
   haven't looked close enough yet)
   
  -$r->header_{in,out}:
  -deprecated, but should be included in Apache::compat
  -
   $r->pnotes:
   not yet implemented
   
  
  
  


Reply via email to