// ------------------------------------------------------------------------------------------------
// DESCRIPTION  Cloud filestore access credentials info as used by surgeweb caldav and other 
//	cloud locations for http based event & file access, storage and sharing
// ------------------------------------------------------------------------------------------------
// NOTES  
// ------------------------------------------------------------------------------------------------
#ifndef CLOUD_DONE
#define CLOUD_DONE 1

typedef struct CLOUD { 
	int id; 
	char *type;  int del; 
	
	int local_cal;
	char *desc;
	char *host_url, *root_path, *api_path;
	struct OAUTH *auth;		// Authentication parameters (OAuth, Digest or Basic)
	
	Pair *param; 
	int move;
	struct CLOUD *next;
} Cloud;	// Generic version of CalCred


Cloud *cloud_new(char *name);
void cloud_free(Cloud **l);
void cloud_freeall(Cloud** list);
int cloud_add_atend(Cloud **list, Cloud *ident);
Cloud *cloud_find(Cloud *clouds, int id);
Cloud *cloud_blank(Cloud* clouds);
int cloud_load(Cloud** list, char* fname, int* was_encrypted, char *cal_host_url, char *cal_root_path, char *cloud_email);
int cloud_save(Cloud* clouds, char *fname, int decrypted);
int cloud_findmove(Cloud *clouds);
int cloud_move(Cloud *clouds, int ident, int dir);
int cloud_count(Cloud *clouds);
int cloud_split_fname(char *path_name, char*path,char*name,char*display);



#endif
