Logo Search packages:      
Sourcecode: fuse version File versions

int fuse_parse_cmdline ( struct fuse_args args,
char **  mountpoint,
int *  multithreaded,
int *  foreground 
)

Parse common options

The following options are parsed:

'-f' foreground '-d' '-odebug' foreground, but keep the debug option '-s' single threaded '-h' '--help' help '-ho' help without header '-ofsname=..' file system name, if not present, then set to the program name

All parameters may be NULL

Parameters:
args argument vector
mountpoint the returned mountpoint, should be freed after use
multithreaded set to 1 unless the '-s' option is present
foreground set to 1 if one of the relevant options is present
Returns:
0 on success, -1 on failure

Definition at line 146 of file helper.c.

References fuse_args::argv, fuse_opt_parse(), and fuse_parse_cmdline().

Referenced by fuse_parse_cmdline().

{
      int res;
      struct helper_opts hopts;

      memset(&hopts, 0, sizeof(hopts));
      res = fuse_opt_parse(args, &hopts, fuse_helper_opts,
                       fuse_helper_opt_proc);
      if (res == -1)
            return -1;

      if (!hopts.nodefault_subtype) {
            res = add_default_subtype(args->argv[0], args);
            if (res == -1)
                  goto err;
      }
      if (mountpoint)
            *mountpoint = hopts.mountpoint;
      else
            free(hopts.mountpoint);

      if (multithreaded)
            *multithreaded = !hopts.singlethread;
      if (foreground)
            *foreground = hopts.foreground;
      return 0;

err:
      free(hopts.mountpoint);
      return -1;
}


Generated by  Doxygen 1.6.0   Back to index