File: apreq__cookie_8h-source.html

package info (click to toggle)
libapreq2-perl 2.04-dev-1sarge2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,700 kB
  • ctags: 1,508
  • sloc: sh: 8,103; ansic: 5,557; perl: 2,842; cpp: 1,052; makefile: 234
file content (137 lines) | stat: -rw-r--r-- 13,100 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<html>
<head>
  <link rel="stylesheet" type="text/css" href="dox.css" />
  <title>libapreq2-2.04-dev: libapreq2: src/apreq_cookie.h Source File</title> 
</head>
<body>
<div id="page-header">
<p class="menu">
   <a href="http://www.apache.org/">Apache Software Foundation</a> &gt; <a href="http://httpd.apache.org">HTTP Server Project</a> &gt;
<a href="http://httpd.apache.org/apreq/">Request Library Subproject</a></p>
<p class="apache">Apache HTTP Server Request Library</p>
<img alt="" src="feather.gif" /></div>
<!-- Generated by Doxygen 1.3.8 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>src/apreq_cookie.h</h1><a href="apreq__cookie_8h.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="comment">/*</span>
00002 <span class="comment">**  Copyright 2003-2004  The Apache Software Foundation</span>
00003 <span class="comment">**</span>
00004 <span class="comment">**  Licensed under the Apache License, Version 2.0 (the "License");</span>
00005 <span class="comment">**  you may not use this file except in compliance with the License.</span>
00006 <span class="comment">**  You may obtain a copy of the License at</span>
00007 <span class="comment">**</span>
00008 <span class="comment">**      http://www.apache.org/licenses/LICENSE-2.0</span>
00009 <span class="comment">**</span>
00010 <span class="comment">**  Unless required by applicable law or agreed to in writing, software</span>
00011 <span class="comment">**  distributed under the License is distributed on an "AS IS" BASIS,</span>
00012 <span class="comment">**  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
00013 <span class="comment">**  See the License for the specific language governing permissions and</span>
00014 <span class="comment">**  limitations under the License.</span>
00015 <span class="comment">*/</span>
00016 
00017 <span class="preprocessor">#ifndef APREQ_COOKIE_H</span>
00018 <span class="preprocessor"></span><span class="preprocessor">#define APREQ_COOKIE_H</span>
00019 <span class="preprocessor"></span>
00020 <span class="preprocessor">#include "<a class="code" href="apreq_8h.html">apreq.h</a>"</span>
00021 <span class="preprocessor">#include "<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__tables_8h.html">apr_tables.h</a>"</span>
00022 
00023 <span class="preprocessor">#ifdef  __cplusplus</span>
00024 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
00025 <span class="preprocessor">#endif </span>
00026 <span class="preprocessor"></span>
<a name="l00044"></a><a class="code" href="structapreq__jar__t.html">00044</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapreq__jar__t.html">apreq_jar_t</a> {
<a name="l00045"></a><a class="code" href="structapreq__jar__t.html#o0">00045</a>     <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__tables_8h.html#ga0">apr_table_t</a>   *<a class="code" href="structapreq__jar__t.html#o0">cookies</a>;   
<a name="l00046"></a><a class="code" href="structapreq__jar__t.html#o1">00046</a>     <span class="keywordtype">void</span>          *<a class="code" href="structapreq__jar__t.html#o1">env</a>;       
<a name="l00047"></a><a class="code" href="structapreq__jar__t.html#o2">00047</a>     <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a>  <a class="code" href="structapreq__jar__t.html#o2">status</a>;     
00048 } <a class="code" href="structapreq__jar__t.html">apreq_jar_t</a>;
00049 
00050 
<a name="l00061"></a><a class="code" href="apreq__cookie_8h.html#a25">00061</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { APREQ_COOKIE_VERSION_NETSCAPE, 
00062                APREQ_COOKIE_VERSION_RFC } <a class="code" href="apreq__cookie_8h.html#a25">apreq_cookie_version_t</a>;
00063 
00064 
<a name="l00066"></a><a class="code" href="apreq__cookie_8h.html#a0">00066</a> <span class="preprocessor">#define APREQ_COOKIE_VERSION_DEFAULT       APREQ_COOKIE_VERSION_NETSCAPE</span>
00067 <span class="preprocessor"></span>
<a name="l00069"></a><a class="code" href="apreq__cookie_8h.html#a1">00069</a> <span class="preprocessor">#define APREQ_COOKIE_MAX_LENGTH            4096</span>
00070 <span class="preprocessor"></span>
<a name="l00073"></a><a class="code" href="structapreq__cookie__t.html">00073</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapreq__cookie__t.html">apreq_cookie_t</a> {
00074 
<a name="l00075"></a><a class="code" href="structapreq__cookie__t.html#o0">00075</a>     <a class="code" href="apreq__cookie_8h.html#a25">apreq_cookie_version_t</a> <a class="code" href="structapreq__cookie__t.html#o0">version</a>; 
<a name="l00077"></a><a class="code" href="structapreq__cookie__t.html#o1">00077</a>     <span class="keywordtype">char</span>           *<a class="code" href="structapreq__cookie__t.html#o1">path</a>;        
<a name="l00078"></a><a class="code" href="structapreq__cookie__t.html#o2">00078</a>     <span class="keywordtype">char</span>           *<a class="code" href="structapreq__cookie__t.html#o2">domain</a>;      
<a name="l00079"></a><a class="code" href="structapreq__cookie__t.html#o3">00079</a>     <span class="keywordtype">char</span>           *<a class="code" href="structapreq__cookie__t.html#o3">port</a>;        
<a name="l00080"></a><a class="code" href="structapreq__cookie__t.html#o4">00080</a>     <span class="keywordtype">unsigned</span>        <a class="code" href="structapreq__cookie__t.html#o4">secure</a>;      
<a name="l00081"></a><a class="code" href="structapreq__cookie__t.html#o5">00081</a>     <span class="keywordtype">char</span>           *<a class="code" href="structapreq__cookie__t.html#o5">comment</a>;     
<a name="l00082"></a><a class="code" href="structapreq__cookie__t.html#o6">00082</a>     <span class="keywordtype">char</span>           *<a class="code" href="structapreq__cookie__t.html#o6">commentURL</a>;  
<a name="l00083"></a><a class="code" href="structapreq__cookie__t.html#o7">00083</a>     <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__time_8h.html#ga2">apr_time_t</a>      <a class="code" href="structapreq__cookie__t.html#o7">max_age</a>;     
<a name="l00084"></a><a class="code" href="structapreq__cookie__t.html#o8">00084</a>     <a class="code" href="structapreq__value__t.html">apreq_value_t</a>   <a class="code" href="structapreq__cookie__t.html#o8">v</a>;           
00086 } <a class="code" href="structapreq__cookie__t.html">apreq_cookie_t</a>;
00087 
00088 
00089 <span class="preprocessor">#define apreq_value_to_cookie(ptr) apreq_attr_to_type(apreq_cookie_t, \</span>
00090 <span class="preprocessor">                                                      v, ptr)</span>
00091 <span class="preprocessor"></span><span class="preprocessor">#define apreq_cookie_name(c)  ((c)-&gt;v.name)</span>
00092 <span class="preprocessor"></span><span class="preprocessor">#define apreq_cookie_value(c) ((c)-&gt;v.data)</span>
00093 <span class="preprocessor"></span>
00094 <span class="preprocessor">#define apreq_jar_items(j) apr_table_elts(j-&gt;cookies)-&gt;nelts</span>
00095 <span class="preprocessor"></span><span class="preprocessor">#define apreq_jar_nelts(j) apr_table_elts(j-&gt;cookies)-&gt;nelts</span>
00096 <span class="preprocessor"></span>
00104 APREQ_DECLARE(<a class="code" href="structapreq__cookie__t.html">apreq_cookie_t</a> *)apreq_cookie(const <a class="code" href="structapreq__jar__t.html">apreq_jar_t</a> *jar,
00105                                             const <span class="keywordtype">char</span> *name);
00106 
00114 APREQ_DECLARE(<span class="keywordtype">void</span>) apreq_jar_add(<a class="code" href="structapreq__jar__t.html">apreq_jar_t</a> *jar, 
00115                                      const <a class="code" href="structapreq__cookie__t.html">apreq_cookie_t</a> *c);
00116 
00117 #define apreq_add_cookie(j,c) apreq_jar_add(j,c)
00118 
00135 APREQ_DECLARE(<a class="code" href="structapreq__jar__t.html">apreq_jar_t</a> *) apreq_jar(<span class="keywordtype">void</span> *env, const <span class="keywordtype">char</span> *hdr);
00136 
00146 APREQ_DECLARE(<a class="code" href="structapreq__cookie__t.html">apreq_cookie_t</a> *) apreq_cookie_make(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *pool, 
00147                                   const <span class="keywordtype">char</span> *name, const <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr_8h.html#ga7">apr_size_t</a> nlen, 
00148                                   const <span class="keywordtype">char</span> *value, const <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr_8h.html#ga7">apr_size_t</a> vlen);
00149 
00150 #define apreq_make_cookie(p,n,nl,v,vl) apreq_cookie_make(p,n,nl,v,vl)
00151 
00163 APREQ_DECLARE(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a>) 
00164     apreq_cookie_attr(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *p, <a class="code" href="structapreq__cookie__t.html">apreq_cookie_t</a> *c, 
00165                       const <span class="keywordtype">char</span> *attr, <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr_8h.html#ga7">apr_size_t</a> alen,
00166                       const <span class="keywordtype">char</span> *val, <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr_8h.html#ga7">apr_size_t</a> vlen);
00167 
00168 
00176 APREQ_DECLARE(<span class="keywordtype">char</span>*) apreq_cookie_as_string(const <a class="code" href="structapreq__cookie__t.html">apreq_cookie_t</a> *c,
00177                                             <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__pools_8h.html#ga0">apr_pool_t</a> *p);
00178 
00179 
00191 APREQ_DECLARE(<span class="keywordtype">int</span>) apreq_cookie_serialize(const <a class="code" href="structapreq__cookie__t.html">apreq_cookie_t</a> *c,
00192                                           <span class="keywordtype">char</span> *buf, <a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr_8h.html#ga7">apr_size_t</a> len);
00193 
00194 #define apreq_serialize_cookie(buf,len,c) apreq_cookie_serialize(c,buf,len)
00195 
00207 APREQ_DECLARE(<span class="keywordtype">void</span>) apreq_cookie_expires(<a class="code" href="structapreq__cookie__t.html">apreq_cookie_t</a> *c, 
00208                                          const <span class="keywordtype">char</span> *time_str);
00209 
00216 APREQ_DECLARE(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a>) apreq_cookie_bake(const <a class="code" href="structapreq__cookie__t.html">apreq_cookie_t</a> *c,
00217                                               <span class="keywordtype">void</span> *env);
00218 
00225 APREQ_DECLARE(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/apr__errno_8h.html#ga0">apr_status_t</a>) apreq_cookie_bake2(const <a class="code" href="structapreq__cookie__t.html">apreq_cookie_t</a> *c,
00226                                                <span class="keywordtype">void</span> *env);
00227 
00235 APREQ_DECLARE(apreq_cookie_version_t) apreq_ua_cookie_version(<span class="keywordtype">void</span> *env);
00236 
00237 #ifdef __cplusplus
00238  }
00239 #endif
00240 
00241 #endif <span class="comment">/*APREQ_COOKIE_H*/</span>
00242 
00243 
</div></pre><div id="footer">
<p class="apache">
Copyright &copy; 2003-2004 <a href="http://www.apache.org">The Apache Software Foundation</a>.<br/>
See <a href="LICENSE.html">LICENSE</a>.</p>
<p class="menu">
<span style="color:#aaa">page generated by <a href="http://www.doxygen.org/"><code>doxygen</code></a>
version 1.3.8 on 30 Aug 2004</span>
</p>
</div>
</body>
</html>