jimw 00/12/22 18:56:54
Modified: Request Request.pm
Cookie Cookie.pm
. libapreq.pod
Log:
use =head2 instead of =item as matt suggested so html version has
a more useful table-of-contents.
Revision Changes Path
1.11 +12 -12 httpd-apreq/Request/Request.pm
Index: Request.pm
===================================================================
RCS file: /home/cvs/httpd-apreq/Request/Request.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Request.pm 2000/12/23 02:40:52 1.10
+++ Request.pm 2000/12/23 02:56:53 1.11
@@ -60,7 +60,7 @@
=over 4
-=item new
+=head2 new
Create a new I<Apache::Request> object with an I<Apache> request_rec object:
@@ -102,7 +102,7 @@
=back
-=item instance
+=head2 instance
The instance() class method allows Apache::Request to be a singleton.
This means that whenever you call Apache::Request->instance() within a
@@ -128,7 +128,7 @@
C<instance()> because you may end up trying to call it twice, and
detecting errors where there are none.
-=item parse
+=head2 parse
The I<parse> method does the actual work of parsing the request.
It is called for you by the accessor methods, so it is not required but
@@ -144,7 +144,7 @@
return $status;
}
-=item param
+=head2 param
Get or set request parameters:
@@ -153,7 +153,7 @@
my @params = $apr->param;
$apr->param('foo' => [qw(one two three)]);
-=item upload
+=head2 upload
Returns a single I<Apache::Upload> object in a scalar context or
all I<Apache::Upload> objects in an array context:
@@ -177,19 +177,19 @@
=over 4
-=item name
+=head2 name
The name of the filefield parameter:
my $name = $upload->name;
-=item filename
+=head2 filename
The filename of the uploaded file:
my $filename = $upload->filename;
-=item fh
+=head2 fh
The filehandle pointing to the uploaded file:
@@ -198,13 +198,13 @@
...
}
-=item size
+=head2 size
The size of the file in bytes:
my $size = $upload->size;
-=item info
+=head2 info
The additional header information for the uploaded file.
Returns a hash reference tied to the I<Apache::Table> class.
@@ -218,7 +218,7 @@
my $val = $upload->info("Content-type");
-=item type
+=head2 type
Returns the I<Content-Type> for the given I<Apache::Upload> object:
@@ -226,7 +226,7 @@
#same as
my $type = $upload->info("Content-Type");
-=item next
+=head2 next
As an alternative to using the I<Apache::Request> I<upload> method in
an array context:
1.3 +11 -11 httpd-apreq/Cookie/Cookie.pm
Index: Cookie.pm
===================================================================
RCS file: /home/cvs/httpd-apreq/Cookie/Cookie.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Cookie.pm 2000/03/30 04:52:53 1.2
+++ Cookie.pm 2000/12/23 02:56:53 1.3
@@ -36,7 +36,7 @@
=over 4
-=item new
+=head2 new
Just like CGI::Cookie::new, but requires an I<Apache> request object:
@@ -49,14 +49,14 @@
-secure => 1
);
-=item bake
+=head2 bake
Put cookie in the oven to bake.
(Add a I<Set-Cookie> header to the outgoing headers table.)
$cookie->bake;
-=item parse
+=head2 parse
This method parses the given string if present, otherwise, the incoming
I<Cookie> header:
@@ -67,7 +67,7 @@
my %cookies = $cookie->parse($cookie_string);
-=item fetch
+=head2 fetch
Fetch and parse the incoming I<Cookie> header:
@@ -75,14 +75,14 @@
my %cookies = Apache::Cookie->fetch;
-=item as_string
+=head2 as_string
Format the cookie object as a string:
#same as $cookie->bake
$r->err_headers_out->add("Set-Cookie" => $cookie->as_string);
-=item name
+=head2 name
Get or set the name of the cookie:
@@ -90,7 +90,7 @@
$cookie->name("Foo");
-=item value
+=head2 value
Get or set the values of the cookie:
@@ -100,28 +100,28 @@
$cookie->value("string");
$cookie->value([EMAIL PROTECTED]);
-=item domain
+=head2 domain
Get or set the domain for the cookie:
my $domain = $cookie->domain;
$cookie->domain(".cp.net");
-=item path
+=head2 path
Get or set the path for the cookie:
my $path = $cookie->path;
$cookie->path("/");
-=item expires
+=head2 expires
Get or set the expire time for the cookie:
my $expires = $cookie->expires;
$cookie->expires("+3h");
-=item secure
+=head2 secure
Get or set the secure flag for the cookie:
1.3 +57 -57 httpd-apreq/libapreq.pod
Index: libapreq.pod
===================================================================
RCS file: /home/cvs/httpd-apreq/libapreq.pod,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- libapreq.pod 2000/03/30 05:03:29 1.2
+++ libapreq.pod 2000/12/23 02:56:53 1.3
@@ -10,42 +10,6 @@
=over 4
-=item ApacheRequest *ApacheRequest_new (request_rec *r)
-
-This function creates a new I<ApacheRequest> object using the given
-I<request_rec> structure:
-
- ApacheRequest *req = ApacheRequest_new(r);
-
-=item int ApacheRequest_parse (ApacheRequest *req)
-
-If the request method is B<GET> or B<POST>, the query string
-arguments and the client form data will be read, parsed and saved.
-In addition, if the request method is B<POST> and the I<Content-type> is
-I<multipart/form-data>, the uploaded files will be written to
-temporary files which can be accessed with the I<upload> field names.
-The return value is B<OK> on success, otherwise an error code that
-your handler should return.
-
-=item const char *ApacheRequest_param (ApacheRequest *req, const char *key)
-
-This function will return the value of the given parameter I<key>:
-
- const char *value = ApacheRequest_param(req, "Key");
-
-=item array_header *ApacheRequest_params (ApacheRequest *req, const char
*key)
-
-This function will return an I<array_header> of values for the given
-parameter I<key>:
-
- array_header *values = ApacheRequest_params(req, "Key");
-
-=item char *ApacheRequest_params_as_string (ApacheRequest *req, const char
*key)
-
-This function will format multi-value parmeters into a comma delimited
string.
-
- char *list = ApacheRequest_params_as_string(req, "Key");
-
=item req->parms
This field is an Apache I<table> that holds the parsed contents of
@@ -84,17 +48,53 @@
...
return status;
}
+
+=back
+
+=head2 ApacheRequest *ApacheRequest_new (request_rec *r)
+
+This function creates a new I<ApacheRequest> object using the given
+I<request_rec> structure:
+
+ ApacheRequest *req = ApacheRequest_new(r);
+
+=head2 int ApacheRequest_parse (ApacheRequest *req)
+
+If the request method is B<GET> or B<POST>, the query string
+arguments and the client form data will be read, parsed and saved.
+In addition, if the request method is B<POST> and the I<Content-type> is
+I<multipart/form-data>, the uploaded files will be written to
+temporary files which can be accessed with the I<upload> field names.
+The return value is B<OK> on success, otherwise an error code that
+your handler should return.
+
+=head2 const char *ApacheRequest_param (ApacheRequest *req, const char *key)
+
+This function will return the value of the given parameter I<key>:
+
+ const char *value = ApacheRequest_param(req, "Key");
-=item ApacheUpload *upload = ApacheRequest_upload (ApacheRequest *req)
+=head2 array_header *ApacheRequest_params (ApacheRequest *req, const char
*key)
+This function will return an I<array_header> of values for the given
+parameter I<key>:
+
+ array_header *values = ApacheRequest_params(req, "Key");
+
+=head2 char *ApacheRequest_params_as_string (ApacheRequest *req, const char
*key)
+
+This function will format multi-value parmeters into a comma delimited
string.
+
+ char *list = ApacheRequest_params_as_string(req, "Key");
+
+=head2 ApacheUpload *upload = ApacheRequest_upload (ApacheRequest *req)
+
If the request I<Content-type> was that of I<multipart/form-data>,
this will return an I<ApacheUpload> pointer containing the upload data,
- B<NULL> otherwise. See I<ApacheUpload>.
+B<NULL> otherwise. See I<ApacheUpload>.
ApacheUpload *upload = ApacheRequest_upload(req);
-=back
-
=head1 ApacheUpload
The I<ApacheUpload> structure holds all information for all uploaded
@@ -146,32 +146,32 @@
...
}
-=item ApacheUpload *ApacheUpload_find (ApacheUpload *upload, char *name)
+=back
+
+=head2 ApacheUpload *ApacheUpload_find (ApacheUpload *upload, char *name)
Returns the I<ApacheUpload> pointer associated with I<name> or
B<NULL> if I<name> is not found in the list:
ApacheUpload *upload = ApacheUpload_find(upload, name);
-=item const char *ApacheUpload_info (ApacheUpload *upload, char *key)
+=head2 const char *ApacheUpload_info (ApacheUpload *upload, char *key)
Shortcut for accessing the I<info> table:
const char *type = ApacheUpload_info(upload, "Content-Type");
-=item const char *ApacheUpload_type (ApacheUpload *upload)
+=head2 const char *ApacheUpload_type (ApacheUpload *upload)
Shortcut for accessing the uploaded file I<Content-Type>:
const char *type = ApacheUpload_type(upload);
-=back
-
=head1 ApacheCookie
=over 4
-=item ApacheCookie *ApacheCookie_new (request_rec *r, ...)
+=head2 ApacheCookie *ApacheCookie_new (request_rec *r, ...)
This function creates a new I<ApacheCookie> object, using the given
I<request_request> and optional attribute arguments which are as follows:
@@ -222,7 +222,7 @@
NULL);
-=item char *ApacheCookie_attr (ApacheCookie *c, char *key, char *val)
+=head2 char *ApacheCookie_attr (ApacheCookie *c, char *key, char *val)
This function is used to get or set a cookie attribute pair, accepting
the same attributes as the list above. Example:
@@ -230,7 +230,7 @@
char *name = ApacheCookie_attr(c, "-name"); /* same as c->name */
(void *)ApacheCookie_attr(c, "-expires", "+3h");
-=item ApacheCookieJar *ApacheCookie_parse (request_rec *r, const char *data)
+=head2 ApacheCookieJar *ApacheCookie_parse (request_rec *r, const char
*data)
This function parses the given I<data> string or the incoming
I<Cookie> header, returning an I<ApacheCookieJar> of I<ApacheCookie>
@@ -250,31 +250,31 @@
}
}
-=item int ApacheCookieItems (ApacheCookie *c)
+=head2 int ApacheCookieItems (ApacheCookie *c)
The number of values for the given cookie.
-=item char *ApacheCookieFetch (ApacheCookie *c, int n)
+=head2 char *ApacheCookieFetch (ApacheCookie *c, int n)
The I<n>th value for the given cookie.
-=item void ApacheCookieAdd (ApacheCookie *c, char *value)
+=head2 void ApacheCookieAdd (ApacheCookie *c, char *value)
Add a new value to the cookie.
-=item int ApacheCookieJarItems (ApacheCookieJar *cookies)
+=head2 int ApacheCookieJarItems (ApacheCookieJar *cookies)
The number of cookies in the given cookie jar.
-=item ApacheCookie *ApacheCookieJarFetch (ApacheCookieJar *cookies, int n)
+=head2 ApacheCookie *ApacheCookieJarFetch (ApacheCookieJar *cookies, int n)
The I<n>th cookie in the given cookie jar.
-=item void ApacheCookieJarAdd (ApacheCookieJar *cookies, ApacheCookie *c)
+=head2 void ApacheCookieJarAdd (ApacheCookieJar *cookies, ApacheCookie *c)
Add a new cookie to the cookie jar.
-=item char *ApacheCookie_expires (ApacheCookie *c, char *time_str)
+=head2 char *ApacheCookie_expires (ApacheCookie *c, char *time_str)
This function gets or sets the expiration date for cookie.
The following forms are all valid for the I<time_str> parmeter:
@@ -288,14 +288,14 @@
+10y in ten years time
Thursday, 25-Apr-1999 00:40:33 GMT at the indicated time & date
-=item void ApacheCookie_bake (ApacheCookie *c)
+=head2 void ApacheCookie_bake (ApacheCookie *c)
Put cookie in the oven to bake.
(Add a I<Set-Cookie> header to the outgoing headers table.)
ApacheCookie_bake(c);
-=item char *ApacheCookie_as_string (ApacheCookie *c)
+=head2 char *ApacheCookie_as_string (ApacheCookie *c)
Returns a string version of the cookie: