From 00e2d95dccc3df15483ae1ca3446e905cef7a889 Mon Sep 17 00:00:00 2001 From: Kubat <mael.martin31@gmail.com> Date: Wed, 30 Oct 2019 15:19:20 +0100 Subject: [PATCH] Base of the fuse module for our database. --- player/src/db/lektor_fuse.c | 73 +++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 player/src/db/lektor_fuse.c diff --git a/player/src/db/lektor_fuse.c b/player/src/db/lektor_fuse.c new file mode 100644 index 00000000..07702ae4 --- /dev/null +++ b/player/src/db/lektor_fuse.c @@ -0,0 +1,73 @@ +#include "sqlite3.h" + + +#define _GNU_SOURCE + + +#include <fuse.h> +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <fcntl.h> +#include <stddef.h> +#include <assert.h> +#include <dirent.h> + + +static volatile const char * database_path = NULL; /**<< @brief The path to the database. */ +static volatile sqlite3 * database = NULL; /**<< @brief The database of the kara base. */ + + +static int lektor_init(void) +{ + if (sqlite3_open((const char*) database_path, (sqlite3**) &database) != 0) + return 1; + return 0; +} + + +static int lektor_getattr(const char * path, struct stat * stbuf) +{ +} + + +static int lektor_getdir(const char * path, fuse_dirh_t h, fuse_dirfil_t filler) +{ +} + + +static int lektor_read(const char * path, char * buf, size_t size, off_t offset) +{ +} + + +static int lektor_open(const char *path, int flags) +{ +} + + +static void * lektor_deinit(void) +{ +} + +static struct fuse_operations lektor_oper = +{ + .getattr = lektor_getattr, + .getdir = lektor_getdir, + .open = lektor_open, + .read = lektor_read, + // .mkdir = + // .unlink = + // .rmdir = + // .rename = + // .chmod = +}; + + +int main(int argc, char *argv[]) +{ + struct fuse_args args = FUSE_ARGS_INIT(argc, argv); + + lektor_init(); + return fuse_main(args.argc, args.argv, &lektor_oper); +} -- GitLab