Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 60 lines (52 sloc) 1.825 kb
70010be @mikejs some organization
authored
1 /*
2 * Copyright 2009 Michael Stephens
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #include "operations.h"
19 #include "options.h"
20 #include "utils.h"
21 #include <cstring>
22
23 using namespace std;
24
25 int main(int argc, char *argv[])
26 {
f1095a0 @paulrosania whitespace
paulrosania authored
27 static struct fuse_operations gridfs_oper;
28 gridfs_oper.getattr = gridfs_getattr;
29 gridfs_oper.readdir = gridfs_readdir;
30 gridfs_oper.open = gridfs_open;
31 gridfs_oper.create = gridfs_create;
32 gridfs_oper.release = gridfs_release;
33 gridfs_oper.unlink = gridfs_unlink;
34 gridfs_oper.read = gridfs_read;
35 gridfs_oper.listxattr = gridfs_listxattr;
36 gridfs_oper.getxattr = gridfs_getxattr;
37 gridfs_oper.setxattr = gridfs_setxattr;
38 gridfs_oper.write = gridfs_write;
39 gridfs_oper.flush = gridfs_flush;
40 gridfs_oper.rename = gridfs_rename;
70010be @mikejs some organization
authored
41
f1095a0 @paulrosania whitespace
paulrosania authored
42 struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
70010be @mikejs some organization
authored
43
f1095a0 @paulrosania whitespace
paulrosania authored
44 memset(&gridfs_options, 0, sizeof(struct gridfs_options));
45 if(fuse_opt_parse(&args, &gridfs_options, gridfs_opts,
46 gridfs_opt_proc) == -1)
47 {
48 return -1;
49 }
70010be @mikejs some organization
authored
50
f1095a0 @paulrosania whitespace
paulrosania authored
51 if(!gridfs_options.host) {
52 gridfs_options.host = "localhost";
53 }
54 if(!gridfs_options.db) {
55 gridfs_options.db = "test";
56 }
70010be @mikejs some organization
authored
57
f1095a0 @paulrosania whitespace
paulrosania authored
58 return fuse_main(args.argc, args.argv, &gridfs_oper, NULL);
70010be @mikejs some organization
authored
59 }
Something went wrong with that request. Please try again.