Home | History | Annotate | Line # | Download | only in librefuse
fuse_opt.h revision 1.2
      1  1.2  xtraeme /*	$NetBSD: fuse_opt.h,v 1.2 2007/02/28 16:28:25 xtraeme Exp $	*/
      2  1.2  xtraeme 
      3  1.1  xtraeme /*
      4  1.1  xtraeme  * Copyright (c) 2007 Alistair Crooks.  All rights reserved.
      5  1.1  xtraeme  *
      6  1.1  xtraeme  * Redistribution and use in source and binary forms, with or without
      7  1.1  xtraeme  * modification, are permitted provided that the following conditions
      8  1.1  xtraeme  * are met:
      9  1.1  xtraeme  * 1. Redistributions of source code must retain the above copyright
     10  1.1  xtraeme  *    notice, this list of conditions and the following disclaimer.
     11  1.1  xtraeme  * 2. Redistributions in binary form must reproduce the above copyright
     12  1.1  xtraeme  *    notice, this list of conditions and the following disclaimer in the
     13  1.1  xtraeme  *    documentation and/or other materials provided with the distribution.
     14  1.1  xtraeme  * 3. The name of the author may not be used to endorse or promote
     15  1.1  xtraeme  *    products derived from this software without specific prior written
     16  1.1  xtraeme  *    permission.
     17  1.1  xtraeme  *
     18  1.1  xtraeme  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
     19  1.1  xtraeme  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     20  1.1  xtraeme  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     21  1.1  xtraeme  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
     22  1.1  xtraeme  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     23  1.1  xtraeme  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
     24  1.1  xtraeme  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     25  1.1  xtraeme  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     26  1.1  xtraeme  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
     27  1.1  xtraeme  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     28  1.1  xtraeme  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     29  1.1  xtraeme  */
     30  1.1  xtraeme 
     31  1.1  xtraeme #ifndef _FUSE_OPT_H_
     32  1.1  xtraeme #define _FUSE_OPT_H_
     33  1.1  xtraeme 
     34  1.1  xtraeme #include <fuse.h>
     35  1.1  xtraeme 
     36  1.1  xtraeme enum {
     37  1.1  xtraeme 	FUSE_OPT_KEY_OPT = -1,
     38  1.1  xtraeme 	FUSE_OPT_KEY_NONOPT = -2,
     39  1.1  xtraeme 	FUSE_OPT_KEY_KEEP = -3,
     40  1.1  xtraeme 	FUSE_OPT_KEY_DISCARD = -4
     41  1.1  xtraeme };
     42  1.1  xtraeme 
     43  1.1  xtraeme struct fuse_opt {
     44  1.1  xtraeme 	const char	*templ;
     45  1.1  xtraeme 	int32_t		offset;
     46  1.1  xtraeme 	int32_t		value;
     47  1.1  xtraeme };
     48  1.1  xtraeme 
     49  1.1  xtraeme #define FUSE_OPT_KEY(templ, key) { templ, -1U, key }
     50  1.1  xtraeme #define FUSE_OPT_END { .templ = NULL }
     51  1.1  xtraeme 
     52  1.1  xtraeme typedef int (*fuse_opt_proc_t)(void *, const char *, int, struct fuse_args *);
     53  1.1  xtraeme 
     54  1.1  xtraeme 
     55  1.1  xtraeme int fuse_opt_add_arg(struct fuse_args *, const char *);
     56  1.1  xtraeme void fuse_opt_free_args(struct fuse_args *);
     57  1.1  xtraeme int fuse_opt_insert_arg(struct fuse_args *, int, const char *);
     58  1.1  xtraeme int fuse_opt_add_opt(char **, const char *);
     59  1.1  xtraeme int fuse_opt_parse(struct fuse_args *, void *,
     60  1.1  xtraeme 		   const struct fuse_opt *, fuse_opt_proc_t);
     61  1.1  xtraeme int fuse_opt_match(const struct fuse_opt *, const char *);
     62  1.1  xtraeme 
     63  1.1  xtraeme #endif /* _FUSE_OPT_H_ */
     64