convert CURLFTP_CREATE_DIR* to long constants

This commit is contained in:
Viktor Szakats 2025-07-01 17:22:02 +02:00
parent 144d201c23
commit 35081fb461
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
2 changed files with 12 additions and 13 deletions

View file

@ -21,11 +21,9 @@ CURLOPT_FTP_CREATE_MISSING_DIRS - create missing directories for FTP and SFTP
~~~c
#include <curl/curl.h>
typedef enum {
CURLFTP_CREATE_DIR_NONE,
CURLFTP_CREATE_DIR,
CURLFTP_CREATE_DIR_RETRY
} curl_ftpcreatedir;
#define CURLFTP_CREATE_DIR_NONE 0L
#define CURLFTP_CREATE_DIR 1L
#define CURLFTP_CREATE_DIR_RETRY 2L
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_CREATE_MISSING_DIRS,
long create);
@ -69,7 +67,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_URL,
"ftp://example.com/non-existing/new.txt");
curl_easy_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS,
(long)CURLFTP_CREATE_DIR_RETRY);
CURLFTP_CREATE_DIR_RETRY);
res = curl_easy_perform(curl);

View file

@ -997,14 +997,15 @@ typedef enum {
} curl_ftpauth;
/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
#define CURLFTP_CREATE_DIR_NONE 0L /* do NOT create missing dirs! */
#define CURLFTP_CREATE_DIR 1L /* (FTP/SFTP) if CWD fails, try MKD and
then CWD again if MKD succeeded, for
SFTP this does similar magic */
#define CURLFTP_CREATE_DIR_RETRY 2L /* (FTP only) if CWD fails, try MKD and
then CWD again even if MKD failed! */
typedef enum {
CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
again if MKD succeeded, for SFTP this does
similar magic */
CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
again even if MKD failed! */
CURLFTP_CREATE_DIR_LAST /* not an option, never use */
CURLFTP_CREATE_DIR_LAST = 3 /* not an option, never use */
} curl_ftpcreatedir;
/* parameter for the CURLOPT_FTP_FILEMETHOD option */