1CURLOPT_FNMATCH_DATA(3)    curl_easy_setopt options    CURLOPT_FNMATCH_DATA(3)
2
3
4

NAME

6       CURLOPT_FNMATCH_DATA - pointer passed to the fnmatch callback
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FNMATCH_DATA,
12                                 void *pointer);
13

DESCRIPTION

15       Pass  a pointer that will be untouched by libcurl and passed as the ptr
16       argument to the CURLOPT_FNMATCH_FUNCTION(3).
17

DEFAULT

19       NULL
20

PROTOCOLS

22       FTP
23

EXAMPLE

25       static int my_fnmatch(void *clientp,
26                             const char *pattern, const char *string)
27       {
28         struct local_stuff *data = (struct local_stuff *)clientp;
29         if(string_match(pattern, string))
30           return CURL_FNMATCHFUNC_MATCH;
31         else
32           return CURL_FNMATCHFUNC_NOMATCH;
33       }
34
35       {
36         struct local_stuff local_data;
37         curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.example.com/file*");
38         curl_easy_setopt(curl, CURLOPT_WILDCARDMATCH, 1L);
39         curl_easy_setopt(curl, CURLOPT_FNMATCH_FUNCTION, my_fnmatch);
40         curl_easy_setopt(curl, CURLOPT_FNMATCH_DATA, &local_data);
41       }
42

AVAILABILITY

44       Added in 7.21.0
45

RETURN VALUE

47       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
48       if not.
49

SEE ALSO

51       CURLOPT_FNMATCH_FUNCTION(3), CURLOPT_WILDCARDMATCH(3),
52
53
54
55libcurl 8.0.1                  January 02, 2023        CURLOPT_FNMATCH_DATA(3)
Impressum