Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 23541 invoked from network); 4 May 2005 18:41:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 May 2005 18:41:25 -0000 Received: (qmail 31533 invoked by uid 500); 4 May 2005 18:43:00 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 31240 invoked by uid 500); 4 May 2005 18:42:55 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 31054 invoked by uid 99); 4 May 2005 18:42:50 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 04 May 2005 11:42:48 -0700 Received: (qmail 96513 invoked by uid 65534); 4 May 2005 17:40:40 -0000 Message-ID: <20050504174040.96511.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r168155 [16/27] - in /httpd/site/trunk: docs/apreq/docs/libapreq2/ xdocs/apreq/docs/libapreq2/ Date: Wed, 04 May 2005 17:40:16 -0000 To: cvs@httpd.apache.org From: joes@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Modified: httpd/site/trunk/xdocs/apreq/docs/libapreq2/apreq__cookie_8h-sour= ce.html URL: http://svn.apache.org/viewcvs/httpd/site/trunk/xdocs/apreq/docs/libapr= eq2/apreq__cookie_8h-source.html?rev=3D168155&r1=3D168154&r2=3D168155&view= =3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/site/trunk/xdocs/apreq/docs/libapreq2/apreq__cookie_8h-source.htm= l (original) +++ httpd/site/trunk/xdocs/apreq/docs/libapreq2/apreq__cookie_8h-source.htm= l Wed May 4 10:40:10 2005 @@ -1,7 +1,7 @@ - libapreq2-2.04-dev: libapreq2: src/apreq_cookie.h Source File</ti= tle>=20 + <title>libapreq2-2.05-dev: libapreq2: include/apreq_cookie.h Source File= =20
@@ -10,10 +10,12 @@ Request Library Subproject<= /p>

Apache HTTP Server Request Library

3D""
- - -

src/apreq_cookie.h

