doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lib502.c
Go to the documentation of this file.
1 #include "test.h"
2 
3 /*
4  * Get a single URL without select().
5  */
6 
7 int test(char *URL)
8 {
9  CURL *c;
10  CURLM *m;
11  CURLMcode res;
12  int running=1;
13 
15  c = curl_easy_init();
16  curl_easy_setopt(c, CURLOPT_URL, URL);
17  m = curl_multi_init();
18 
19  res = curl_multi_add_handle(m, c);
20  while (running) {
21  res = curl_multi_perform(m, &running);
22  if (running <= 0) {
23  fprintf(stderr, "nothing left running.\n");
24  break;
25  }
26  }
30 
31  return res;
32 }
33 
CURLcode curl_global_init(long flags)
Globally initializes cURL given a bitwise set of the different features to initialize.
Definition: easy.c:147
CURLcode curl_easy_setopt(CURL *curl, CURLoption option,...)
Definition: easy.c:217
const GLubyte * c
Definition: glext.h:4677
CURLMcode curl_multi_remove_handle(CURLM *multi_handle, CURL *curl_handle)
Definition: multi.c:182
int test(char *URL)
Definition: lib502.c:7
CURLM * curl_multi_init(void)
Definition: multi.c:114
CURLMcode curl_multi_cleanup(CURLM *multi_handle)
Definition: multi.c:583
CURLMcode
Definition: multi.h:78
CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
Definition: multi.c:306
void CURLM
Definition: multi.h:76
void CURL
Definition: types.h:25
GLuint res
Definition: glext.h:5385
CURLMcode curl_multi_add_handle(CURLM *multi_handle, CURL *curl_handle)
Definition: multi.c:134
#define CURL_GLOBAL_ALL
Definition: curl.h:1153
void curl_easy_cleanup(CURL *curl)
Definition: easy.c:288
CURL * curl_easy_init(void)
Definition: easy.c:195