From 9d87586fcfac565706c22e806ca9816d6abcd3c2 Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Sat, 15 Feb 2014 11:17:02 +0100 Subject: [PATCH] Makes fuse options shared with the fuseapi. This is needed to be able to use the fuse credential with the new Hubic API. --- cloudfsapi.c | 2 ++ cloudfsapi.h | 8 ++++++++ cloudfuse.c | 10 +--------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cloudfsapi.c b/cloudfsapi.c index 58d6a09..db50df6 100644 --- a/cloudfsapi.c +++ b/cloudfsapi.c @@ -33,6 +33,8 @@ static int debug = 0; static int verify_ssl = 1; static int rhel5_mode = 0; +extern FuseOptions options; + #ifdef HAVE_OPENSSL #include static pthread_mutex_t *ssl_lockarray; diff --git a/cloudfsapi.h b/cloudfsapi.h index 08c01a0..7c664cb 100644 --- a/cloudfsapi.h +++ b/cloudfsapi.h @@ -9,6 +9,7 @@ #define MAX_PATH_SIZE (1024 + 256 + 3) #define MAX_URL_SIZE (MAX_PATH_SIZE * 3) #define USER_AGENT "CloudFuse" +#define OPTION_SIZE 1024 typedef struct curl_slist curl_slist; @@ -23,6 +24,13 @@ typedef struct dir_entry struct dir_entry *next; } dir_entry; +typedef struct options { + char username[OPTION_SIZE]; + char password[OPTION_SIZE]; + char cache_timeout[OPTION_SIZE]; + char verify_ssl[OPTION_SIZE]; +} FuseOptions; + void cloudfs_init(); void cloudfs_set_credentials(char *username, char *password); int cloufds_connect(); diff --git a/cloudfuse.c b/cloudfuse.c index 48f7719..08ffb44 100644 --- a/cloudfuse.c +++ b/cloudfuse.c @@ -17,9 +17,6 @@ #include "cloudfsapi.h" #include "config.h" - -#define OPTION_SIZE 1024 - static int cache_timeout; typedef struct dir_cache @@ -424,12 +421,7 @@ char *get_home_dir() return "~"; } -static struct options { - char username[OPTION_SIZE]; - char password[OPTION_SIZE]; - char cache_timeout[OPTION_SIZE]; - char verify_ssl[OPTION_SIZE]; -} options = { +FuseOptions options = { .username = "", .password = "", .cache_timeout = "600",