| @@ -1,24 +1,25 @@ | | | @@ -1,24 +1,25 @@ |
1 | FETCH(3) NetBSD Library Functions Manual FETCH(3) | | 1 | FETCH(3) NetBSD Library Functions Manual FETCH(3) |
2 | | | 2 | |
3 | NNAAMMEE | | 3 | NNAAMMEE |
4 | ffeettcchhMMaakkeeUURRLL, ffeettcchhPPaarrsseeUURRLL, ffeettcchhCCooppyyUURRLL, ffeettcchhFFrreeeeUURRLL, ffeettcchhXXGGeettUURRLL, | | 4 | ffeettcchhMMaakkeeUURRLL, ffeettcchhPPaarrsseeUURRLL, ffeettcchhCCooppyyUURRLL, ffeettcchhFFrreeeeUURRLL, ffeettcchhXXGGeettUURRLL, |
5 | ffeettcchhGGeettUURRLL, ffeettcchhPPuuttUURRLL, ffeettcchhSSttaattUURRLL, ffeettcchhLLiissttUURRLL, ffeettcchhXXGGeett, | | 5 | ffeettcchhGGeettUURRLL, ffeettcchhPPuuttUURRLL, ffeettcchhSSttaattUURRLL, ffeettcchhLLiissttUURRLL, ffeettcchhXXGGeett, |
6 | ffeettcchhGGeett, ffeettcchhPPuutt, ffeettcchhSSttaatt, ffeettcchhLLiisstt, ffeettcchhXXGGeettFFiillee, ffeettcchhGGeettFFiillee, | | 6 | ffeettcchhGGeett, ffeettcchhPPuutt, ffeettcchhSSttaatt, ffeettcchhLLiisstt, ffeettcchhXXGGeettFFiillee, ffeettcchhGGeettFFiillee, |
7 | ffeettcchhPPuuttFFiillee, ffeettcchhSSttaattFFiillee, ffeettcchhLLiissttFFiillee, ffeettcchhXXGGeettHHTTTTPP, ffeettcchhGGeettHHTTTTPP, | | 7 | ffeettcchhPPuuttFFiillee, ffeettcchhSSttaattFFiillee, ffeettcchhLLiissttFFiillee, ffeettcchhXXGGeettHHTTTTPP, ffeettcchhGGeettHHTTTTPP, |
8 | ffeettcchhPPuuttHHTTTTPP, ffeettcchhSSttaattHHTTTTPP, ffeettcchhLLiissttHHTTTTPP, ffeettcchhXXGGeettFFTTPP, ffeettcchhGGeettFFTTPP, | | 8 | ffeettcchhPPuuttHHTTTTPP, ffeettcchhSSttaattHHTTTTPP, ffeettcchhLLiissttHHTTTTPP, ffeettcchhXXGGeettFFTTPP, ffeettcchhGGeettFFTTPP, |
9 | ffeettcchhPPuuttFFTTPP, ffeettcchhSSttaattFFTTPP, ffeettcchhLLiissttFFTTPP ffeettcchhIInniittUURRLLLLiisstt, | | 9 | ffeettcchhPPuuttFFTTPP, ffeettcchhSSttaattFFTTPP, ffeettcchhLLiissttFFTTPP ffeettcchhIInniittUURRLLLLiisstt, |
10 | ffeettcchhFFrreeeeUURRLLLLiisstt, ffeettcchhUUnnqquuootteePPaatthh, ffeettcchhUUnnqquuootteeFFiilleennaammee, | | 10 | ffeettcchhFFrreeeeUURRLLLLiisstt, ffeettcchhUUnnqquuootteePPaatthh, ffeettcchhUUnnqquuootteeFFiilleennaammee, |
11 | ffeettcchhSSttrriinnggiiffyyUURRLL, ffeettcchh -- file transfer functions | | 11 | ffeettcchhSSttrriinnggiiffyyUURRLL, ffeettcchhCCoonnnneeccttiioonnCCaacchheeIInniitt, ffeettcchhCCoonnnneeccttiioonnCCaacchheeCClloossee, |
| | | 12 | ffeettcchh -- file transfer functions |
12 | | | 13 | |
13 | LLIIBBRRAARRYY | | 14 | LLIIBBRRAARRYY |
14 | File Transfer Library for URLs (libfetch, -lfetch) | | 15 | File Transfer Library for URLs (libfetch, -lfetch) |
15 | | | 16 | |
16 | SSYYNNOOPPSSIISS | | 17 | SSYYNNOOPPSSIISS |
17 | ##iinncclluuddee <<ssttddiioo..hh>> | | 18 | ##iinncclluuddee <<ssttddiioo..hh>> |
18 | ##iinncclluuddee <<ffeettcchh..hh>> | | 19 | ##iinncclluuddee <<ffeettcchh..hh>> |
19 | | | 20 | |
20 | _s_t_r_u_c_t _u_r_l _* | | 21 | _s_t_r_u_c_t _u_r_l _* |
21 | ffeettcchhMMaakkeeUURRLL(_c_o_n_s_t _c_h_a_r _*_s_c_h_e_m_e, _c_o_n_s_t _c_h_a_r _*_h_o_s_t, _i_n_t _p_o_r_t, | | 22 | ffeettcchhMMaakkeeUURRLL(_c_o_n_s_t _c_h_a_r _*_s_c_h_e_m_e, _c_o_n_s_t _c_h_a_r _*_h_o_s_t, _i_n_t _p_o_r_t, |
22 | _c_o_n_s_t _c_h_a_r _*_d_o_c, _c_o_n_s_t _c_h_a_r _*_u_s_e_r, _c_o_n_s_t _c_h_a_r _*_p_w_d); | | 23 | _c_o_n_s_t _c_h_a_r _*_d_o_c, _c_o_n_s_t _c_h_a_r _*_u_s_e_r, _c_o_n_s_t _c_h_a_r _*_p_w_d); |
23 | | | 24 | |
24 | _s_t_r_u_c_t _u_r_l _* | | 25 | _s_t_r_u_c_t _u_r_l _* |
| @@ -113,26 +114,32 @@ SSYYNNOOPPSSIISS | | | @@ -113,26 +114,32 @@ SSYYNNOOPPSSIISS |
113 | | | 114 | |
114 | _v_o_i_d | | 115 | _v_o_i_d |
115 | ffeettcchhFFrreeeeUURRLLLLiisstt(_s_t_r_u_c_t _u_r_l___l_i_s_t _*_u_l); | | 116 | ffeettcchhFFrreeeeUURRLLLLiisstt(_s_t_r_u_c_t _u_r_l___l_i_s_t _*_u_l); |
116 | | | 117 | |
117 | _c_h_a_r _* | | 118 | _c_h_a_r _* |
118 | ffeettcchhUUnnqquuootteePPaatthh(_s_t_r_u_c_t _u_r_l _*_u); | | 119 | ffeettcchhUUnnqquuootteePPaatthh(_s_t_r_u_c_t _u_r_l _*_u); |
119 | | | 120 | |
120 | _c_h_a_r _* | | 121 | _c_h_a_r _* |
121 | ffeettcchhUUnnqquuootteeFFiilleennaammee(_s_t_r_u_c_t _u_r_l _*_u); | | 122 | ffeettcchhUUnnqquuootteeFFiilleennaammee(_s_t_r_u_c_t _u_r_l _*_u); |
122 | | | 123 | |
123 | _c_h_a_r _* | | 124 | _c_h_a_r _* |
124 | ffeettcchhSSttrriinnggiiffyyUURRLL(_c_o_n_s_t _s_t_r_u_c_t _u_r_l _*_u); | | 125 | ffeettcchhSSttrriinnggiiffyyUURRLL(_c_o_n_s_t _s_t_r_u_c_t _u_r_l _*_u); |
125 | | | 126 | |
| | | 127 | _v_o_i_d |
| | | 128 | ffeettcchhCCoonnnneeccttiioonnCCaacchheeIInniitt(_i_n_t _g_l_o_b_a_l, _i_n_t _p_e_r___h_o_s_t); |
| | | 129 | |
| | | 130 | _v_o_i_d |
| | | 131 | ffeettcchhCCoonnnneeccttiioonnCCaacchheeCClloossee(_v_o_i_d); |
| | | 132 | |
126 | DDEESSCCRRIIPPTTIIOONN | | 133 | DDEESSCCRRIIPPTTIIOONN |
127 | These functions implement a high-level library for retrieving and upload- | | 134 | These functions implement a high-level library for retrieving and upload- |
128 | ing files using Uniform Resource Locators (URLs). | | 135 | ing files using Uniform Resource Locators (URLs). |
129 | | | 136 | |
130 | ffeettcchhPPaarrsseeUURRLL() takes a URL in the form of a null-terminated string and | | 137 | ffeettcchhPPaarrsseeUURRLL() takes a URL in the form of a null-terminated string and |
131 | splits it into its components function according to the Common Internet | | 138 | splits it into its components function according to the Common Internet |
132 | Scheme Syntax detailed in RFC 1738. A regular expression which produces | | 139 | Scheme Syntax detailed in RFC 1738. A regular expression which produces |
133 | this syntax is: | | 140 | this syntax is: |
134 | | | 141 | |
135 | <scheme>:(//(<user>(:<pwd>)?@)?<host>(:<port>)?)?/(<document>)? | | 142 | <scheme>:(//(<user>(:<pwd>)?@)?<host>(:<port>)?)?/(<document>)? |
136 | | | 143 | |
137 | If the URL does not seem to begin with a scheme name, it is assumed to be | | 144 | If the URL does not seem to begin with a scheme name, it is assumed to be |
138 | a local path. Only absolute path names are accepted. | | 145 | a local path. Only absolute path names are accepted. |
| @@ -197,39 +204,46 @@ DDEESSCCRRIIPPTTIIOONN | | | @@ -197,39 +204,46 @@ DDEESSCCRRIIPPTTIIOONN |
197 | ffeettcchhLLiissttUURRLL() attempts to list the contents of the directory pointed to | | 204 | ffeettcchhLLiissttUURRLL() attempts to list the contents of the directory pointed to |
198 | by the URL provided. The pattern can be a simple glob-like expression as | | 205 | by the URL provided. The pattern can be a simple glob-like expression as |
199 | hint. Callers should not depend on the server to filter names. If suc- | | 206 | hint. Callers should not depend on the server to filter names. If suc- |
200 | cessful, it appends the list of entries to the _u_r_l___l_i_s_t structure. The | | 207 | cessful, it appends the list of entries to the _u_r_l___l_i_s_t structure. The |
201 | _u_r_l___l_i_s_t structure is defined as follows in <_f_e_t_c_h_._h>: | | 208 | _u_r_l___l_i_s_t structure is defined as follows in <_f_e_t_c_h_._h>: |
202 | | | 209 | |
203 | struct url_list { | | 210 | struct url_list { |
204 | size_t length; | | 211 | size_t length; |
205 | size_t alloc_size; | | 212 | size_t alloc_size; |
206 | struct url *urls; | | 213 | struct url *urls; |
207 | }; | | 214 | }; |
208 | | | 215 | |
209 | The list should be initialized by calling ffeettcchhIInniittUURRLLLLiisstt() and the | | 216 | The list should be initialized by calling ffeettcchhIInniittUURRLLLLiisstt() and the |
210 | entries be freed by calling ffeettcchhFFrreeeeUURRLLLLiisstt(). The functio | | 217 | entries be freed by calling ffeettcchhFFrreeeeUURRLLLLiisstt(). The function |
211 | ffeettcchhAAppppeennddUURRLLLLiisstt() can be used to append one URL lists to another. If | | 218 | ffeettcchhAAppppeennddUURRLLLLiisstt() can be used to append one URL lists to another. If |
212 | the `c' (cache result) flag is specified, the library is allowed to | | 219 | the `c' (cache result) flag is specified, the library is allowed to |
213 | internally cache the result. | | 220 | internally cache the result. |
214 | | | 221 | |
215 | ffeettcchhSSttrriinnggiiffyyUURRLL() returns the URL as string. ffeettcchhUUnnqquuootteePPaatthh() | | 222 | ffeettcchhSSttrriinnggiiffyyUURRLL() returns the URL as string. ffeettcchhUUnnqquuootteePPaatthh() |
216 | returns the path name part of the URL with any quoting undone. Query | | 223 | returns the path name part of the URL with any quoting undone. Query |
217 | arguments and fragment identifiers are not included. | | 224 | arguments and fragment identifiers are not included. |
218 | ffeettcchhUUnnqquuootteeFFiilleennaammee() returns the last component of the path name as | | 225 | ffeettcchhUUnnqquuootteeFFiilleennaammee() returns the last component of the path name as |
219 | returned by ffeettcchhUUnnqquuootteePPaatthh(). ffeettcchhSSttrriinnggiiffyyUURRLL(), ffeettcchhUUnnqquuootteePPaatthh(), | | 226 | returned by ffeettcchhUUnnqquuootteePPaatthh(). ffeettcchhSSttrriinnggiiffyyUURRLL(), ffeettcchhUUnnqquuootteePPaatthh(), |
220 | and ffeettcchhUUnnqquuootteeFFiilleennaammee() return a string that should be deallocated | | 227 | and ffeettcchhUUnnqquuootteeFFiilleennaammee() return a string that should be deallocated |
221 | with ffrreeee() after use. | | 228 | with ffrreeee() after use. |
222 | | | 229 | |
| | | 230 | ffeettcchhCCoonnnneeccttiioonnCCaacchheeIInniitt() enables the connection cache. The first argu- |
| | | 231 | ment specifies the global limit on cached connections. The second argu- |
| | | 232 | ment specifies the host limit. Entries are considered to specify the |
| | | 233 | same host, if the host name from the URL is identical, indepent of the |
| | | 234 | address or address family. ffeettcchhCCoonnnneeccttiioonnCCaacchheeCClloossee() flushed the con- |
| | | 235 | nection cache and closes all cached connections. |
| | | 236 | |
223 | ffeettcchhXXGGeett(), ffeettcchhGGeett(), ffeettcchhPPuutt(), and ffeettcchhSSttaatt() are similar to | | 237 | ffeettcchhXXGGeett(), ffeettcchhGGeett(), ffeettcchhPPuutt(), and ffeettcchhSSttaatt() are similar to |
224 | ffeettcchhXXGGeettUURRLL(), ffeettcchhGGeettUURRLL(), ffeettcchhPPuuttUURRLL(), and ffeettcchhSSttaattUURRLL(), except | | 238 | ffeettcchhXXGGeettUURRLL(), ffeettcchhGGeettUURRLL(), ffeettcchhPPuuttUURRLL(), and ffeettcchhSSttaattUURRLL(), except |
225 | that they expect a pre-parsed URL in the form of a pointer to a _s_t_r_u_c_t | | 239 | that they expect a pre-parsed URL in the form of a pointer to a _s_t_r_u_c_t |
226 | _u_r_l rather than a string. | | 240 | _u_r_l rather than a string. |
227 | | | 241 | |
228 | All of the ffeettcchhXXGGeettXXXXXX(), ffeettcchhGGeettXXXXXX(), and ffeettcchhPPuuttXXXXXX() functions | | 242 | All of the ffeettcchhXXGGeettXXXXXX(), ffeettcchhGGeettXXXXXX(), and ffeettcchhPPuuttXXXXXX() functions |
229 | return a pointer to a stream which can be used to read or write data from | | 243 | return a pointer to a stream which can be used to read or write data from |
230 | or to the requested document, respectively. Note that although the | | 244 | or to the requested document, respectively. Note that although the |
231 | implementation details of the individual access methods vary, it can gen- | | 245 | implementation details of the individual access methods vary, it can gen- |
232 | erally be assumed that a stream returned by one of the ffeettcchhXXGGeettXXXXXX() or | | 246 | erally be assumed that a stream returned by one of the ffeettcchhXXGGeettXXXXXX() or |
233 | ffeettcchhGGeettXXXXXX() functions is read-only, and that a stream returned by one | | 247 | ffeettcchhGGeettXXXXXX() functions is read-only, and that a stream returned by one |
234 | of the ffeettcchhPPuuttXXXXXX() functions is write-only. | | 248 | of the ffeettcchhPPuuttXXXXXX() functions is write-only. |
235 | | | 249 | |
| @@ -499,14 +513,14 @@ BBUUGGSS | | | @@ -499,14 +513,14 @@ BBUUGGSS |
499 | superfluous at this site" in an FTP context and "Accepted" in an HTTP | | 513 | superfluous at this site" in an FTP context and "Accepted" in an HTTP |
500 | context. | | 514 | context. |
501 | | | 515 | |
502 | ffeettcchhSSttaattFFTTPP() does not check that the result of an MDTM command is a | | 516 | ffeettcchhSSttaattFFTTPP() does not check that the result of an MDTM command is a |
503 | valid date. | | 517 | valid date. |
504 | | | 518 | |
505 | The man page is incomplete, poorly written and produces badly formatted | | 519 | The man page is incomplete, poorly written and produces badly formatted |
506 | text. | | 520 | text. |
507 | | | 521 | |
508 | The error reporting mechanism is unsatisfactory. | | 522 | The error reporting mechanism is unsatisfactory. |
509 | | | 523 | |
510 | Some parts of the code are not fully reentrant. | | 524 | Some parts of the code are not fully reentrant. |
511 | | | 525 | |
512 | NetBSD 5.0 February 4, 2009 NetBSD 5.0 | | 526 | NetBSD 5.0 January 22, 2010 NetBSD 5.0 |