View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000312 | Ecere SDK | ide | public | 2010-02-03 07:10 | 2016-04-19 05:19 |
Reporter | sacrebleu | Assigned To | |||
Priority | low | Severity | feature | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Target Version | 0.46 eC II | ||||
Summary | 0000312: Support for GCC type checking | ||||
Description | /* evaluates to true if option takes a long argument */ #define _curl_is_long_option(option) \ (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT) #define _curl_is_off_t_option(option) \ ((option) > CURLOPTTYPE_OFF_T) #define curl_easy_setopt(handle, option, value) \ __extension__ ({ \ __typeof__ (option) _curl_opt = option; \ if (__builtin_constant_p(_curl_opt)) { \ if (_curl_is_long_option(_curl_opt) && !_curl_is_long(value)) \ _curl_easy_setopt_err_long(); \ if (_curl_is_off_t_option(_curl_opt) && !_curl_is_off_t(value)) \ _curl_easy_setopt_err_curl_off_t(); \ if (_curl_is_string_option(_curl_opt) && !_curl_is_string(value)) \ _curl_easy_setopt_err_string(); \ if (_curl_is_write_cb_option(_curl_opt) && !_curl_is_write_cb(value)) \ _curl_easy_setopt_err_write_callback(); \ if ((_curl_opt) == CURLOPT_READFUNCTION && !_curl_is_read_cb(value)) \ _curl_easy_setopt_err_read_cb(); \ if ((_curl_opt) == CURLOPT_IOCTLFUNCTION && !_curl_is_ioctl_cb(value)) \ _curl_easy_setopt_err_ioctl_cb(); \ if ((_curl_opt) == CURLOPT_SOCKOPTFUNCTION && !_curl_is_sockopt_cb(value))\ _curl_easy_setopt_err_sockopt_cb(); \ if ((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION && \ !_curl_is_opensocket_cb(value)) \ _curl_easy_setopt_err_opensocket_cb(); \ if ((_curl_opt) == CURLOPT_PROGRESSFUNCTION && \ !_curl_is_progress_cb(value)) \ _curl_easy_setopt_err_progress_cb(); \ if ((_curl_opt) == CURLOPT_DEBUGFUNCTION && !_curl_is_debug_cb(value)) \ _curl_easy_setopt_err_debug_cb(); \ if ((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION && \ !_curl_is_ssl_ctx_cb(value)) \ _curl_easy_setopt_err_ssl_ctx_cb(); \ if (_curl_is_conv_cb_option(_curl_opt) && !_curl_is_conv_cb(value)) \ _curl_easy_setopt_err_conv_cb(); \ if ((_curl_opt) == CURLOPT_SEEKFUNCTION && !_curl_is_seek_cb(value)) \ _curl_easy_setopt_err_seek_cb(); \ if (_curl_is_cb_data_option(_curl_opt) && !_curl_is_cb_data(value)) \ _curl_easy_setopt_err_cb_data(); \ if ((_curl_opt) == CURLOPT_ERRORBUFFER && !_curl_is_error_buffer(value)) \ _curl_easy_setopt_err_error_buffer(); \ if ((_curl_opt) == CURLOPT_STDERR && !_curl_is_FILE(value)) \ _curl_easy_setopt_err_FILE(); \ if (_curl_is_postfields_option(_curl_opt) && !_curl_is_postfields(value)) \ _curl_easy_setopt_err_postfields(); \ if ((_curl_opt) == CURLOPT_HTTPPOST && \ !_curl_is_arr((value), struct curl_httppost)) \ _curl_easy_setopt_err_curl_httpost(); \ if (_curl_is_slist_option(_curl_opt) && \ !_curl_is_arr((value), struct curl_slist)) \ _curl_easy_setopt_err_curl_slist(); \ if ((_curl_opt) == CURLOPT_SHARE && !_curl_is_ptr((value), CURLSH)) \ _curl_easy_setopt_err_CURLSH(); \ } \ curl_easy_setopt(handle, _curl_opt, value); \ }) | ||||
Additional Information | // afflicted code #define WIN32_LEAN_AND_MEAN #include <windows.h> #define CURL_STATICLIB 1 #include <curl/curl.h> #include <curl/types.h> #include <curl/easy.h> import "ecere" /* * tasty cURL Method Wrapper Classes */ class cURLEasy { //public: CURL *handle; // property URL { get { return URL; } set { delete URL; URL=CopyString(value); curl_easy_setopt(handle,CURLOPT_URL,value); } }; // char *URL; char *error; char *version; CURLcode status; cURLEasy() { handle = curl_easy_init(); } ~cURLEasy() { curl_easy_cleanup(handle); if ( error ) curl_free(error); delete URL; } void postTo( char *url, char *fields ) { curl_easy_setopt(handle, CURLOPT_URL, url); curl_easy_setopt(handle, CURLOPT_POSTFIELDS, fields); Perform(); } CURL *Duplicate() { return curl_easy_duphandle(handle); } CURLcode Perform() { return (status=curl_easy_perform(handle)); } void GetInfo() { } char *getVersion() { } char *getError() { if ( error ) curl_free(error); error=curl_easy_strerror(status); } }; /* class cURLForm : cURLEasy { struct curl_httppost *formpost;//=NULL; struct curl_httppost *lastptr;//=NULL; struct curl_slist *headerlist;//=NULL; bool NoExpectHeader; // Fill in the file upload field void File( char *name, char *filename ) { curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, name, CURLFORM_FILE, filename, CURLFORM_END); } // Fill in the filename field void Field( char *name, char *content ) { curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, name, CURLFORM_COPYCONTENTS, content, CURLFORM_END); } // Fill in the submit field too, even if this is rarely needed void Submit( char *content ) { curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "submit", CURLFORM_COPYCONTENTS, content, CURLFORM_END); } void Post( char *url ) { headerlist = curl_slist_append(headerlist, "Expect:"); if(handle) { curl_easy_setopt(handle, CURLOPT_URL, url); if ( NoExpectHeader ) curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headerlist); curl_easy_setopt(handle, CURLOPT_HTTPPOST, formpost); status = curl_easy_perform(handle); // curl_easy_cleanup(handle); (handled automatically) curl_formfree(formpost); curl_slist_free_all(headerlist); } } }; */ class cURLMulti { }; class cURLShare { }; | ||||
Tags | No tags attached. | ||||
|
http://haskell.forkio.com/Home/curl-win32 <- link is at the bottom |
|
// THIS BUILDS: #define CURL_DISABLE_TYPECHECK #define WIN32_LEAN_AND_MEAN #define CURL_STATICLIB 1 #include <curl/curl.h> import "ecere" /* * tasty cURL Method Wrapper Classes */ class cURLEasy { //public: CURL *handle; // property URL { get { return URL; } set { delete URL; URL=CopyString(value); curl_easy_setopt(handle,CURLOPT_URL,value); } }; char *URL; char *error; char *version; CURLcode status; cURLEasy() { handle = curl_easy_init(); } ~cURLEasy() { curl_easy_cleanup(handle); if ( error ) curl_free(error); delete URL; } void postTo( char *url, char *fields ) { curl_easy_setopt(handle, CURLOPT_URL, url); curl_easy_setopt(handle, CURLOPT_POSTFIELDS, fields); Perform(); } CURL *Duplicate() { return curl_easy_duphandle(handle); } CURLcode Perform() { return (status=curl_easy_perform(handle)); } void GetInfo() { } char *getVersion() { } char *getError() { if ( error ) curl_free(error); error=curl_easy_strerror(status); } }; /* class cURLForm : cURLEasy { struct curl_httppost *formpost;//=NULL; struct curl_httppost *lastptr;//=NULL; struct curl_slist *headerlist;//=NULL; bool NoExpectHeader; // Fill in the file upload field void File( char *name, char *filename ) { curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, name, CURLFORM_FILE, filename, CURLFORM_END); } // Fill in the filename field void Field( char *name, char *content ) { curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, name, CURLFORM_COPYCONTENTS, content, CURLFORM_END); } // Fill in the submit field too, even if this is rarely needed void Submit( char *content ) { curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "submit", CURLFORM_COPYCONTENTS, content, CURLFORM_END); } void Post( char *url ) { headerlist = curl_slist_append(headerlist, "Expect:"); if(handle) { curl_easy_setopt(handle, CURLOPT_URL, url); if ( NoExpectHeader ) curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headerlist); curl_easy_setopt(handle, CURLOPT_HTTPPOST, formpost); status = curl_easy_perform(handle); // curl_easy_cleanup(handle); (handled automatically) curl_formfree(formpost); curl_slist_free_all(headerlist); } } }; */ class cURLMulti { }; class cURLShare { }; |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-02-03 07:10 | sacrebleu | New Issue | |
2010-02-03 07:10 | sacrebleu | Status | new => assigned |
2010-02-03 07:10 | sacrebleu | Assigned To | => jerome |
2010-02-03 19:28 | sacrebleu | Note Added: 0000147 | |
2010-02-23 05:08 | jerome | Note Added: 0000148 | |
2010-02-23 05:18 | jerome | Priority | immediate => low |
2010-02-23 05:18 | jerome | Severity | block => feature |
2010-02-23 05:18 | jerome | Summary | crazy long filename output => Support for GCC type checking |
2010-02-23 05:18 | jerome | Description Updated | |
2010-02-23 05:20 | jerome | Assigned To | jerome => |
2010-02-23 05:20 | jerome | Status | assigned => acknowledged |
2012-03-08 16:52 | redj | Target Version | => 0.45 Ginkakuji |
2012-03-29 07:52 | redj | Category | => ide |
2012-03-29 07:52 | redj | Project | @3@ => Ecere SDK |
2014-07-11 18:25 | jerome | Product Version | => 0.46.1 |
2014-07-11 18:32 | jerome | Target Version | 0.45 Ginkakuji => 0.46.1 |
2016-04-19 05:19 | jerome | Target Version | 0.46.1 => 0.46 eC II |