/*
* Fuse: Filesystem in Userspace
*
*
* This program can be distributed under the terms of the GNU LGPLv2.
* See the file COPYING.LIB
*/
#include "fuse.h"
#include "fuse_opt.h"
#include <libuvfs.h>
#include "fuse_impl.h"
#include <string.h>
#include <assert.h>
/*
* Add an argument to the end of a fuse_args array. The second argument
* is copied.
*/
int
{
int i;
else
return (0);
}
/*
* Insert an argument into an arbitrary slot in a fuse_args array. The
* third argument is copied.
*/
int
{
}
return (0);
}
/*
* Drop an arbitrary argument from a fuse_args array.
*/
static void
{
int i, j;
if (i != which) {
else
libfuse_strfree(oldargs[i]);
}
}
}
/*
* Add an option to a comma-separated list of options. Initially,
* the first argument should be the address of a character pointer
* pointing to NULL. This may be reused, and eventually freed
* with libfuse_strfree().
*/
int
{
return (-1);
return (0);
}
return (0);
}
/*
* Free a fuse_args structure.
*/
void
{
int i;
return;
}
/*
* Shift the zeroth argument off of the fuse_args array, storing
* it in the second argument. A pointer to the second argument is
* returned.
*/
static char *
{
return (NULL);
fuse_opt_drop_arg(args, 0);
return (buffer);
}
/*
* Process an argument according to the key, calling proc if necessary.
*/
static int
{
if (key == FUSE_OPT_KEY_DISCARD)
return (0);
if (key == FUSE_OPT_KEY_KEEP)
return (1);
return (1);
}
/*
* Find the next matching option for the given argument. If an equal
* sign or a space separates, set *sepp to the index.
*/
static const struct fuse_opt *
{
char *chop;
if (chop[0] == '=')
++cmplen;
break;
}
} else {
*sepp = 0;
break;
}
}
}
return (opt);
}
/*
* Scan the input into the value, according to the format. If the
* format is %s, copy the string.
*/
static int
{
return (0);
}
return (-1);
return (0);
}
/*
* "apply" the given fuse_opt to the input. That is, if the offset is
* -1, call the callback; else, set the integer at the given offset
* to the given value.
*/
static int
{
int rc;
} else {
rc = 0;
}
return (rc);
}
/*
* Apply each fuse_opt that is applicable to the arg. "apply" means to
* scan or strdup if a %-format is present, or to "apply" it as in
* fuse_opt_apply. If the return value is one, we add the argument to
* new. And, if a template for an option contains a space, we may
* concatenate the next argument before calling the callback.
*/
static int
{
const char *post;
int save = 0;
int rc = 0;
do {
if (sep != 0) {
if (post[0] == '=') {
++post;
if (post[0] != '%') {
if (rc == 1)
save = 1;
} else {
(void *)valp);
}
} else {
sizeof (buffy));
}
}
} else {
if (rc == 1)
}
++opt;
return (save);
}
static int
char **allopts)
{
int rc = 0;
if (rc == -1)
break;
if (rc == 1)
}
return (rc);
}
static int
char **allopts)
{
rc = 0;
break;
}
rc = 0;
break;
}
if (arg[0] != '-') {
if (rc == 1)
allopts);
arg += 3;
allopts);
} else {
if (rc == 1)
}
}
if (rc == 1)
rc = 0;
return (rc);
}
/*
* Parse the arguments and return the result. If the return is -1, there was
* a problem. Otherwise, args is altered such that the options, if any, are
* moved to the front in a single "-o a,b,c" pattern, and other arguments are
* kept or discarded according to the rules laid out in fuse_opt.h.
*/
int
{
int rc;
return (0);
sizeof (buffy)));
}
if (rc != -1) {
} else {
}
return (rc);
}