VSF Documented
mntent.h
Go to the documentation of this file.
1#ifndef __VSF_LINUX_MNTENT_H__
2#define __VSF_LINUX_MNTENT_H__
3
5
6#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED && VSF_LINUX_USE_SIMPLE_LIBC == ENABLED
8#else
9# include <stddef.h>
10#endif
11#include <stdio.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#if VSF_LINUX_CFG_WRAPPER == ENABLED
18#define setmntent VSF_LINUX_WRAPPER(setmntent)
19#define getmntent VSF_LINUX_WRAPPER(getmntent)
20#define addmntent VSF_LINUX_WRAPPER(addmntent)
21#define endmntent VSF_LINUX_WRAPPER(endmntent)
22#define hasmntopt VSF_LINUX_WRAPPER(hasmntopt)
23
24#if defined(_GNU_SOURCE)
25#define getmntent_r VSF_LINUX_WRAPPER(getmntent_r)
26#endif
27#endif
28
29struct mntent {
31 char *mnt_dir;
32 char *mnt_type;
33 char *mnt_opts;
36};
37
38#if VSF_LINUX_APPLET_USE_MNTENT == ENABLED
41
49# ifndef __VSF_APPLET__
51# endif
52#endif
53
54#if defined(__VSF_APPLET__) && (defined(__VSF_APPLET_LIB__) || defined(__VSF_APPLET_LINUX_MNTENT_LIB__))\
55 && VSF_LINUX_APPLET_USE_MNTENT == ENABLED
56
57#ifndef VSF_LINUX_APPLET_MNTENT_VPLT
58# if VSF_LINUX_USE_APPLET == ENABLED
59# define VSF_LINUX_APPLET_MNTENT_VPLT \
60 ((vsf_linux_mntent_vplt_t *)(VSF_LINUX_APPLET_VPLT->mntent_vplt))
61# else
62# define VSF_LINUX_APPLET_MNTENT_VPLT \
63 ((vsf_linux_mntent_vplt_t *)vsf_vplt((void *)0))
64# endif
65#endif
66
67#define VSF_LINUX_APPLET_MNTENT_ENTRY(__NAME) \
68 VSF_APPLET_VPLT_ENTRY_FUNC_ENTRY(VSF_LINUX_APPLET_MNTENT_VPLT, __NAME)
69#define VSF_LINUX_APPLET_MNTENT_IMP(...) \
70 VSF_APPLET_VPLT_ENTRY_FUNC_IMP(VSF_LINUX_APPLET_MNTENT_VPLT, __VA_ARGS__)
71
72VSF_LINUX_APPLET_MNTENT_IMP(setmntent, FILE *, const char *filename, const char *type) {
74 return VSF_LINUX_APPLET_MNTENT_ENTRY(setmntent)(filename, type);
75}
76VSF_LINUX_APPLET_MNTENT_IMP(getmntent, struct mntent *, FILE *stream) {
78 return VSF_LINUX_APPLET_MNTENT_ENTRY(getmntent)(stream);
79}
80VSF_LINUX_APPLET_MNTENT_IMP(addmntent, int, FILE *stream, const struct mntent *mnt) {
82 return VSF_LINUX_APPLET_MNTENT_ENTRY(addmntent)(stream, mnt);
83}
84VSF_LINUX_APPLET_MNTENT_IMP(endmntent, int, FILE *stream) {
86 return VSF_LINUX_APPLET_MNTENT_ENTRY(endmntent)(stream);
87}
88VSF_LINUX_APPLET_MNTENT_IMP(hasmntopt, char *, const struct mntent *mnt, const char *opt) {
90 return VSF_LINUX_APPLET_MNTENT_ENTRY(hasmntopt)(mnt, opt);
91}
92VSF_LINUX_APPLET_MNTENT_IMP(getmntent_r, struct mntent *, FILE *stream, struct mntent *mntbuf, char *buf, int buflen) {
94 return VSF_LINUX_APPLET_MNTENT_ENTRY(getmntent_r)(stream, mntbuf, buf, buflen);
95}
96
97#else // __VSF_APPLET__ && VSF_LINUX_APPLET_USE_MNTENT
98
99FILE * setmntent(const char *filename, const char *type);
100struct mntent * getmntent(FILE *stream);
101int addmntent(FILE *stream, const struct mntent *mnt);
102int endmntent(FILE *stream);
103char * hasmntopt(const struct mntent *mnt, const char *opt);
104
105#if defined(_GNU_SOURCE)
106struct mntent * getmntent_r(FILE *stream, struct mntent *mntbuf, char *buf, int buflen);
107#endif
108
109#endif // __VSF_APPLET__ && VSF_LINUX_APPLET_USE_MNTENT
110
111#ifdef __cplusplus
112}
113#endif
114
115#endif
#define hasmntopt
Definition mntent.h:22
#define addmntent
Definition mntent.h:20
#define endmntent
Definition mntent.h:21
#define getmntent
Definition mntent.h:19
#define setmntent
Definition mntent.h:18
__VSF_VPLT_DECORATOR__ vsf_linux_mntent_vplt_t vsf_linux_mntent_vplt
Definition vsf_linux_fs.c:3547
int FILE
Definition stdio.h:141
Definition mntent.h:29
char * mnt_fsname
Definition mntent.h:30
char * mnt_dir
Definition mntent.h:31
char * mnt_opts
Definition mntent.h:33
char * mnt_type
Definition mntent.h:32
int mnt_passno
Definition mntent.h:35
int mnt_freq
Definition mntent.h:34
Definition mntent.h:39
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(addmntent)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(getmntent_r)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(getmntent)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(endmntent)
vsf_vplt_info_t info
Definition mntent.h:40
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(hasmntopt)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(setmntent)
Definition vsf_cfg.h:95
vk_av_control_type_t type
Definition vsf_audio.h:170
#define __VSF_VPLT_DECORATOR__
Definition vsf_cfg.h:93
#define VSF_APPLET_VPLT_ENTRY_FUNC_TRACE()
Definition vsf_cfg.h:165
struct mntent * getmntent_r(FILE *stream, struct mntent *mntbuf, char *buf, int buflen)
Definition vsf_linux_fs.c:3534