From e1d05613e9bcdf07e5a2b4723a13aa8d4bbe2ef9 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 23 Aug 2022 13:42:16 +0200 Subject: [PATCH] libmount: (optlist) add function to access option's map Signed-off-by: Karel Zak --- libmount/src/mountP.h | 2 ++ libmount/src/optlist.c | 10 ++++++++++ 2 files changed, 12 insertions(+) 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); -- 2.47.3