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
50# ifndef __VSF_APPLET__
52# endif
53#endif
54
55#if defined(__VSF_APPLET__) && (defined(__VSF_APPLET_LIB__) || defined(__VSF_APPLET_LINUX_MNTENT_LIB__))\
56 && VSF_LINUX_APPLET_USE_MNTENT == ENABLED
57
58#ifndef VSF_LINUX_APPLET_MNTENT_VPLT
59# if VSF_LINUX_USE_APPLET == ENABLED
60# define VSF_LINUX_APPLET_MNTENT_VPLT \
61 ((vsf_linux_mntent_vplt_t *)(VSF_LINUX_APPLET_VPLT->mntent_vplt))
62# else
63# define VSF_LINUX_APPLET_MNTENT_VPLT \
64 ((vsf_linux_mntent_vplt_t *)vsf_vplt((void *)0))
65# endif
66#endif
67
68#define VSF_LINUX_APPLET_MNTENT_ENTRY(__NAME) \
69 VSF_APPLET_VPLT_ENTRY_FUNC_ENTRY(VSF_LINUX_APPLET_MNTENT_VPLT, __NAME)
70#define VSF_LINUX_APPLET_MNTENT_IMP(...) \
71 VSF_APPLET_VPLT_ENTRY_FUNC_IMP(VSF_LINUX_APPLET_MNTENT_VPLT, __VA_ARGS__)
72
73VSF_LINUX_APPLET_MNTENT_IMP(setmntent, FILE *, const char *filename, const char *type) {
75 return VSF_LINUX_APPLET_MNTENT_ENTRY(setmntent)(filename, type);
76}
77VSF_LINUX_APPLET_MNTENT_IMP(getmntent, struct mntent *, FILE *stream) {
79 return VSF_LINUX_APPLET_MNTENT_ENTRY(getmntent)(stream);
80}
81VSF_LINUX_APPLET_MNTENT_IMP(addmntent, int, FILE *stream, const struct mntent *mnt) {
83 return VSF_LINUX_APPLET_MNTENT_ENTRY(addmntent)(stream, mnt);
84}
85VSF_LINUX_APPLET_MNTENT_IMP(endmntent, int, FILE *stream) {
87 return VSF_LINUX_APPLET_MNTENT_ENTRY(endmntent)(stream);
88}
89VSF_LINUX_APPLET_MNTENT_IMP(hasmntopt, char *, const struct mntent *mnt, const char *opt) {
91 return VSF_LINUX_APPLET_MNTENT_ENTRY(hasmntopt)(mnt, opt);
92}
93VSF_LINUX_APPLET_MNTENT_IMP(getmntent_r, struct mntent *, FILE *stream, struct mntent *mntbuf, char *buf, int buflen) {
95 return VSF_LINUX_APPLET_MNTENT_ENTRY(getmntent_r)(stream, mntbuf, buf, buflen);
96}
97
98#else // __VSF_APPLET__ && VSF_LINUX_APPLET_USE_MNTENT
99
100FILE * setmntent(const char *filename, const char *type);
101struct mntent * getmntent(FILE *stream);
102int addmntent(FILE *stream, const struct mntent *mnt);
103int endmntent(FILE *stream);
104char * hasmntopt(const struct mntent *mnt, const char *opt);
105
106#if defined(_GNU_SOURCE)
107struct mntent * getmntent_r(FILE *stream, struct mntent *mntbuf, char *buf, int buflen);
108#endif
109
110#endif // __VSF_APPLET__ && VSF_LINUX_APPLET_USE_MNTENT
111
112#ifdef __cplusplus
113}
114#endif
115
116#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
struct vsf_linux_mntent_vplt_t vsf_linux_mntent_vplt_t
#define setmntent
Definition mntent.h:18
__VSF_VPLT_DECORATOR__ vsf_linux_mntent_vplt_t vsf_linux_mntent_vplt
Definition vsf_linux_fs.c:3917
Definition stdio.h:145
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_MOD_DEF(libmntent)
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:3905
Generated from commit: vsfteam/vsf@2a137b0