2014-09-25 13:05:17 +02:00
|
|
|
/*
|
|
|
|
|
* 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_
|
|
|
|
|
|
2014-09-26 16:08:30 +02:00
|
|
|
#include <fuse/fuse.h>
|
2014-09-27 20:18:02 +02:00
|
|
|
#include <stdio.h>
|
2014-09-28 07:39:13 +02:00
|
|
|
#include <stdbool.h>
|
2014-10-27 14:17:03 +01:00
|
|
|
#include <stdint.h>
|
2014-09-26 16:08:30 +02:00
|
|
|
|
2014-09-25 13:05:17 +02:00
|
|
|
#include "../mfapi/mfconn.h"
|
|
|
|
|
|
|
|
|
|
typedef struct folder_tree folder_tree;
|
|
|
|
|
|
2014-11-03 20:33:48 +01:00
|
|
|
folder_tree *folder_tree_create(char *filecache);
|
2014-09-25 13:05:17 +02:00
|
|
|
|
|
|
|
|
void folder_tree_destroy(folder_tree * tree);
|
|
|
|
|
|
|
|
|
|
int folder_tree_rebuild(folder_tree * tree, mfconn * conn);
|
|
|
|
|
|
2014-09-27 13:53:44 +02:00
|
|
|
void folder_tree_housekeep(folder_tree * tree, mfconn * conn);
|
2014-09-25 13:05:17 +02:00
|
|
|
|
2014-09-28 07:39:13 +02:00
|
|
|
void folder_tree_debug(folder_tree * tree);
|
2014-09-25 13:05:17 +02:00
|
|
|
|
2014-10-19 08:43:57 +02:00
|
|
|
int folder_tree_getattr(folder_tree * tree, mfconn * conn,
|
|
|
|
|
const char *path, struct stat *stbuf);
|
2014-09-26 16:08:30 +02:00
|
|
|
|
2014-10-19 08:43:57 +02:00
|
|
|
int folder_tree_readdir(folder_tree * tree, mfconn * conn,
|
|
|
|
|
const char *path, void *buf,
|
|
|
|
|
fuse_fill_dir_t filldir);
|
2014-09-26 16:08:30 +02:00
|
|
|
|
2014-09-27 13:53:44 +02:00
|
|
|
void folder_tree_update(folder_tree * tree, mfconn * conn);
|
|
|
|
|
|
2014-09-27 20:18:02 +02:00
|
|
|
int folder_tree_store(folder_tree * tree, FILE * stream);
|
|
|
|
|
|
2014-11-03 20:33:48 +01:00
|
|
|
folder_tree *folder_tree_load(FILE * stream, char *filecache);
|
2014-09-27 20:18:02 +02:00
|
|
|
|
2014-10-19 08:43:57 +02:00
|
|
|
bool folder_tree_path_exists(folder_tree * tree, mfconn * conn,
|
|
|
|
|
const char *path);
|
2014-09-28 07:39:13 +02:00
|
|
|
|
2014-09-28 09:37:24 +02:00
|
|
|
uint64_t folder_tree_path_get_num_children(folder_tree * tree,
|
2014-10-19 08:43:57 +02:00
|
|
|
mfconn * conn,
|
2014-09-28 09:37:24 +02:00
|
|
|
const char *path);
|
|
|
|
|
|
|
|
|
|
bool folder_tree_path_is_directory(folder_tree * tree,
|
2014-10-19 08:43:57 +02:00
|
|
|
mfconn * conn, const char *path);
|
2014-09-28 09:37:24 +02:00
|
|
|
|
2014-10-19 08:43:57 +02:00
|
|
|
const char *folder_tree_path_get_key(folder_tree * tree, mfconn * conn,
|
|
|
|
|
const char *path);
|
2014-09-28 09:37:24 +02:00
|
|
|
|
2014-10-19 08:43:57 +02:00
|
|
|
bool folder_tree_path_is_root(folder_tree * tree, mfconn * conn,
|
|
|
|
|
const char *path);
|
2014-09-28 09:37:24 +02:00
|
|
|
|
2014-10-19 08:43:57 +02:00
|
|
|
bool folder_tree_path_is_file(folder_tree * tree, mfconn * conn,
|
|
|
|
|
const char *path);
|
2014-09-29 10:53:34 +02:00
|
|
|
|
2014-10-27 14:17:03 +01:00
|
|
|
int folder_tree_open_file(folder_tree * tree, mfconn * conn,
|
|
|
|
|
const char *path);
|
|
|
|
|
|
2014-12-04 16:07:12 +01:00
|
|
|
int folder_tree_tmp_open(folder_tree * tree);
|
|
|
|
|
|
2014-09-25 13:05:17 +02:00
|
|
|
#endif
|