cmake/Utilities/cmcurl/lib/wildcard.h

68 lines
2.3 KiB
C
Raw Normal View History

2015-04-27 22:25:09 +02:00
#ifndef HEADER_CURL_WILDCARD_H
#define HEADER_CURL_WILDCARD_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
2021-09-14 00:13:48 +02:00
* Copyright (C) 2010 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
2015-04-27 22:25:09 +02:00
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
2021-09-14 00:13:48 +02:00
* are also available at https://curl.se/docs/copyright.html.
2015-04-27 22:25:09 +02: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-11-11 23:01:05 +01:00
#include "curl_setup.h"
2015-04-27 22:25:09 +02:00
2019-11-11 23:01:05 +01:00
#ifndef CURL_DISABLE_FTP
2017-07-20 19:35:53 +02:00
#include "llist.h"
2015-04-27 22:25:09 +02:00
/* list of wildcard process states */
typedef enum {
2017-07-20 19:35:53 +02:00
CURLWC_CLEAR = 0,
CURLWC_INIT = 1,
2015-04-27 22:25:09 +02: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 */
CURLWC_DONE /* if is wildcard->state == CURLWC_DONE wildcard loop
will end */
2021-09-14 00:13:48 +02:00
} wildcard_states;
2015-04-27 22:25:09 +02:00
2021-09-14 00:13:48 +02:00
typedef void (*wildcard_dtor)(void *ptr);
2015-04-27 22:25:09 +02:00
/* struct keeping information about wildcard download process */
struct WildcardData {
2021-09-14 00:13:48 +02:00
wildcard_states state;
2015-04-27 22:25:09 +02:00
char *path; /* path to the directory, where we trying wildcard-match */
char *pattern; /* wildcard pattern */
2021-09-14 00:13:48 +02:00
struct Curl_llist filelist; /* llist with struct Curl_fileinfo */
2018-08-09 18:06:22 +02:00
void *protdata; /* pointer to protocol specific temporary data */
2021-09-14 00:13:48 +02:00
wildcard_dtor dtor;
2015-04-27 22:25:09 +02:00
void *customptr; /* for CURLOPT_CHUNK_DATA pointer */
};
CURLcode Curl_wildcard_init(struct WildcardData *wc);
void Curl_wildcard_dtor(struct WildcardData *wc);
2016-09-11 17:22:32 +02:00
struct Curl_easy;
2015-04-27 22:25:09 +02:00
2019-11-11 23:01:05 +01:00
#else
/* FTP is disabled */
#define Curl_wildcard_dtor(x)
#endif
2015-04-27 22:25:09 +02:00
#endif /* HEADER_CURL_WILDCARD_H */