File: main.c

package info (click to toggle)
open-vm-tools 1%3A8.4.2-261024-1%2Bbuild1
  • links: PTS, VCS
  • area: contrib
  • in suites: squeeze-lts
  • size: 20,376 kB
  • ctags: 30,043
  • sloc: ansic: 164,785; sh: 10,713; cpp: 6,525; makefile: 3,386
file content (70 lines) | stat: -rw-r--r-- 2,182 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*********************************************************
 * Copyright (C) 2008 VMware, Inc. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.
 *
 *********************************************************/

/*
 * main.c --
 *
 *      Entry point for vmblock-fuse file system.
 */

#include <string.h>
#include <stdio.h>

#include "fsops.h"

int LOGLEVEL_THRESHOLD = 0;


/*
 *-----------------------------------------------------------------------------
 *
 * main --
 *
 *      Entry point for the vmblock-fuse file system. Calls fuse_main(). See
 *      http://fuse.sourceforge.net/doxygen/fuse_8h.html#3bf31250361d44c2436d76f47f2400ed
 *      for more information.
 *
 *      There are many command line options that fuse filesystems can take. Run
 *      with --help for a listing or consult the fuse documentation.
 *      Options which are likely to be usefor for vmblock-fuse are
 *      -o default_permissions and -o allow_other.
 *
 *      If the -d option is specified, enables our logging in addition to
 *      what fuse does.
 *
 * Results:
 *      Returns 0 on success and nonzero on failure.
 *
 * Side effects:
 *      None/all.
 *
 *-----------------------------------------------------------------------------
 */

int
main(int argc,           // IN
     char *argv[])       // IN
{
   int i;
   for (i = 1; i < argc && strcmp(argv[i], "--") != 0; ++i) {
      if (strcmp(argv[i], "-d") == 0) {
         LOGLEVEL_THRESHOLD = 4;
      }
   }
   return fuse_main(argc, argv, &vmblockOperations);
}