From: Karel Zak Date: Tue, 23 Aug 2022 11:42:16 +0000 (+0200) Subject: libmount: (optlist) add function to access option's map X-Git-Tag: v2.39-rc1~290 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e1d05613e9bcdf07e5a2b4723a13aa8d4bbe2ef9;p=thirdparty%2Futil-linux.git libmount: (optlist) add function to access option's map Signed-off-by: Karel Zak --- diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h index 95a5d10bb5..902f511289 100644 --- a/libmount/src/mountP.h +++ b/libmount/src/mountP.h @@ -543,6 +543,8 @@ extern int mnt_optlist_merge_opts(struct libmnt_optlist *ls); extern int mnt_opt_has_value(struct libmnt_opt *opt); extern const char *mnt_opt_get_value(struct libmnt_opt *opt); extern const char *mnt_opt_get_name(struct libmnt_opt *opt); +extern const struct libmnt_optmap *mnt_opt_get_map(struct libmnt_opt *opt); +extern const struct libmnt_optmap *mnt_opt_get_mapent(struct libmnt_opt *opt); extern int mnt_opt_set_external(struct libmnt_opt *opt, int enable); extern int mnt_opt_set_value(struct libmnt_opt *opt, const char *str); extern int mnt_opt_set_u64value(struct libmnt_opt *opt, uint64_t num); diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c index b3cc90c334..270baa4f6c 100644 --- a/libmount/src/optlist.c +++ b/libmount/src/optlist.c @@ -832,6 +832,16 @@ const char *mnt_opt_get_name(struct libmnt_opt *opt) return opt->name; } +const struct libmnt_optmap *mnt_opt_get_map(struct libmnt_opt *opt) +{ + return opt->map; +} + +const struct libmnt_optmap *mnt_opt_get_mapent(struct libmnt_opt *opt) +{ + return opt->ent; +} + int mnt_opt_set_value(struct libmnt_opt *opt, const char *str) { return strdup_to_struct_member(opt, value, str);