diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2009-01-27 17:41:02 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-01-27 17:41:02 -0500 |
commit | 0dcb83a870926de215307472676096056dabc9b0 (patch) | |
tree | 4db3b268848ec4bf0e334d4777de2c5bc259bc80 /utils/mount/parse_opt.h | |
parent | 29ac873f9024c8fcbca38ab09ba54cda3765b746 (diff) | |
download | nfs-utils-0dcb83a870926de215307472676096056dabc9b0.tar.gz nfs-utils-0dcb83a870926de215307472676096056dabc9b0.tar.xz nfs-utils-0dcb83a870926de215307472676096056dabc9b0.zip |
text-based mount command: make po_rightmost() work for N options
Sometimes we need to choose the rightmost option among multiple
different mount options. For example, we want to find the rightmost
of "proto," "tcp," and "udp". Or, the rightmost of "vers," "nfsvers,"
"v2," and "v3".
Update po_rightmost() to choose among N options instead of just two.
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/parse_opt.h')
-rw-r--r-- | utils/mount/parse_opt.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/utils/mount/parse_opt.h b/utils/mount/parse_opt.h index 199630f..e132b1c 100644 --- a/utils/mount/parse_opt.h +++ b/utils/mount/parse_opt.h @@ -35,12 +35,6 @@ typedef enum { PO_BAD_VALUE = 2, } po_found_t; -typedef enum { - PO_KEY1_RIGHTMOST = -1, - PO_NEITHER_FOUND = 0, - PO_KEY2_RIGHTMOST = 1, -} po_rightmost_t; - struct mount_options; struct mount_options * po_split(char *); @@ -53,7 +47,8 @@ po_found_t po_contains(struct mount_options *, char *); char * po_get(struct mount_options *, char *); po_found_t po_get_numeric(struct mount_options *, char *, long *); -po_rightmost_t po_rightmost(struct mount_options *, char *, char *); +unsigned int po_rightmost(struct mount_options *, + const char *keys[]); po_found_t po_remove_all(struct mount_options *, char *); void po_destroy(struct mount_options *); |