mirror of
https://github.com/xorgy/mediafire-fuse
synced 2026-01-13 13:14:29 -08:00
- since mediafire cannot deal with empty files, we put new files into a temporary location and upload them once they get closed - add create and write functions to fuse - pass a file handle to mfconn_api_upload_simple instead of a path - allow calc_sha256 to also compute the file size - error out when the key returned by upload/simple is empty - make valgrind.supp more lenient
79 lines
2.8 KiB
C
79 lines
2.8 KiB
C
/*
|
|
* Copyright (C) 2014 Johannes Schauer <j.schauer@email.de>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License version 2, as published by
|
|
* the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along with
|
|
* this program; if not, write to the Free Software Foundation, Inc., 51
|
|
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*
|
|
*/
|
|
|
|
#ifndef _MFFUSE_HASHTBL_H_
|
|
#define _MFFUSE_HASHTBL_H_
|
|
|
|
#include <fuse/fuse.h>
|
|
#include <stdio.h>
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "../mfapi/mfconn.h"
|
|
|
|
typedef struct folder_tree folder_tree;
|
|
|
|
folder_tree *folder_tree_create(char *filecache);
|
|
|
|
void folder_tree_destroy(folder_tree * tree);
|
|
|
|
int folder_tree_rebuild(folder_tree * tree, mfconn * conn);
|
|
|
|
void folder_tree_housekeep(folder_tree * tree, mfconn * conn);
|
|
|
|
void folder_tree_debug(folder_tree * tree);
|
|
|
|
int folder_tree_getattr(folder_tree * tree, mfconn * conn,
|
|
const char *path, struct stat *stbuf);
|
|
|
|
int folder_tree_readdir(folder_tree * tree, mfconn * conn,
|
|
const char *path, void *buf,
|
|
fuse_fill_dir_t filldir);
|
|
|
|
void folder_tree_update(folder_tree * tree, mfconn * conn);
|
|
|
|
int folder_tree_store(folder_tree * tree, FILE * stream);
|
|
|
|
folder_tree *folder_tree_load(FILE * stream, char *filecache);
|
|
|
|
bool folder_tree_path_exists(folder_tree * tree, mfconn * conn,
|
|
const char *path);
|
|
|
|
uint64_t folder_tree_path_get_num_children(folder_tree * tree,
|
|
mfconn * conn,
|
|
const char *path);
|
|
|
|
bool folder_tree_path_is_directory(folder_tree * tree,
|
|
mfconn * conn, const char *path);
|
|
|
|
const char *folder_tree_path_get_key(folder_tree * tree, mfconn * conn,
|
|
const char *path);
|
|
|
|
bool folder_tree_path_is_root(folder_tree * tree, mfconn * conn,
|
|
const char *path);
|
|
|
|
bool folder_tree_path_is_file(folder_tree * tree, mfconn * conn,
|
|
const char *path);
|
|
|
|
int folder_tree_open_file(folder_tree * tree, mfconn * conn,
|
|
const char *path);
|
|
|
|
int folder_tree_tmp_open(folder_tree * tree);
|
|
|
|
#endif
|