2010-06-02 16:13:02 +04:00
|
|
|
#ifndef HEADER_CURL_WILDCARD_H
|
|
|
|
#define HEADER_CURL_WILDCARD_H
|
2010-05-12 17:33:22 +04:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2019-05-05 18:08:21 +03:00
|
|
|
* Copyright (C) 2010 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2010-05-12 17:33:22 +04:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
2016-02-03 02:19:02 +03:00
|
|
|
* are also available at https://curl.haxx.se/docs/copyright.html.
|
2010-05-12 17:33:22 +04:00
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
|
|
|
|
2019-05-05 18:08:21 +03:00
|
|
|
#include "curl_setup.h"
|
2010-05-12 17:33:22 +04:00
|
|
|
|
2019-05-05 18:08:21 +03:00
|
|
|
#ifndef CURL_DISABLE_FTP
|
2017-04-03 11:32:43 +03:00
|
|
|
#include "llist.h"
|
|
|
|
|
2010-05-12 17:33:22 +04:00
|
|
|
/* list of wildcard process states */
|
|
|
|
typedef enum {
|
2017-04-03 11:32:43 +03:00
|
|
|
CURLWC_CLEAR = 0,
|
|
|
|
CURLWC_INIT = 1,
|
2010-05-12 17:33:22 +04:00
|
|
|
CURLWC_MATCHING, /* library is trying to get list of addresses for
|
|
|
|
downloading */
|
|
|
|
CURLWC_DOWNLOADING,
|
|
|
|
CURLWC_CLEAN, /* deallocate resources and reset settings */
|
|
|
|
CURLWC_SKIP, /* skip over concrete file */
|
|
|
|
CURLWC_ERROR, /* error cases */
|
2013-02-01 03:43:20 +04:00
|
|
|
CURLWC_DONE /* if is wildcard->state == CURLWC_DONE wildcard loop
|
|
|
|
will end */
|
2010-05-12 17:33:22 +04:00
|
|
|
} curl_wildcard_states;
|
|
|
|
|
2018-04-20 11:29:44 +03:00
|
|
|
typedef void (*curl_wildcard_dtor)(void *ptr);
|
2010-05-12 17:33:22 +04:00
|
|
|
|
|
|
|
/* struct keeping information about wildcard download process */
|
|
|
|
struct WildcardData {
|
|
|
|
curl_wildcard_states state;
|
|
|
|
char *path; /* path to the directory, where we trying wildcard-match */
|
|
|
|
char *pattern; /* wildcard pattern */
|
2017-04-03 11:32:43 +03:00
|
|
|
struct curl_llist filelist; /* llist with struct Curl_fileinfo */
|
2018-04-20 11:29:44 +03:00
|
|
|
void *protdata; /* pointer to protocol specific temporary data */
|
|
|
|
curl_wildcard_dtor dtor;
|
2010-05-12 17:33:22 +04:00
|
|
|
void *customptr; /* for CURLOPT_CHUNK_DATA pointer */
|
|
|
|
};
|
|
|
|
|
|
|
|
CURLcode Curl_wildcard_init(struct WildcardData *wc);
|
|
|
|
void Curl_wildcard_dtor(struct WildcardData *wc);
|
|
|
|
|
2016-06-21 16:47:12 +03:00
|
|
|
struct Curl_easy;
|
2010-05-12 17:33:22 +04:00
|
|
|
|
2019-05-05 18:08:21 +03:00
|
|
|
#else
|
|
|
|
/* FTP is disabled */
|
|
|
|
#define Curl_wildcard_dtor(x)
|
|
|
|
#endif
|
|
|
|
|
2010-06-02 16:13:02 +04:00
|
|
|
#endif /* HEADER_CURL_WILDCARD_H */
|