1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Copyright 2013 Matthieu Lucas <lucasmatthieu@gmail.com>
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Binding of C libCurl which allow us to interact with network.
25 #include <curl/curl.h>
28 CURLcallbackTypeHeader,
30 CURLcallbackTypeStream,
35 CCurlCallbacks delegate;
36 CURLcallbackType type;
43 } CURLCallbackReadDatas;
47 // Callbacks method for Header, Body, Stream.
48 size_t nit_curl_callback_func(void *buffer, size_t size, size_t count, CURLCallbackDatas *datas){
49 if(datas->type == CURLcallbackTypeHeader){
50 char *line_c = (char*)buffer;
51 String line_o = NativeString_to_s_with_copy(line_c);
52 CCurlCallbacks_header_callback(datas->delegate, line_o);
54 else if(datas->type == CURLcallbackTypeBody){
55 char *line_c = (char*)buffer;
56 String line_o = NativeString_to_s_with_copy(line_c);
57 CCurlCallbacks_body_callback(datas->delegate, line_o);
59 else if(datas->type == CURLcallbackTypeStream){
60 char *line_c = (char*)buffer;
61 String line_o = NativeString_to_s(line_c);
62 CCurlCallbacks_stream_callback(datas->delegate, line_o, size, count);
66 // Callback method to read datas from buffer.
67 size_t nit_curl_callback_read_func(void *buffer, size_t size, size_t count, CURLCallbackReadDatas *datas){
68 int len = datas->len - datas->pos;
69 if(len > size * count) len = size * count;
70 memcpy(buffer, datas->data + datas->pos, len);
76 # CURL Extern Type, reproduce CURL low level behaviors
77 extern CCurl `{ CURL * `}
78 # Constructor, CURL low level initializer
79 new easy_init `{ return curl_easy_init(); `}
80 # Check for correct initialization
81 fun is_init
:Bool `{ return (recv != NULL); `}
82 # Easy Clean / Release CURL instance
83 fun easy_clean `{ curl_easy_cleanup( recv ); `}
84 # Perform the transfer described by setted options
85 fun easy_perform
:CURLCode `{ return curl_easy_perform( recv ); `}
86 # Set options to tell CURL how to behave. Obj parameter type can be Int, Bool, String, OFile, CURLSList.
87 fun easy_setopt(opt: CURLOption, obj: Object):CURLCode
89 if obj isa Int then return i_setopt_int(opt, obj)
90 if obj isa Bool and obj == true then return i_setopt_int(opt, 1)
91 if obj isa Bool and obj == false then return i_setopt_int(opt, 0)
92 if obj isa String then return i_setopt_string(opt, obj)
93 if obj isa OFile then return i_setopt_file(opt, obj)
94 if obj isa CURLSList then return i_setopt_slist(opt, obj)
95 return once new CURLCode.unknown_option
97 # Internal method to set options to CURL using OFile parameter.
98 private fun i_setopt_file(opt: CURLOption, fl: OFile):CURLCode `{ return curl_easy_setopt( recv, opt, fl); `}
99 # Internal method to set options to CURL using Int parameter.
100 private fun i_setopt_int
(opt
: CURLOption, num
: Int):CURLCode `{ return curl_easy_setopt( recv, opt, num); `}
101 # Internal method to set options to CURL using CURLSList parameter.
102 private fun i_setopt_slist(opt: CURLOption, list: CURLSList):CURLCode `{ return curl_easy_setopt( recv, opt, list); `}
103 # Internal method to set options to CURL using String parameter.
104 private fun i_setopt_string
(opt
: CURLOption, str
: String):CURLCode import String::to_cstring
`{
105 char *rStr = String_to_cstring(str);
106 return curl_easy_setopt( recv, opt, rStr);
108 # Request Chars internal information from the CURL session
109 fun easy_getinfo_chars
(opt
: CURLInfoChars):nullable CURLInfoResponseString
111 var answ
= new CURLInfoResponseString
112 if not i_getinfo_chars
(opt
, answ
).is_ok
then return null
115 # Internal method used to get String object information initially knowns as C Chars type
116 private fun i_getinfo_chars
(opt
: CURLInfoChars, res
: CURLInfoResponseString):CURLCode import CURLInfoResponseString::response
=, NativeString::to_s_with_copy
`{
118 CURLcode c = curl_easy_getinfo( recv, opt, &r);
119 if((c == CURLE_OK) && r != NULL){
120 String ro = NativeString_to_s_with_copy(r);
121 CURLInfoResponseString_response__assign( res, ro);
125 # Request Long internal information from the CURL session
126 fun easy_getinfo_long
(opt
: CURLInfoLong):nullable CURLInfoResponseLong
128 var answ
= new CURLInfoResponseLong
129 if not i_getinfo_long
(opt
, answ
).is_ok
then return null
132 # Internal method used to get Int object information initially knowns as C Long type
133 private fun i_getinfo_long
(opt
: CURLInfoLong, res
: CURLInfoResponseLong):CURLCode import CURLInfoResponseLong::response
= `{
135 r = malloc(sizeof(long));
136 CURLcode c = curl_easy_getinfo( recv, opt, r);
137 if((c == CURLE_OK) && r != NULL) CURLInfoResponseLong_response__assign( res, *r);
141 # Request Double internal information from the CURL session
142 fun easy_getinfo_double
(opt
: CURLInfoDouble):nullable CURLInfoResponseDouble
144 var answ
= new CURLInfoResponseDouble
145 if not i_getinfo_double
(opt
, answ
).is_ok
then return null
148 # Internal method used to get Int object information initially knowns as C Double type
149 private fun i_getinfo_double
(opt
: CURLInfoDouble, res
: CURLInfoResponseDouble):CURLCode import CURLInfoResponseDouble::response
= `{
151 r = malloc(sizeof(double));
152 CURLcode c = curl_easy_getinfo( recv, opt, r);
153 if((c == CURLE_OK) && r != NULL) CURLInfoResponseDouble_response__assign( res, *r);
157 # Request SList internal information from the CURL session
158 fun easy_getinfo_slist
(opt
: CURLInfoSList):nullable CURLInfoResponseArray
160 var answ
= new CURLInfoResponseArray
161 if not i_getinfo_slist
(opt
, answ
).is_ok
then return null
162 answ
.response
= answ
.prim_response
.to_a
163 answ
.prim_response
.destroy
166 # Internal method used to get Array[String] object information initially knowns as C SList type
167 private fun i_getinfo_slist
(opt
: CURLInfoSList, res
: CURLInfoResponseArray):CURLCode import CURLInfoResponseArray::prim_response
=`{
168 struct curl_slist* csl = NULL;
169 CURLcode ce = curl_easy_getinfo( recv, opt, &csl);
170 CURLInfoResponseArray_prim_response__assign(res, csl);
173 # Register delegate to get callbacks about the CURL transfer performed
174 fun register_callback
(delegate
: CCurlCallbacks, cbtype
: CURLCallbackType):CURLCode
176 if once
[new CURLCallbackType.header
, new CURLCallbackType.body
, new CURLCallbackType.stream
, new CURLCallbackType.read
].has
(cbtype
) then
177 return i_register_callback
(delegate
, cbtype
)
179 return once
new CURLCode.unknown_option
181 # Register delegate to read datas from given buffer
182 fun register_read_datas_callback
(delegate
: CCurlCallbacks, datas
: String):CURLCode
184 if datas
.length
> 0 then return i_register_read_datas_callback
(delegate
, datas
, datas
.length
)
185 return once
new CURLCode.unknown_option
187 # Internal method used to configure read callback
188 private fun i_register_read_datas_callback
(delegate
: CCurlCallbacks, datas
: String, size
: Int):CURLCode import String::to_cstring
`{
189 CURLCallbackReadDatas *d = NULL;
190 d = malloc(sizeof(CURLCallbackReadDatas));
191 d->data = (char*)String_to_cstring(datas);
194 return curl_easy_setopt( recv, CURLOPT_READDATA, d);
196 # Internal method used to configure callbacks in terms of given type
197 private fun i_register_callback
(delegate
: CCurlCallbacks, cbtype
: CURLCallbackType):CURLCode is extern import CCurlCallbacks::header_callback
, CCurlCallbacks::body_callback
, CCurlCallbacks::stream_callback
`{
198 CURLCallbackDatas *d = malloc(sizeof(CURLCallbackDatas));
199 CCurlCallbacks_incr_ref(delegate);
201 d->delegate = delegate;
204 case CURLcallbackTypeHeader:
205 e = curl_easy_setopt( recv, CURLOPT_HEADERFUNCTION, &nit_curl_callback_func);
206 if(e != CURLE_OK) return e;
207 e = curl_easy_setopt( recv, CURLOPT_WRITEHEADER, d);
209 case CURLcallbackTypeBody:
210 case CURLcallbackTypeStream:
211 e = curl_easy_setopt( recv, CURLOPT_WRITEFUNCTION, &nit_curl_callback_func);
212 if(e != CURLE_OK) return e;
213 e = curl_easy_setopt( recv, CURLOPT_WRITEDATA, d);
215 case CURLcallbackTypeRead:
216 e = curl_easy_setopt( recv, CURLOPT_READFUNCTION, &nit_curl_callback_read_func);
222 # Convert given string to URL encoded string
223 fun escape
(url
: String):String import String::to_cstring
, NativeString::to_s_with_copy
`{
224 char *orig_url, *encoded_url = NULL;
225 orig_url = String_to_cstring(url);
226 encoded_url = curl_easy_escape( recv, orig_url, strlen(orig_url));
227 String b_url = NativeString_to_s_with_copy(encoded_url);
228 curl_free(encoded_url);
233 # FILE Extern type, reproduce basic FILE I/O
234 extern OFile `{ FILE* `}
235 # Open / Create a file from given name
236 new open(str: NativeString) `{ return fopen(str, "wb"); `}
237 # Check for File validity
238 fun is_valid
:Bool `{ return recv != NULL; `}
239 # Internal method to write to the current file
240 private fun n_write(buffer: NativeString, size: Int, count: Int):Int `{ return fwrite(buffer, size, count, recv); `}
241 # Write datas to the current file
242 fun write
(buffer
: String, size
: Int, count
: Int):Int
244 if is_valid
== true then return n_write
(buffer
.to_cstring
, size
, count
)
247 # Internal method to close the current file
248 private fun n_close
:Int `{ return fclose(recv); `}
249 # Close the current file
252 if is_valid == true then return n_close == 0
257 # Interface for internal information callbacks methods
258 interface CCurlCallbacks
259 fun header_callback(line: String) is abstract
260 fun body_callback(line: String) is abstract
261 fun stream_callback(buffer: String, size: Int, count: Int) is abstract
264 # Extern Type to reproduce Enum of available Callback type
265 extern CURLCallbackType `{ CURLcallbackType `}
266 new header
`{ return CURLcallbackTypeHeader; `}
267 new body `{ return CURLcallbackTypeBody; `}
268 new stream
`{ return CURLcallbackTypeStream; `}
269 new read `{ return CURLcallbackTypeRead; `}
270 fun to_i
:Int `{ return recv; `}
273 # CURL Code binding and helpers
274 extern CURLCode `{ CURLcode `}
275 new unknown_option
`{ return CURLE_UNKNOWN_OPTION; `}
276 new unsupported_protocol `{ return CURLE_UNSUPPORTED_PROTOCOL; `}
277 new ok
`{ return CURLE_OK; `}
278 new failed_init `{ return CURLE_FAILED_INIT; `}
279 fun code
:Int `{ return recv; `}
280 fun is_ok:Bool `{ return recv == CURLE_OK; `}
281 fun is_valid_protocol
:Bool `{ return recv == CURLE_UNSUPPORTED_PROTOCOL; `}
282 fun is_valid_init:Bool `{ return recv == CURLE_FAILED_INIT; `}
283 fun to_i
:Int do return code
end
284 redef fun to_s
import NativeString::to_s_with_copy
`{
285 char *c = (char*)curl_easy_strerror(recv);
286 return NativeString_to_s_with_copy(c);
290 # Extern Type of the Linked list type of CURL
291 extern CURLSList `{ struct curl_slist * `}
292 # Empty constructor which allow us to avoid the use of Nit NULLABLE type
293 private new `{ return NULL; `}
294 # Constructor allow us to get list instancied by appending an element inside.
295 new with_str
(s
: String) import String::to_cstring
`{
296 struct curl_slist *l = NULL;
297 l = curl_slist_append(l, String_to_cstring(s));
300 # Check for initialization
301 fun is_init
:Bool `{ return (recv != NULL); `}
302 # Append an element in the linked list
303 fun append(key: String) import String::to_cstring `{
304 char
*k
= String_to_cstring(key
);
305 curl_slist_append
(recv
, (char
*)k
);
307 # Internal method to check for reachability of current data
308 private fun i_data_reachable(c: CURLSList):Bool `{ return (c != NULL && c->data != NULL); `}
309 # Internal method to check for reachability of next element
310 private fun i_next_reachable
(c
: CURLSList):Bool `{ return (c != NULL && c->next != NULL); `}
311 # Internal method to get current data
312 private fun i_data(c: CURLSList):String `{ return NativeString_to_s(c->data); `}
313 # Internal method to get next element
314 private fun i_next
(c
: CURLSList):CURLSList `{ return c->next; `}
315 # Convert current low level List to an Array[String] object
316 fun to_a:Array[String]
318 var r = new Array[String]
321 if i_data_reachable(cursor) != true then break
322 r.add(i_data(cursor))
323 cursor = i_next(cursor)
327 # Release allocated memory
328 fun destroy `{ curl_slist_free_all(recv); `}
331 redef class Collection[E
]
332 # Convert Collection[String] to CURLSList
333 fun to_curlslist
: CURLSList
335 assert collectionItemType
: self isa Collection[String] else
336 print
"Collection item must be strings."
338 var primList
= new CURLSList.with_str
(self.first
)
339 for s
in self.skip_head
(1) do primList
.append
(s
)
344 # Array Response type of CCurl::easy_getinfo method
345 class CURLInfoResponseArray
346 var response
:Array[String] = new Array[String]
347 private var prim_response
:CURLSList = new CURLSList
350 # Long Response type of CCurl::easy_getinfo method
351 class CURLInfoResponseLong
355 # Double Response type of CCurl::easy_getinfo method
356 class CURLInfoResponseDouble
360 # String Response type of CCurl:easy_getinfo method
361 class CURLInfoResponseString
362 var response
:String = ""
365 # Reproduce Enum of available CURL SList information, used for CCurl::easy_getinfo
366 extern CURLInfoSList `{ CURLINFO `}
367 new ssl_engines `{ return CURLINFO_SSL_ENGINES; `}
368 new cookielist
`{ return CURLINFO_COOKIELIST; `}
371 # Reproduce Enum of available CURL Long information, used for CCurl::easy_getinfo
372 extern CURLInfoLong `{ CURLINFO `}
373 new response_code
`{ return CURLINFO_RESPONSE_CODE; `}
374 new header_size `{ return CURLINFO_HEADER_SIZE; `}
375 new http_connectcode
`{ return CURLINFO_HTTP_CONNECTCODE; `}
376 new filetime `{ return CURLINFO_FILETIME; `}
377 new redirect_count
`{ return CURLINFO_REDIRECT_COUNT; `}
378 new request_size `{ return CURLINFO_REQUEST_SIZE; `}
379 new ssl_verifyresult
`{ return CURLINFO_SSL_VERIFYRESULT; `}
380 new httpauth_avail `{ return CURLINFO_HTTPAUTH_AVAIL; `}
381 new proxyauth_avail
`{ return CURLINFO_PROXYAUTH_AVAIL; `}
382 new os_errno `{ return CURLINFO_OS_ERRNO; `}
383 new num_connects
`{ return CURLINFO_NUM_CONNECTS; `}
384 new primary_port `{ return CURLINFO_PRIMARY_PORT; `}
385 new local_port
`{ return CURLINFO_LOCAL_PORT; `}
386 new lastsocket `{ return CURLINFO_LASTSOCKET; `}
387 new condition_unmet
`{ return CURLINFO_CONDITION_UNMET; `}
388 new rtsp_client_cseq `{ return CURLINFO_RTSP_CLIENT_CSEQ; `}
389 new rtsp_server_cseq
`{ return CURLINFO_RTSP_SERVER_CSEQ; `}
390 new rtsp_cseq_recv `{ return CURLINFO_RTSP_CSEQ_RECV; `}
393 # Reproduce Enum of available CURL Double information, used for CCurl::easy_getinfo
394 extern CURLInfoDouble `{ CURLINFO `}
395 new total_time `{ return CURLINFO_TOTAL_TIME; `}
396 new namelookup_time
`{ return CURLINFO_NAMELOOKUP_TIME; `}
397 new connect_time `{ return CURLINFO_CONNECT_TIME; `}
398 new appconnect_time
`{ return CURLINFO_APPCONNECT_TIME; `}
399 new pretransfer_time `{ return CURLINFO_PRETRANSFER_TIME; `}
400 new starttransfer_time
`{ return CURLINFO_STARTTRANSFER_TIME; `}
401 new redirect_time `{ return CURLINFO_REDIRECT_TIME; `}
402 new size_upload
`{ return CURLINFO_SIZE_UPLOAD; `}
403 new size_download `{ return CURLINFO_SIZE_DOWNLOAD; `}
404 new speed_download
`{ return CURLINFO_SPEED_DOWNLOAD; `}
405 new speed_upload `{ return CURLINFO_SPEED_UPLOAD; `}
406 new content_length_download
`{ return CURLINFO_CONTENT_LENGTH_DOWNLOAD; `}
407 new content_length_upload `{ return CURLINFO_CONTENT_LENGTH_UPLOAD; `}
410 # Reproduce Enum of available CURL Chars information, used for CCurl::easy_getinfo
411 extern CURLInfoChars `{ CURLINFO `}
412 new content_type `{ return CURLINFO_CONTENT_TYPE; `}
413 new effective_url
`{ return CURLINFO_EFFECTIVE_URL; `}
414 new redirect_url `{ return CURLINFO_REDIRECT_URL; `}
415 new primary_ip
`{ return CURLINFO_PRIMARY_IP; `}
416 new local_ip `{ return CURLINFO_LOCAL_IP; `}
417 new ftp_entry_path
`{ return CURLINFO_FTP_ENTRY_PATH; `}
418 new rtsp_session_id `{ return CURLINFO_RTSP_SESSION_ID; `}
419 new private_data
`{ return CURLINFO_PRIVATE; `}
422 # Reproduce Enum of HTTP Status Code
423 extern CURLStatusCode `{ int `}
424 new proceed
`{ return 100; `}
425 new switching_protocols `{ return 101; `}
426 new ok
`{ return 200; `}
427 new created `{ return 201; `}
428 new accepted
`{ return 202; `}
429 new non_authoritative_information `{ return 203; `}
430 new no_content
`{ return 204; `}
431 new reset_content `{ return 205; `}
432 new partial_content
`{ return 206; `}
433 new multiple_choices `{ return 300; `}
434 new moved_permanently
`{ return 301; `}
435 new moved_temporarily `{ return 302; `}
436 new see_other
`{ return 303; `}
437 new not_modified `{ return 304; `}
438 new use_proxy
`{ return 305; `}
439 new bad_request `{ return 400; `}
440 new unauthorized
`{ return 401; `}
441 new payment_required `{ return 402; `}
442 new forbidden
`{ return 403; `}
443 new not_found `{ return 404; `}
444 new method_not_allowed
`{ return 405; `}
445 new not_acceptable `{ return 406; `}
446 new proxy_authentication_required
`{ return 407; `}
447 new request_timeout `{ return 408; `}
448 new conflict
`{ return 409; `}
449 new gone `{ return 410; `}
450 new length_required
`{ return 411; `}
451 new precondition_failed `{ return 412; `}
452 new request_entity_too_large
`{ return 413; `}
453 new request_uri_too_large `{ return 414; `}
454 new unsupported_media_type
`{ return 415; `}
455 new internal_server_error `{ return 500; `}
456 new not_implemented
`{ return 501; `}
457 new bad_gateway `{ return 502; `}
458 new service_unavailable
`{ return 503; `}
459 new gateway_timeout `{ return 504; `}
460 new http_version_not_supported
`{ return 505; `}
461 fun to_i:Int `{ return recv; `}
464 # Reproduce Enum of CURL Options usable, used for CCurl::easy_setopt
465 extern CURLOption `{ CURLoption `}
466 new write_function `{ return CURLOPT_WRITEFUNCTION; `}
467 new write_data
`{ return CURLOPT_WRITEDATA; `}
468 # new `{ return CURLOPT_FILE; `}
469 new url
`{ return CURLOPT_URL; `}
470 # new `{ return CURLOPT_PORT; `}
471 # new `{ return CURLOPT_PROXY; `}
472 # new `{ return CURLOPT_USERPWD; `}
473 # new `{ return CURLOPT_PROXYUSERPWD; `}
474 # new `{ return CURLOPT_RANGE; `}
475 # new `{ return CURLOPT_INFILE; `}
476 # new `{ return CURLOPT_ERRORBUFFER; `}
477 # new `{ return CURLOPT_WRITEFUNCTION; `}
478 # new `{ return CURLOPT_READFUNCTION; `}
479 # new `{ return CURLOPT_TIMEOUT; `}
480 # new `{ return CURLOPT_INFILESIZE; `}
481 new postfields
`{ return CURLOPT_POSTFIELDS; `}
482 # new `{ return CURLOPT_REFERER; `}
483 # new `{ return CURLOPT_FTPPORT; `}
484 # new `{ return CURLOPT_USERAGENT; `}
485 # new `{ return CURLOPT_LOW_SPEED_LIMIT; `}
486 # new `{ return CURLOPT_LOW_SPEED_TIME; `}
487 # new `{ return CURLOPT_RESUME_FROM; `}
488 # new `{ return CURLOPT_COOKIE; `}
489 new httpheader
`{ return CURLOPT_HTTPHEADER; `}
490 # new `{ return CURLOPT_HTTPPOST; `}
491 # new `{ return CURLOPT_SSLCERT; `}
492 # new `{ return CURLOPT_KEYPASSWD; `}
493 # new `{ return CURLOPT_CRLF; `}
494 # new `{ return CURLOPT_QUOTE; `}
495 # new `{ return CURLOPT_WRITEHEADER; `}
496 # new `{ return CURLOPT_COOKIEFILE; `}
497 # new `{ return CURLOPT_SSLVERSION; `}
498 # new `{ return CURLOPT_TIMECONDITION; `}
499 # new `{ return CURLOPT_TIMEVALUE; `}
500 # new `{ return CURLOPT_CUSTOMREQUEST; `}
501 # new `{ return CURLOPT_STDERR; `}
502 # new `{ return CURLOPT_POSTQUOTE; `}
503 # new `{ return CURLOPT_WRITEINFO; `} /* DEPRECATED, do not use! */
504 new verbose
`{ return CURLOPT_VERBOSE; `} # talk a lot
505 new header `{ return CURLOPT_HEADER; `} # throw the header out too
506 new no_progress
`{ return CURLOPT_NOPROGRESS; `} # shut off the progress meter
507 new no_body `{ return CURLOPT_NOBODY; `} # use HEAD to get http document
508 new fail_on_error
`{ return CURLOPT_FAILONERROR; `} # no output on http error codes >= 300
509 new upload `{ return CURLOPT_UPLOAD; `} # this is an upload
510 new post
`{ return CURLOPT_POST; `} # HTTP POST method
511 new dir_list_only `{ return CURLOPT_DIRLISTONLY; `} # bare names when listing directories
512 new append
`{ return CURLOPT_APPEND; `} # Append instead of overwrite on upload!
513 # new `{ return CURLOPT_NETRC; `}
514 new follow_location
`{ return CURLOPT_FOLLOWLOCATION; `} # use Location: Luke!
515 new transfert_text `{ return CURLOPT_TRANSFERTEXT; `} # transfer data in text/ASCII format
516 new put
`{ return CURLOPT_PUT; `} # HTTP PUT */
517 # new `{ return CURLOPT_PROGRESSFUNCTION; `}
518 # new `{ return CURLOPT_PROGRESSDATA; `}
519 # new `{ return CURLOPT_AUTOREFERER; `}
520 # new `{ return CURLOPT_PROXYPORT; `}
521 # new `{ return CURLOPT_POSTFIELDSIZE; `}
522 # new `{ return CURLOPT_HTTPPROXYTUNNEL; `}
523 # new `{ return CURLOPT_INTERFACE; `}
524 # new `{ return CURLOPT_KRBLEVEL; `}
525 # new `{ return CURLOPT_SSL_VERIFYPEER; `}
526 # new `{ return CURLOPT_CAINFO; `}
527 # new `{ return CURLOPT_MAXREDIRS; `}
528 # new `{ return CURLOPT_FILETIME; `}
529 # new `{ return CURLOPT_TELNETOPTIONS; `}
530 # new `{ return CURLOPT_MAXCONNECTS; `}
531 # new `{ return CURLOPT_CLOSEPOLICY; `} /* DEPRECATED, do not use! */
532 # new `{ return CURLOPT_FRESH_CONNECT; `}
533 # new `{ return CURLOPT_FORBID_REUSE; `}
534 # new `{ return CURLOPT_RANDOM_FILE; `}
535 # new `{ return CURLOPT_EGDSOCKET; `}
536 # new `{ return CURLOPT_CONNECTTIMEOUT; `}
537 # new `{ return CURLOPT_HEADERFUNCTION; `}
538 # new `{ return CURLOPT_HTTPGET; `}
539 # new `{ return CURLOPT_SSL_VERIFYHOST; `}
540 # new `{ return CURLOPT_COOKIEJAR; `}
541 # new `{ return CURLOPT_SSL_CIPHER_LIST; `}
542 # new `{ return CURLOPT_HTTP_VERSION; `}
543 # new `{ return CURLOPT_FTP_USE_EPSV; `}
544 # new `{ return CURLOPT_SSLCERTTYPE; `}
545 # new `{ return CURLOPT_SSLKEY; `}
546 # new `{ return CURLOPT_SSLKEYTYPE; `}
547 # new `{ return CURLOPT_SSLENGINE; `}
548 # new `{ return CURLOPT_SSLENGINE_DEFAULT; `}
549 # new `{ return CURLOPT_DNS_USE_GLOBAL_CACHE; `} /* DEPRECATED, do not use! */
550 # new `{ return CURLOPT_DNS_CACHE_TIMEOUT; `}
551 # new `{ return CURLOPT_PREQUOTE; `}
552 # new `{ return CURLOPT_DEBUGFUNCTION; `}
553 # new `{ return CURLOPT_DEBUGDATA; `}
554 # new `{ return CURLOPT_COOKIESESSION; `}
555 # new `{ return CURLOPT_CAPATH; `}
556 # new `{ return CURLOPT_BUFFERSIZE; `}
557 # new `{ return CURLOPT_NOSIGNAL; `}
558 # new `{ return CURLOPT_SHARE; `}
559 # new `{ return CURLOPT_PROXYTYPE; `}
560 # new `{ return CURLOPT_ACCEPT_ENCODING; `}
561 # new `{ return CURLOPT_PRIVATE; `}
562 # new `{ return CURLOPT_HTTP200ALIASES; `}
563 # new `{ return CURLOPT_UNRESTRICTED_AUTH; `}
564 # new `{ return CURLOPT_FTP_USE_EPRT; `}
565 # new `{ return CURLOPT_HTTPAUTH; `}
566 # new `{ return CURLOPT_SSL_CTX_FUNCTION; `}
567 # new `{ return CURLOPT_SSL_CTX_DATA; `}
568 # new `{ return CURLOPT_FTP_CREATE_MISSING_DIRS; `}
569 # new `{ return CURLOPT_PROXYAUTH; `}
570 # new `{ return CURLOPT_FTP_RESPONSE_TIMEOUT; `}
571 # new `{ return CURLOPT_IPRESOLVE; `}
572 # new `{ return CURLOPT_MAXFILESIZE; `}
573 # new `{ return CURLOPT_INFILESIZE_LARGE; `}
574 # new `{ return CURLOPT_RESUME_FROM_LARGE; `}
575 # new `{ return CURLOPT_MAXFILESIZE_LARGE; `}
576 # new `{ return CURLOPT_NETRC_FILE; `}
577 # new `{ return CURLOPT_USE_SSL; `}
578 # new `{ return CURLOPT_POSTFIELDSIZE_LARGE; `}
579 # new `{ return CURLOPT_TCP_NODELAY; `}
580 # new `{ return CURLOPT_FTPSSLAUTH; `}
581 # new `{ return CURLOPT_IOCTLFUNCTION; `}
582 # new `{ return CURLOPT_IOCTLDATA; `}
583 # new `{ return CURLOPT_FTP_ACCOUNT; `}
584 # new `{ return CURLOPT_COOKIELIST; `}
585 # new `{ return CURLOPT_IGNORE_CONTENT_LENGTH; `}
586 # new `{ return CURLOPT_FTP_SKIP_PASV_IP; `}
587 # new `{ return CURLOPT_FTP_FILEMETHOD; `}
588 # new `{ return CURLOPT_LOCALPORT; `}
589 # new `{ return CURLOPT_LOCALPORTRANGE; `}
590 # new `{ return CURLOPT_CONNECT_ONLY; `}
591 # new `{ return CURLOPT_CONV_FROM_NETWORK_FUNCTION; `}
592 # new `{ return CURLOPT_CONV_TO_NETWORK_FUNCTION; `}
593 # new `{ return CURLOPT_CONV_FROM_UTF8_FUNCTION; `}
594 # new `{ return CURLOPT_MAX_SEND_SPEED_LARGE; `}
595 # new `{ return CURLOPT_MAX_RECV_SPEED_LARGE; `}
596 # new `{ return CURLOPT_FTP_ALTERNATIVE_TO_USER; `}
597 # new `{ return CURLOPT_SOCKOPTFUNCTION; `}
598 # new `{ return CURLOPT_SOCKOPTDATA; `}
599 # new `{ return CURLOPT_SSL_SESSIONID_CACHE; `}
600 # new `{ return CURLOPT_SSH_AUTH_TYPES; `}
601 # new `{ return CURLOPT_SSH_PUBLIC_KEYFILE; `}
602 # new `{ return CURLOPT_SSH_PRIVATE_KEYFILE; `}
603 # new `{ return CURLOPT_FTP_SSL_CCC; `}
604 # new `{ return CURLOPT_TIMEOUT_MS; `}
605 # new `{ return CURLOPT_CONNECTTIMEOUT_MS; `}
606 # new `{ return CURLOPT_HTTP_TRANSFER_DECODING; `}
607 # new `{ return CURLOPT_HTTP_CONTENT_DECODING; `}
608 # new `{ return CURLOPT_NEW_FILE_PERMS; `}
609 # new `{ return CURLOPT_NEW_DIRECTORY_PERMS; `}
610 # new `{ return CURLOPT_POSTREDIR; `}
611 # new `{ return CURLOPT_SSH_HOST_PUBLIC_KEY_MD5; `}
612 # new `{ return CURLOPT_OPENSOCKETFUNCTION; `}
613 # new `{ return CURLOPT_OPENSOCKETDATA; `}
614 # new `{ return CURLOPT_COPYPOSTFIELDS; `}
615 # new `{ return CURLOPT_PROXY_TRANSFER_MODE; `}
616 # new `{ return CURLOPT_SEEKFUNCTION; `}
617 # new `{ return CURLOPT_SEEKDATA; `}
618 # new `{ return CURLOPT_CRLFILE; `}
619 # new `{ return CURLOPT_ISSUERCERT; `}
620 # new `{ return CURLOPT_ADDRESS_SCOPE; `}
621 # new `{ return CURLOPT_CERTINFO; `}
622 new username
`{ return CURLOPT_USERNAME; `}
623 new password `{ return CURLOPT_PASSWORD; `}
624 # new `{ return CURLOPT_PROXYUSERNAME; `}
625 # new `{ return CURLOPT_PROXYPASSWORD; `}
626 # new `{ return CURLOPT_NOPROXY; `}
627 # new `{ return CURLOPT_TFTP_BLKSIZE; `}
628 # new `{ return CURLOPT_SOCKS5_GSSAPI_SERVICE; `}
629 # new `{ return CURLOPT_SOCKS5_GSSAPI_NEC; `}
630 # new `{ return CURLOPT_PROTOCOLS; `}
631 # new `{ return CURLOPT_REDIR_PROTOCOLS; `}
632 # new `{ return CURLOPT_SSH_KNOWNHOSTS; `}
633 # new `{ return CURLOPT_SSH_KEYFUNCTION; `}
634 # new `{ return CURLOPT_SSH_KEYDATA; `}
635 new mail_from
`{ return CURLOPT_MAIL_FROM; `}
636 new mail_rcpt `{ return CURLOPT_MAIL_RCPT; `}
637 # new `{ return CURLOPT_FTP_USE_PRET; `}
638 # new `{ return CURLOPT_RTSP_REQUEST; `}
639 # new `{ return CURLOPT_RTSP_SESSION_ID; `}
640 # new `{ return CURLOPT_RTSP_STREAM_URI; `}
641 # new `{ return CURLOPT_RTSP_TRANSPORT; `}
642 # new `{ return CURLOPT_RTSP_CLIENT_CSEQ; `}
643 # new `{ return CURLOPT_RTSP_SERVER_CSEQ; `}
644 # new `{ return CURLOPT_INTERLEAVEDATA; `}
645 # new `{ return CURLOPT_INTERLEAVEFUNCTION; `}
646 # new `{ return CURLOPT_WILDCARDMATCH; `}
647 # new `{ return CURLOPT_CHUNK_BGN_FUNCTION; `}
648 # new `{ return CURLOPT_CHUNK_END_FUNCTION; `}
649 # new `{ return CURLOPT_FNMATCH_FUNCTION; `}
650 # new `{ return CURLOPT_CHUNK_DATA; `}
651 # new `{ return CURLOPT_FNMATCH_DATA; `}
652 # new `{ return CURLOPT_RESOLVE; `}
653 # new `{ return CURLOPT_TLSAUTH_USERNAME; `}
654 # new `{ return CURLOPT_TLSAUTH_PASSWORD; `}
655 # new `{ return CURLOPT_TLSAUTH_TYPE; `}
656 # new `{ return CURLOPT_TRANSFER_ENCODING; `}
657 # new `{ return CURLOPT_CLOSESOCKETFUNCTION; `}
658 # new `{ return CURLOPT_CLOSESOCKETDATA; `}
659 # new `{ return CURLOPT_GSSAPI_DELEGATION; `}
660 # new `{ return CURLOPT_DNS_SERVERS; `}
661 # new `{ return CURLOPT_ACCEPTTIMEOUT_MS; `}
662 # new `{ return CURLOPT_TCP_KEEPALIVE; `}
663 # new `{ return CURLOPT_TCP_KEEPIDLE; `}
664 # new `{ return CURLOPT_TCP_KEEPINTVL; `}
665 # new `{ return CURLOPT_SSL_OPTIONS; `}
666 # new `{ return CURLOPT_MAIL_AUTH; `}