#include "curl/curl.h"Include dependency graph for switch_curl.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Typedefs | |
| typedef void | switch_CURL |
| typedef curl_slist | switch_curl_slist_t |
| typedef int | switch_CURLINFO |
| typedef int | switch_CURLcode |
| typedef int | switch_CURLoption |
Functions | |
| switch_CURL * | switch_curl_easy_init (void) |
| switch_CURLcode | switch_curl_easy_perform (switch_CURL *handle) |
| switch_CURLcode | switch_curl_easy_getinfo (switch_CURL *curl, switch_CURLINFO info,...) |
| void | switch_curl_easy_cleanup (switch_CURL *handle) |
| switch_curl_slist_t * | switch_curl_slist_append (switch_curl_slist_t *list, const char *string) |
| void | switch_curl_slist_free_all (switch_curl_slist_t *list) |
| switch_CURLcode | switch_curl_easy_setopt (CURL *handle, switch_CURLoption option,...) |
| const char * | switch_curl_easy_strerror (switch_CURLcode errornum) |
| void | switch_curl_init (void) |
| void | switch_curl_destroy (void) |
| switch_status_t | switch_curl_process_form_post_params (switch_event_t *event, switch_CURL *curl_handle, struct curl_httppost **formpostp) |
| typedef void switch_CURL |
Definition at line 36 of file switch_curl.h.
| typedef struct curl_slist switch_curl_slist_t |
Definition at line 37 of file switch_curl.h.
| typedef int switch_CURLcode |
Definition at line 39 of file switch_curl.h.
| typedef int switch_CURLINFO |
Definition at line 38 of file switch_curl.h.
| typedef int switch_CURLoption |
Definition at line 40 of file switch_curl.h.
| void switch_curl_destroy | ( | void | ) |
| void switch_curl_easy_cleanup | ( | switch_CURL * | handle | ) |
| switch_CURLcode switch_curl_easy_getinfo | ( | switch_CURL * | curl, | |
| switch_CURLINFO | info, | |||
| ... | ||||
| ) |
Definition at line 19 of file switch_curl.c.
00020 { 00021 va_list ap; 00022 switch_CURLcode code; 00023 00024 va_start(ap, info); 00025 code = curl_easy_getinfo(curl, info, va_arg(ap, void *)); 00026 va_end(ap); 00027 00028 return code; 00029 }
| switch_CURL* switch_curl_easy_init | ( | void | ) |
| switch_CURLcode switch_curl_easy_perform | ( | switch_CURL * | handle | ) |
| switch_CURLcode switch_curl_easy_setopt | ( | CURL * | handle, | |
| switch_CURLoption | option, | |||
| ... | ||||
| ) |
Definition at line 49 of file switch_curl.c.
References Curl_setopt().
00050 { 00051 va_list ap; 00052 switch_CURLcode code; 00053 00054 va_start(ap, option); 00055 code = Curl_setopt(handle, option, ap); 00056 va_end(ap); 00057 00058 return code; 00059 }
| const char* switch_curl_easy_strerror | ( | switch_CURLcode | errornum | ) |
| void switch_curl_init | ( | void | ) |
| switch_status_t switch_curl_process_form_post_params | ( | switch_event_t * | event, | |
| switch_CURL * | curl_handle, | |||
| struct curl_httppost ** | formpostp | |||
| ) |
Definition at line 76 of file switch_curl.c.
References switch_event_header::name, switch_event_header::next, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_event_header::value.
00077 { 00078 00079 struct curl_httppost *formpost=NULL; 00080 struct curl_httppost *lastptr=NULL; 00081 switch_event_header_t *hp; 00082 int go = 0; 00083 00084 for (hp = event->headers; hp; hp = hp->next) { 00085 if (!strncasecmp(hp->name, "attach_file:", 12)) { 00086 go = 1; 00087 break; 00088 } 00089 } 00090 00091 if (!go) { 00092 return SWITCH_STATUS_FALSE; 00093 } 00094 00095 for (hp = event->headers; hp; hp = hp->next) { 00096 00097 if (!strncasecmp(hp->name, "attach_file:", 12)) { 00098 char *pname = strdup(hp->name + 12); 00099 char *fname = strchr(pname, ':'); 00100 00101 if (fname && pname) { 00102 *fname++ = '\0'; 00103 00104 curl_formadd(&formpost, 00105 &lastptr, 00106 CURLFORM_COPYNAME, pname, 00107 CURLFORM_FILENAME, fname, 00108 CURLFORM_FILE, hp->value, 00109 CURLFORM_END); 00110 } 00111 00112 free(pname); 00113 00114 } else { 00115 curl_formadd(&formpost, 00116 &lastptr, 00117 CURLFORM_COPYNAME, hp->name, 00118 CURLFORM_COPYCONTENTS, hp->value, 00119 CURLFORM_END); 00120 00121 } 00122 } 00123 00124 *formpostp = formpost; 00125 00126 return SWITCH_STATUS_SUCCESS; 00127 00128 }
| switch_curl_slist_t* switch_curl_slist_append | ( | switch_curl_slist_t * | list, | |
| const char * | string | |||
| ) |
Definition at line 38 of file switch_curl.c.
00039 { 00040 return (switch_curl_slist_t *) curl_slist_append((struct curl_slist *)list, string); 00041 }
| void switch_curl_slist_free_all | ( | switch_curl_slist_t * | list | ) |
1.4.7