From e269892480767b089cb999e87cc05becfdef26d2 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Tue, 10 Apr 2012 11:17:13 +0200 Subject: some rearangements --- pgsql.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pgsql.h (limited to 'pgsql.h') diff --git a/pgsql.h b/pgsql.h new file mode 100644 index 0000000..cdf90bb --- /dev/null +++ b/pgsql.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2012 Andreas Baumann + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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, see . +*/ + +#include /* size_t */ +#include /* mode_t */ + +#include /* for user-land filesystem */ + +#include /* for Postgresql database access */ + +typedef struct PgMeta { + size_t size; /* the size of the file */ + int isdir; /* whether we have a directory or a file */ +} PgMeta; + +int psql_get_meta( PGconn *conn, const char *path, PgMeta *meta ); + +int psql_create_file( PGconn *conn, const int parent_id, const char *path, const char *new_file, mode_t mode ); + +int psql_read_buf( PGconn *conn, const int id, const char *path, char **buf, const size_t len ); + +int psql_readdir( PGconn *conn, const int parent_id, void *buf, fuse_fill_dir_t filler ); + +int psql_create_dir( PGconn *conn, const int parent_id, const char *path, const char *new_dir, mode_t mode ); + +int psql_write_buf( PGconn *conn, const int id, const char *path, const char *buf, const size_t len ); + +int psql_write_meta( PGconn *conn, const int id, const char *path, PgMeta meta ); -- cgit v1.2.3-54-g00ecf