#include <curl/curl.h>
#include <libxml/parser.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
Include dependency graph for mrss_internal.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | __mrss_download_t__ |
For internal use only. More... | |
Typedefs | |
typedef __mrss_download_t__ | __mrss_download_t |
Functions | |
__mrss_download_t * | __mrss_download_file (char *) |
|
Definition at line 29 of file mrss_internal.h. |
|
Definition at line 53 of file mrss_download.c. References __mrss_memorize_file(), __mrss_download_t__::mm, and __mrss_download_t__::size. Referenced by mrss_parse_url(). 00054 { 00055 __mrss_download_t *chunk; 00056 CURL *curl; 00057 00058 if (!(chunk = (__mrss_download_t *) malloc (sizeof (__mrss_download_t)))) 00059 return NULL; 00060 00061 chunk->mm = NULL; 00062 chunk->size = 0; 00063 00064 curl_global_init (CURL_GLOBAL_DEFAULT); 00065 if (!(curl = curl_easy_init ())) 00066 { 00067 free (chunk); 00068 return NULL; 00069 } 00070 00071 curl_easy_setopt (curl, CURLOPT_URL, fl); 00072 curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, __mrss_memorize_file); 00073 curl_easy_setopt (curl, CURLOPT_FILE, (void *) chunk); 00074 curl_easy_setopt (curl, CURLOPT_TIMEOUT, 10); 00075 00076 if (curl_easy_perform (curl)) 00077 { 00078 if (chunk->mm) 00079 free (chunk->mm); 00080 00081 free (chunk); 00082 00083 curl_easy_cleanup (curl); 00084 curl_global_cleanup (); 00085 00086 return NULL; 00087 } 00088 00089 curl_easy_cleanup (curl); 00090 curl_global_cleanup (); 00091 00092 return chunk; 00093 }
Here is the call graph for this function: ![]() |