Go to the doc= umentation of this file.
00001 /* -00002 ** Copyright 2003-2004 The Apache Software= Foundation + + + +

apreq_cookie.h

Go to the documen= tation of this file.
000=
01 /*
+00002 **  Copyright 2003-2005  The Apache Software=
 Foundation
 00003 **
 00004 **  Licensed under the Apache License, Versi=
on 2.0 (the "License");
 00005 **  you may not use this file except in comp=
liance with the License.
@@ -32,105 +34,112 @@
 00018 #de=
fine APREQ_COOKIE_H
 00019 
 00020 #include "apreq.h"
-00021 #include "apr_tables.h"
+00021 #include "apr_time.h"
 00022=20
 00023 #ifdef  __cplusplus
 00024 extern "C" {
 00025 #endif 
 00026 
-00044 typedef s=
truct apreq_jar_=
t {
-00045     apr_table_t   *cookies;  =20
-00046     void          *env;      =20
-00047     apr_status_t  status;    =20
-00048 } apreq_jar_t;
-00049=20
-00050=20
-00061 typedef =
enum { APREQ_COOKIE_VERSION_NETSCAPE,=20
-00062                APREQ_COOKIE_VERSION_RFC } apreq_cookie_version_t;
-00063=20
+00047 #define APREQ_COOKIE_MAX_LENGTH    =
        4096
+00048 
+00052 typedef struct apre=
q_cookie_t {
+00053=20
+00054     char           *path;       =20
+00055     char           *domain;     =20
+00056     char           *port;       =20
+00057     char           *comment;    =20
+00058     char           *commentURL; =20
+00059     apr_time_t      max_age;    =20
+00060     unsigned        flags;      =20
+00061     const apreq_value_t   v;    =20
+00063 } apreq_cooki=
e_t;
 00064=20
-00066 #define APREQ_COOKIE_VERSION_DEFAUL=
T       APREQ_COOKIE_VERSION_NETSCAPE
-00067 
-00069 #define APREQ_COOKIE_MAX_LENGTH    =
        4096
-00070 
-00073 typedef struct apre=
q_cookie_t {
-00074=20
-00075     a=
preq_cookie_version_t version;=20
-00077     char           *path;       =20
-00078     char           *domain;     =20
-00079     char           *port;       =20
-00080     unsigned        secure;     =20
-00081     char           *comment;    =20
-00082     char           *commentURL; =20
-00083     apr_time_t      max_age;    =20
-00084     =
apreq_value_t   v;          =20
-00086 } apreq_cooki=
e_t;
-00087=20
+00065=20
+00067 static APR_INLINE
+00068 apreq_coo=
kie_t *apreq_value_=
to_cookie(const char *val)
+00069 {
+00070     union { c=
onst char *in; char *out; } deconst;
+00071=20
+00072     deconst.in =3D val;
+00073     return apreq_attr_to_type(apreq_cookie_t, v,
+00074            apreq_attr_to_type(apreq_value_t, data, deconst.out));
+00075 }
+00076=20
+00078 static APR_INLINE
+00079 unsigned apreq_cookie_version(const a=
preq_cookie_t *c) {
+00080     return APREQ_FLAGS_GET(c->=
flags, APREQ_=
COOKIE_VERSION);
+00081 }
+00082=20
+00084 static APR_INLINE
+00085 void apreq_cookie_version_set(apreq_cookie_t *c, unsigned v) {
+00086     APREQ_FLAGS_SET(c->flags, APREQ_COOKIE_VERSION, v);
+00087 }
 00088=20
-00089 #define apreq_value_to_cookie(ptr) apre=
q_attr_to_type(apreq_cookie_t, \
-00090                                        =
               v, ptr)
-00091 #de=
fine apreq_cookie_name(c)  ((c)->v.name)
-00092 #de=
fine apreq_cookie_value(c) ((c)->v.data)
-00093 
-00094 #define apreq_jar_items(j) apr_table_el=
ts(j->cookies)->nelts
-00095 #de=
fine apreq_jar_nelts(j) apr_table_elts(j->cookies)->nelts
-00096 
-00104 APREQ_DECLARE(apreq_cookie_t *)apreq_cookie(const apreq_jar_t *jar,
-00105                                             const char *name);
-00106=20
-00114 APREQ_DECLARE(void) apreq_jar_add=
(apreq_jar_t *jar,=20
-00115                                      const apreq_cookie_t *c);
-00116=20
-00117 #define apreq_add_cookie(j,c) apreq_jar_add(j,c)
-00118=20
-00135 APREQ_DECLARE(ap=
req_jar_t *) apreq_jar(void *env, co=
nst char *hdr);
-00136=20
-00146 APREQ_DECLARE(apreq_cookie_t *) apreq_cookie_make(apr_pool_t *pool,=20
-00147                                   const =
char *name, const apr_size_t nlen,=20
-00148                                   const =
char *value, const apr_size_t vlen);
-00149=20
-00150 #define apreq_make_cookie(p,n,nl,v,vl) apreq_cookie_make(p,n,nl,v,vl)
-00151=20
-00163 APREQ_DECLARE(apr_status_t)=20
-00164     apreq_cookie_attr(apr_pool_t *p, apreq_cookie_t *c,=20
-00165                       const char =
*attr, apr_size_t=
 alen,
-00166                       const char =
*val, apr_size_t =
vlen);
-00167=20
-00168=20
-00176 APREQ_DECLARE(char*) apreq_cookie=
_as_string(const apr=
eq_cookie_t *c,
-00177                                             apr_pool_t *p);
-00178=20
-00179=20
-00191 APREQ_DECLARE(int) apreq_cookie_s=
erialize(const apreq=
_cookie_t *c,
-00192                                           char *buf, a=
pr_size_t len);
-00193=20
-00194 #define apreq_serialize_cookie(buf,len,c) apreq_cookie_serialize(c,b=
uf,len)
-00195=20
-00207 APREQ_DECLARE(void) apreq_cookie_=
expires(apreq_cookie=
_t *c,=20
-00208                                          const char *time_str);
-00209=20
-00216 APREQ_DECLARE(apr_status_t) apreq_cookie_bake(const apreq_cookie_t *c,
-00217                                               void *env);
-00218=20
-00225 APREQ_DECLARE(apr_status_t) apreq_cookie_bake2(const apreq_cookie_t *c,
-00226                                                void *env);
-00227=20
-00235 APREQ_DECLARE(apreq_cookie_version_t) apreq_ua_cookie_version(void *env);
-00236=20
-00237 #ifdef __cplusplus
-00238  }
-00239 #endif
-00240=20
-00241 #endif /*APREQ_COOKIE_H*/
-00242=20
-00243=20
-
+00090 static APR_INLINE +00091 unsigned apreq_cookie_is_secure(const apreq_cookie_t *c) { +00092 return APREQ_FLAGS_GET(c->= flags, APREQ_= COOKIE_SECURE); +00093 } +00094=20 +00098 static APR_INLINE +00099 void apreq_cookie_secure_on(apreq_cookie_t *c) { +00100 APREQ_FLAGS_ON(c->flags, APREQ_COOKIE_SECURE); +00101 } +00102=20 +00104 static APR_INLINE +00105 void apreq_cookie_secure_off(apreq_cookie_t *c) { +00106 APREQ_FLAGS_OFF(c->flags, APREQ_COOKIE_SECURE); +00107 } +00108=20 +00109=20 +00111 static APR_INLINE +00112 unsigned apreq_cookie_is_tainted(const apreq_cookie_t *c) { +00113 return APREQ_FLAGS_GET(c->= flags, APREQ_= TAINTED); +00114 } +00115=20 +00117 static APR_INLINE +00118 void apreq_cookie_tainted_on(apreq_cookie_t *c) { +00119 APREQ_FLAGS_ON(c->flags, APREQ_TAINTED); +00120 } +00121=20 +00123 static APR_INLINE +00124 void apreq_cookie_tainted_off(apreq_cookie_t *c) { +00125 APREQ_FLAGS_OFF(c->flags, APREQ_TAINTED); +00126 } +00127=20 +00143 APREQ_DECLARE(apr_status_t) apreq_parse_cookie_header(apr_pool_t *pool, +00144 apr_table_t *jar, +00145 const char *header); +00146=20 +00158 APREQ_DECLARE(apreq_cookie_t *) apreq_cookie_make(apr_pool_t *pool,=20 +00159 const char *name, +00160 const apr_size_t nlen= ,=20 +00161 const char *value, +00162 const apr_size_t vlen= ); +00163=20 +00173 APREQ_DECLARE(char*) apreq_cookie_as_string(const <= a class=3D"code" href=3D"structapreq__cookie__t.html">apreq_cookie_t *c, +00174 apr_pool_t *p); +00175=20 +00176=20 +00189 APREQ_DECLARE(int) apreq_cookie_serialize(const apreq_cookie_t *c, +00190 char *buf, apr_size_t len); +00191=20 +00206 APREQ_DECLARE(void) apreq_cookie_expires(apreq_cookie_t *c,=20 +00207 const char *time_str); +00208=20 +00209 #ifdef __cplusplus +00210 } +00211 #endif +00212=20 +00213 #endif /*APREQ_COOKIE_H*/ +00214=20 +00215=20 +

-Copyright © 2003-2004 The Apache So= ftware Foundation.
-See LICENSE.

+Copyright © 2003-2005 The Apache So= ftware Foundation.
+See LICENSE.

page generated by doxygen -version 1.3.8 on 30 Aug 2004 +version 1.4.2 on 4 May 2005