File: curlc.c

package info (click to toggle)
haskell-curl 1.3.8-15
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 264 kB
  • sloc: haskell: 1,528; ansic: 33; makefile: 2
file content (69 lines) | stat: -rw-r--r-- 1,737 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * Haskell FFI friendly wrappers to curl_easy_* functions
 * for setting/getting option values. Could import these into
 * .hs without too much trouble, but calling out to 'typed'
 * versions saves the C compiler from issuing warnings.
 *
 * (c) 2007-2009, Galois, Inc.
 *
 */
#include <curl/curl.h>

int curl_easy_getinfo_long(void *curl, long tg, long *pl)
{
    return curl_easy_getinfo(curl, CURLINFO_LONG+tg, pl);
}

int curl_easy_getinfo_string(void *curl, long tg, char **s)
{
    return curl_easy_getinfo(curl, CURLINFO_STRING+tg, s);
}

int curl_easy_getinfo_double(void *curl, long tg, double *d)
{
    return curl_easy_getinfo(curl, CURLINFO_DOUBLE+tg, d);
}

int curl_easy_getinfo_slist(void *curl, long tg, char ***s)
{
    return curl_easy_getinfo(curl, CURLINFO_SLIST+tg, s);
}


int curl_easy_setopt_long(void *curl, int i, long x)
{ return curl_easy_setopt(curl,i,x); }

int curl_easy_setopt_longlong(void *curl, int i, long long x)
{ return curl_easy_setopt(curl,i,x); }

int curl_easy_setopt_string(void *curl, int i, char *x)
{ return curl_easy_setopt(curl,i,x); }

int curl_easy_setopt_ptr(void *curl, int i, void *x)
{ return curl_easy_setopt(curl,i,x); }

/*
 * Function curl_version_str()
 *
 * Returns the libcurl version number as a "MAJOR.MINOR.PATCH" string.
 *
 * Note: a static string, so no free()ing required (or asked for! :-)
 */
char*
curl_version_str() {
  return LIBCURL_VERSION;
}

/*
 * Function curl_version_num()
 *
 * Returns the libcurl version number in 3-byte format 0xXXYYZZ,
 * representing major,minor and patch levels. Encoded in a (host)
 * 'int' value, making for easy comparisons.
 *
 * See curlver.h for complete story.
 */
int
curl_version_num() {
  return LIBCURL_VERSION_NUM;
}