1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
#ifndef _CLOUDFSAPI_H
#define _CLOUDFSAPI_H
#include <curl/curl.h>
#include <curl/easy.h>
#define BUFFER_INITIAL_SIZE 4096
#define MAX_HEADER_SIZE 4096
#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;
typedef struct dir_entry
{
char *name;
char *full_name;
char *content_type;
off_t size;
time_t last_modified;
int isdir;
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];
char client_id[OPTION_SIZE];
char client_secret[OPTION_SIZE];
char redirect_uri[OPTION_SIZE];
} FuseOptions;
void cloudfs_init(void);
void cloudfs_set_credentials(char *username, char *password);
int cloudfs_connect(void);
int cloudfs_object_read_fp(const char *path, FILE *fp);
int cloudfs_object_write_fp(const char *path, FILE *fp);
int cloudfs_list_directory(const char *path, dir_entry **);
int cloudfs_delete_object(const char *path);
int cloudfs_copy_object(const char *src, const char *dst);
int cloudfs_create_directory(const char *label);
int cloudfs_object_truncate(const char *path, off_t size);
off_t cloudfs_file_size(int fd);
void cloudfs_debug(int dbg);
void cloudfs_verify_ssl(int dbg);
void cloudfs_free_dir_list(dir_entry *dir_list);
void debugf(char *fmt, ...);
#endif
|