diff options
author | Karel Zak | 2010-01-11 13:33:06 +0100 |
---|---|---|
committer | Karel Zak | 2010-06-03 15:20:10 +0200 |
commit | 078edb2d6e4188963938b7be076db5382f6f802b (patch) | |
tree | 5770e1758274c47120ed57f278d7a9b9433904cb /shlibs/mount/src/mountP.h | |
parent | libmount: add list routines and generic iterator (diff) | |
download | kernel-qcow2-util-linux-078edb2d6e4188963938b7be076db5382f6f802b.tar.gz kernel-qcow2-util-linux-078edb2d6e4188963938b7be076db5382f6f802b.tar.xz kernel-qcow2-util-linux-078edb2d6e4188963938b7be076db5382f6f802b.zip |
libmount: add optls (options container)
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/mountP.h')
-rw-r--r-- | shlibs/mount/src/mountP.h | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/shlibs/mount/src/mountP.h b/shlibs/mount/src/mountP.h index ef3c1a661..62a5eca9e 100644 --- a/shlibs/mount/src/mountP.h +++ b/shlibs/mount/src/mountP.h @@ -98,4 +98,55 @@ struct _mnt_iter { (itr)->p->next : (itr)->p->prev; \ } while(0) -#endif + +/* + * mnt_optls entry + */ +struct _mnt_optent { + char *name; /* option name (allcocated when mapent is NULL) */ + char *value; /* option argument value */ + + int mask; /* MNT_{INVMASK,MDATA,MFLAG,NOMTAB,NOSYS} + * modifiable flags (initial value comes from map->mask) + */ + const struct mnt_optmap *mapent;/* the option description (msp entry) */ + const struct mnt_optmap *map; /* head of the map */ + + struct list_head opts; /* list of options */ +}; + +/* + * Container (list) for mount options + */ +struct _mnt_optls { + struct mnt_optmap const **maps; /* array with option maps */ + size_t nmaps; /* number of maps */ + + struct list_head opts; /* list of options */ +}; + +/* optmap.c */ +extern const struct mnt_optmap *mnt_optmap_get_entry(struct mnt_optmap const **maps, + int nmaps, const char *name, + size_t namelen, const struct mnt_optmap **mapent); +extern int mnt_optmap_enum_to_number(const struct mnt_optmap *mapent, + const char *rawdata, size_t len); +extern const char *mnt_optmap_get_type(const struct mnt_optmap *mapent); +extern int mnt_optmap_require_value(const struct mnt_optmap *mapent); + +/* optent.c */ + +/* private option masks -- see mount.h.in for the publick masks */ +#define MNT_HASVAL (1 << 10) + +extern mnt_optent *mnt_new_optent(const char *name, size_t namesz, + const char *value, size_t valsz, + struct mnt_optmap const **maps, int nmaps); +extern void mnt_free_optent(mnt_optent *op); +extern mnt_optent *mnt_new_optent_from_optstr(char **optstr, + struct mnt_optmap const **maps, int nmaps); +extern int mnt_optent_assign_map(mnt_optent *op, + struct mnt_optmap const **maps, int nmaps); + + +#endif /* _LIBMOUNT_PRIVATE_H */ |