Deleted Added
full compact
1.\" Copyright (c) 1994
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 26 unchanged lines hidden (view full) ---

35.Dt GETMNTOPTS 3
36.Os BSD 4.4
37.Sh NAME
38.Nm getmntopts
39.Nd scan mount options
40.Sh SYNOPSIS
41.Fd #include <mntopts.h>
42.Ft void
43.Fn getmntopts "char *options" "struct mntopt *mopts" "int *flagp" "int *altflagp"
44.Sh DESCRIPTION
45The
46.Nm getmntopts
47function takes a comma separated option list and a list
48of valid option names, and computes the bitmask
49corresponding to the requested set of options.
50.Pp
51The string
52.Dv options
53is broken down into a sequence of comma separated tokens.
54Each token is looked up in the table described by
55.Dv mopts
56and the bits in
57the word referenced by either
58.Dv flagp
59or
60.Dv altflagp
61(depending on the
62.Dv m_altloc
63field of the option's table entry)
64are updated.
65The flag word is not initialized by
66.Nm getmntopt .
67The table,
68.Dv mopts ,
69has the following format:
70.Bd -literal
71struct mntopt {
72 char *m_option; /* option name */
73 int m_inverse; /* is this a negative option, eg "dev" */
74 int m_flag; /* bit to set, eg MNT_RDONLY */
75 int m_altloc; /* non-zero to use altflagp rather than flagp */
76};
77.Ed
78.Pp
79The members of this structure are:
80.Bl -tag -width m_inverse
81.It Fa m_option
82the option name,
83for example

--- 17 unchanged lines hidden (view full) ---

101the flag word when the option is recognized.
102The bit is set when the option is discovered,
103but cleared if the option name was preceded
104by the letters
105.Dq no .
106The
107.Dv m_inverse
108flag causes these two operations to be reversed.
109.It Fa m_altloc
110the bit should be set or cleared in
111.Dv altflagp
112rather than
113.Dv flagp .
114.El
115.Pp
116Each of the user visible
117.Dv MNT_
118flags has a corresponding
119.Dv MOPT_
120macro which defines an appropriate
121.Li "struct mntopt"

--- 53 unchanged lines hidden ---