diff options
author | Karel Zak | 2013-08-20 12:41:27 +0200 |
---|---|---|
committer | Karel Zak | 2013-08-20 12:41:27 +0200 |
commit | 2bc04c11f967261839f1ae21038c4a43faed8d1d (patch) | |
tree | 2d29c0e0bfaa5e0ce6b03c2472f128881406f7dc /libmount/src/tab.c | |
parent | libmount: add mnt_table_with_comments() (diff) | |
download | kernel-qcow2-util-linux-2bc04c11f967261839f1ae21038c4a43faed8d1d.tar.gz kernel-qcow2-util-linux-2bc04c11f967261839f1ae21038c4a43faed8d1d.tar.xz kernel-qcow2-util-linux-2bc04c11f967261839f1ae21038c4a43faed8d1d.zip |
libmount: add mnt_table_{set,get}_userdata()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/tab.c')
-rw-r--r-- | libmount/src/tab.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libmount/src/tab.c b/libmount/src/tab.c index c79b9819c..a8b462faa 100644 --- a/libmount/src/tab.c +++ b/libmount/src/tab.c @@ -128,6 +128,37 @@ int mnt_table_get_nents(struct libmnt_table *tb) } /** + * mnt_table_set_userdata: + * @tb: pointer to tab + * @data: pointer to user data + * + * Sets pointer to the private user data. + * + * Returns: 0 on success or negative number in case of error. + */ +int mnt_table_set_userdata(struct libmnt_table *tb, void *data) +{ + assert(tb); + if (!tb) + return -EINVAL; + + tb->userdata = data; + return 0; +} + +/** + * mnt_table_get_userdata: + * @tb: pointer to tab + * + * Returns: pointer to user's data. + */ +void *mnt_table_get_userdata(struct libmnt_table *tb) +{ + assert(tb); + return tb ? tb->userdata : NULL; +} + +/** * mnt_table_enable_comments: * @tb: pointer to tab * @enable: TRUE or FALSE |