1 /* Provide a more complete mntent.h.
3 Copyright (C) 2024-2025 Free Software Foundation, Inc.
5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 This file is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
19 @PRAGMA_SYSTEM_HEADER@
23 #ifndef _@GUARD_PREFIX@_MNTENT_H
25 /* The include_next requires a split double-inclusion guard. */
26 #@INCLUDE_NEXT@ @NEXT_MNTENT_H@
28 #ifndef _@GUARD_PREFIX@_MNTENT_H
29 #define _@GUARD_PREFIX@_MNTENT_H
31 /* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
32 #if !_GL_CONFIG_H_INCLUDED
33 #error "Please include config.h first."
36 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
38 /* The definition of _GL_ARG_NONNULL is copied here. */
40 /* The definition of _GL_WARN_ON_USE is copied here. */
47 #if @GNULIB_HASMNTOPT@ && @HAVE_SETMNTENT@
48 /* Searches ME->mnt_opts for an option matching OPTION.
49 Returns the address of the substring, or null if none found. */
50 # if @REPLACE_HASMNTOPT@
51 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
53 # define hasmntopt rpl_hasmntopt
55 _GL_FUNCDECL_RPL (hasmntopt
, char *,
56 (const struct mntent
*me
, const char *option
),
57 _GL_ARG_NONNULL ((1, 2)));
58 _GL_CXXALIAS_RPL (hasmntopt
, char *,
59 (const struct mntent
*me
, const char *option
));
61 # if !@HAVE_HASMNTOPT@
62 _GL_FUNCDECL_SYS (hasmntopt
, char *,
63 (const struct mntent
*me
, const char *option
),
64 _GL_ARG_NONNULL ((1, 2)));
66 _GL_CXXALIAS_SYS (hasmntopt
, char *,
67 (const struct mntent
*me
, const char *option
));
70 _GL_CXXALIASWARN (hasmntopt
);
72 #elif defined GNULIB_POSIXCHECK
74 # if HAVE_RAW_DECL_HASMNTOPT
75 _GL_WARN_ON_USE (hasmntopt
, "hasmntopt is unportable - "
76 "use gnulib module hasmntopt for portability");
85 #endif /* _@GUARD_PREFIX@_MNTENT_H */
86 #endif /* _@GUARD_PREFIX@_MNTENT_H */