| @@ -15,27 +15,27 @@ | | | @@ -15,27 +15,27 @@ |
15 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | | 15 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
16 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 16 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
17 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 17 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | | 18 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
19 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 19 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
20 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 20 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
21 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 21 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
22 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 22 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
23 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 23 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
24 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 24 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
25 | .\" SUCH DAMAGE. | | 25 | .\" SUCH DAMAGE. |
26 | .\" | | 26 | .\" |
27 | .\" $FreeBSD: fetch.3,v 1.64 2007/12/18 11:03:26 des Exp $ | | 27 | .\" $FreeBSD: fetch.3,v 1.64 2007/12/18 11:03:26 des Exp $ |
28 | .\" $NetBSD: fetch.3,v 1.16 2013/07/20 21:50:52 wiz Exp $ | | 28 | .\" $NetBSD: fetch.3,v 1.17 2016/05/31 18:02:36 abhinav Exp $ |
29 | .\" | | 29 | .\" |
30 | .Dd January 22, 2010 | | 30 | .Dd January 22, 2010 |
31 | .Dt FETCH 3 | | 31 | .Dt FETCH 3 |
32 | .Os | | 32 | .Os |
33 | .Sh NAME | | 33 | .Sh NAME |
34 | .Nm fetchMakeURL , | | 34 | .Nm fetchMakeURL , |
35 | .Nm fetchParseURL , | | 35 | .Nm fetchParseURL , |
36 | .Nm fetchCopyURL , | | 36 | .Nm fetchCopyURL , |
37 | .Nm fetchFreeURL , | | 37 | .Nm fetchFreeURL , |
38 | .Nm fetchXGetURL , | | 38 | .Nm fetchXGetURL , |
39 | .Nm fetchGetURL , | | 39 | .Nm fetchGetURL , |
40 | .Nm fetchPutURL , | | 40 | .Nm fetchPutURL , |
41 | .Nm fetchStatURL , | | 41 | .Nm fetchStatURL , |
| @@ -81,105 +81,105 @@ | | | @@ -81,105 +81,105 @@ |
81 | .Ft struct url * | | 81 | .Ft struct url * |
82 | .Fn fetchCopyURL "const struct url *u" | | 82 | .Fn fetchCopyURL "const struct url *u" |
83 | .Ft void | | 83 | .Ft void |
84 | .Fn fetchFreeURL "struct url *u" | | 84 | .Fn fetchFreeURL "struct url *u" |
85 | .Ft fetchIO * | | 85 | .Ft fetchIO * |
86 | .Fn fetchXGetURL "const char *URL" "struct url_stat *us" "const char *flags" | | 86 | .Fn fetchXGetURL "const char *URL" "struct url_stat *us" "const char *flags" |
87 | .Ft fetchIO * | | 87 | .Ft fetchIO * |
88 | .Fn fetchGetURL "const char *URL" "const char *flags" | | 88 | .Fn fetchGetURL "const char *URL" "const char *flags" |
89 | .Ft fetchIO * | | 89 | .Ft fetchIO * |
90 | .Fn fetchPutURL "const char *URL" "const char *flags" | | 90 | .Fn fetchPutURL "const char *URL" "const char *flags" |
91 | .Ft int | | 91 | .Ft int |
92 | .Fn fetchStatURL "const char *URL" "struct url_stat *us" "const char *flags" | | 92 | .Fn fetchStatURL "const char *URL" "struct url_stat *us" "const char *flags" |
93 | .Ft int | | 93 | .Ft int |
94 | .Fn fetchListURL "struct url_list *list" "const char *URL" "const char *flags" | | 94 | .Fn fetchListURL "struct url_list *list" "const char *URL" "const char *pattern" "const char *flags" |
95 | .Ft fetchIO * | | 95 | .Ft fetchIO * |
96 | .Fn fetchXGet "struct url *u" "struct url_stat *us" "const char *flags" | | 96 | .Fn fetchXGet "struct url *u" "struct url_stat *us" "const char *flags" |
97 | .Ft fetchIO * | | 97 | .Ft fetchIO * |
98 | .Fn fetchGet "struct url *u" "const char *flags" | | 98 | .Fn fetchGet "struct url *u" "const char *flags" |
99 | .Ft fetchIO * | | 99 | .Ft fetchIO * |
100 | .Fn fetchPut "struct url *u" "const char *flags" | | 100 | .Fn fetchPut "struct url *u" "const char *flags" |
101 | .Ft int | | 101 | .Ft int |
102 | .Fn fetchStat "struct url *u" "struct url_stat *us" "const char *flags" | | 102 | .Fn fetchStat "struct url *u" "struct url_stat *us" "const char *flags" |
103 | .Ft int | | 103 | .Ft int |
104 | .Fn fetchList "struct url_list *list" "struct url *u" "const char *flags" | | 104 | .Fn fetchList "struct url_list *list" "struct url *u" "const char *pattern" "const char *flags" |
105 | .Ft fetchIO * | | 105 | .Ft fetchIO * |
106 | .Fn fetchXGetFile "struct url *u" "struct url_stat *us" "const char *flags" | | 106 | .Fn fetchXGetFile "struct url *u" "struct url_stat *us" "const char *flags" |
107 | .Ft fetchIO * | | 107 | .Ft fetchIO * |
108 | .Fn fetchGetFile "struct url *u" "const char *flags" | | 108 | .Fn fetchGetFile "struct url *u" "const char *flags" |
109 | .Ft fetchIO * | | 109 | .Ft fetchIO * |
110 | .Fn fetchPutFile "struct url *u" "const char *flags" | | 110 | .Fn fetchPutFile "struct url *u" "const char *flags" |
111 | .Ft int | | 111 | .Ft int |
112 | .Fn fetchStatFile "struct url *u" "struct url_stat *us" "const char *flags" | | 112 | .Fn fetchStatFile "struct url *u" "struct url_stat *us" "const char *flags" |
113 | .Ft int | | 113 | .Ft int |
114 | .Fn fetchListFile "struct url_list *list" "struct url *u" "const char *flags" | | 114 | .Fn fetchListFile "struct url_list *list" "struct url *u" "const char *pattern" "const char *flags" |
115 | .Ft fetchIO * | | 115 | .Ft fetchIO * |
116 | .Fn fetchXGetHTTP "struct url *u" "struct url_stat *us" "const char *flags" | | 116 | .Fn fetchXGetHTTP "struct url *u" "struct url_stat *us" "const char *flags" |
117 | .Ft fetchIO * | | 117 | .Ft fetchIO * |
118 | .Fn fetchGetHTTP "struct url *u" "const char *flags" | | 118 | .Fn fetchGetHTTP "struct url *u" "const char *flags" |
119 | .Ft fetchIO * | | 119 | .Ft fetchIO * |
120 | .Fn fetchPutHTTP "struct url *u" "const char *flags" | | 120 | .Fn fetchPutHTTP "struct url *u" "const char *flags" |
121 | .Ft int | | 121 | .Ft int |
122 | .Fn fetchStatHTTP "struct url *u" "struct url_stat *us" "const char *flags" | | 122 | .Fn fetchStatHTTP "struct url *u" "struct url_stat *us" "const char *flags" |
123 | .Ft int | | 123 | .Ft int |
124 | .Fn fetchListHTTP "struct url_list *list" "struct url *u" "const char *flags" | | 124 | .Fn fetchListHTTP "struct url_list *list" "struct url *u" "const char *pattern" "const char *flags" |
125 | .Ft fetchIO * | | 125 | .Ft fetchIO * |
126 | .Fn fetchXGetFTP "struct url *u" "struct url_stat *us" "const char *flags" | | 126 | .Fn fetchXGetFTP "struct url *u" "struct url_stat *us" "const char *flags" |
127 | .Ft fetchIO * | | 127 | .Ft fetchIO * |
128 | .Fn fetchGetFTP "struct url *u" "const char *flags" | | 128 | .Fn fetchGetFTP "struct url *u" "const char *flags" |
129 | .Ft fetchIO * | | 129 | .Ft fetchIO * |
130 | .Fn fetchPutFTP "struct url *u" "const char *flags" | | 130 | .Fn fetchPutFTP "struct url *u" "const char *flags" |
131 | .Ft int | | 131 | .Ft int |
132 | .Fn fetchStatFTP "struct url *u" "struct url_stat *us" "const char *flags" | | 132 | .Fn fetchStatFTP "struct url *u" "struct url_stat *us" "const char *flags" |
133 | .Ft int | | 133 | .Ft int |
134 | .Fn fetchListFTP "struct url_list *list" "struct url *u" "const char *flags" | | 134 | .Fn fetchListFTP "struct url_list *list" "struct url *u" "const char *pattern" "const char *flags" |
135 | .Ft void | | 135 | .Ft void |
136 | .Fn fetchInitURLList "struct url_list *ul" | | 136 | .Fn fetchInitURLList "struct url_list *ul" |
137 | .Ft int | | 137 | .Ft int |
138 | .Fn fetchAppendURLList "struct url_list *dst" "const struct url_list *src" | | 138 | .Fn fetchAppendURLList "struct url_list *dst" "const struct url_list *src" |
139 | .Ft void | | 139 | .Ft void |
140 | .Fn fetchFreeURLList "struct url_list *ul" | | 140 | .Fn fetchFreeURLList "struct url_list *ul" |
141 | .Ft char * | | 141 | .Ft char * |
142 | .Fn fetchUnquotePath "struct url *u" | | 142 | .Fn fetchUnquotePath "struct url *u" |
143 | .Ft char * | | 143 | .Ft char * |
144 | .Fn fetchUnquoteFilename "struct url *u" | | 144 | .Fn fetchUnquoteFilename "struct url *u" |
145 | .Ft char * | | 145 | .Ft char * |
146 | .Fn fetchStringifyURL "const struct url *u" | | 146 | .Fn fetchStringifyURL "const struct url *u" |
147 | .Ft void | | 147 | .Ft void |
148 | .Fn fetchConnectionCacheInit "int global" "int per_host" | | 148 | .Fn fetchConnectionCacheInit "int global" "int per_host" |
149 | .Ft void | | 149 | .Ft void |
150 | .Fn fetchConnectionCacheClose "void" | | 150 | .Fn fetchConnectionCacheClose "void" |
151 | .Sh DESCRIPTION | | 151 | .Sh DESCRIPTION |
152 | These functions implement a high-level library for retrieving and | | 152 | These functions implement a high-level library for retrieving and |
153 | uploading files using Uniform Resource Locators (URLs). | | 153 | uploading files using Uniform Resource Locators (URLs). |
154 | .Pp | | 154 | .Pp |
155 | .Fn fetchParseURL | | 155 | .Fn fetchParseURL |
156 | takes a URL in the form of a null-terminated string and splits it into | | 156 | takes a URL in the form of a null-terminated string and splits it into |
157 | its components function according to the Common Internet Scheme Syntax | | 157 | its components function according to the Common Internet Scheme Syntax |
158 | detailed in RFC 1738. | | 158 | detailed in RFC 1738. |
159 | A regular expression which produces this syntax is: | | 159 | A regular expression which produces this syntax is: |
160 | .Bd -literal -offset indent | | 160 | .Bd -literal -offset indent |
161 | \*[Lt]scheme\*[Gt]:(//(\*[Lt]user\*[Gt](:\*[Lt]pwd\*[Gt])?@)?\*[Lt]host\*[Gt](:\*[Lt]port\*[Gt])?)?/(\*[Lt]document\*[Gt])? | | 161 | \*[Lt]scheme\*[Gt]:(//(\*[Lt]user\*[Gt](:\*[Lt]pwd\*[Gt])?@)?\*[Lt]host\*[Gt](:\*[Lt]port\*[Gt])?)?/(\*[Lt]doc\*[Gt])? |
162 | .Ed | | 162 | .Ed |
163 | .Pp | | 163 | .Pp |
164 | If the URL does not seem to begin with a scheme name, it is assumed to be a local path. | | 164 | If the URL does not seem to begin with a scheme name, it is assumed to be a local path. |
165 | Only absolute path names are accepted. | | 165 | Only absolute path names are accepted. |
166 | .Pp | | 166 | .Pp |
167 | Note that some components of the URL are not necessarily relevant to | | 167 | Note that some components of the URL are not necessarily relevant to |
168 | all URL schemes. | | 168 | all URL schemes. |
169 | For instance, the file scheme only needs the | | 169 | For instance, the file scheme only needs the |
170 | .Aq scheme | | 170 | .Aq scheme |
171 | and | | 171 | and |
172 | .Aq document | | 172 | .Aq doc |
173 | components. | | 173 | components. |
174 | .Fn fetchParseURL | | 174 | .Fn fetchParseURL |
175 | quotes any unsafe character in the URL automatically. | | 175 | quotes any unsafe character in the URL automatically. |
176 | This is not done by | | 176 | This is not done by |
177 | .Fn fetchMakeURL . | | 177 | .Fn fetchMakeURL . |
178 | .Fn fetchCopyURL | | 178 | .Fn fetchCopyURL |
179 | copies an existing | | 179 | copies an existing |
180 | .Vt url | | 180 | .Vt url |
181 | structure. | | 181 | structure. |
182 | .Pp | | 182 | .Pp |
183 | .Fn fetchMakeURL , | | 183 | .Fn fetchMakeURL , |
184 | .Fn fetchParseURL , | | 184 | .Fn fetchParseURL , |
185 | and | | 185 | and |