]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - mount/sundries.h
2 * Support function prototypes. Functions are in sundries.c.
3 * sundries.h,v 1.1.1.1 1993/11/18 08:40:51 jrs Exp
13 #include <rpc/types.h>
16 extern int mount_quiet
;
19 #define streq(s, t) (strcmp ((s), (t)) == 0)
22 /* String list data structure. */
23 typedef struct string_list
26 struct string_list
*tl
;
29 #define car(p) ((p) -> hd)
30 #define cdr(p) ((p) -> tl)
32 string_list
cons (char *a
, const string_list
);
34 /* Quiet compilation with -Wmissing-prototypes. */
35 int main (int argc
, char *argv
[]);
37 /* Functions in sundries.c that are used in mount.c and umount.c */
38 void block_signals (int how
);
39 char *canonicalize (const char *path
);
40 char *realpath (const char *path
, char *resolved_path
);
41 void error (const char *fmt
, ...);
42 int matching_type (const char *type
, string_list types
);
43 string_list
parse_list (char *strings
);
44 void *xmalloc (size_t size
);
45 char *xstrdup (const char *s
);
46 char *xstrndup (const char *s
, int n
);
47 char *xstrconcat2 (const char *, const char *);
48 char *xstrconcat3 (const char *, const char *, const char *);
49 char *xstrconcat4 (const char *, const char *, const char *, const char *);
51 /* Here is some serious cruft. */
53 #if defined(__GNUC_MINOR__) && __GNUC__ == 2 && __GNUC_MINOR__ >= 5
54 void die (int errcode
, const char *fmt
, ...) __attribute__ ((noreturn
));
55 #else /* GNUC < 2.5 */
56 void volatile die (int errcode
, const char *fmt
, ...);
57 #endif /* GNUC < 2.5 */
59 void die (int errcode
, const char *fmt
, ...);
60 #endif /* !__GNUC__ */
63 int nfsmount (const char *spec
, const char *node
, int *flags
,
64 char **orig_opts
, char **opt_args
);
67 /* exit status - bits below are ORed */
68 #define EX_USAGE 1 /* incorrect invocation or permission */
69 #define EX_SYSERR 2 /* out of memory, cannot fork, ... */
70 #define EX_SOFTWARE 4 /* internal mount bug or wrong version */
71 #define EX_USER 8 /* user interrupt */
72 #define EX_FILEIO 16 /* problems writing, locking, ... mtab/fstab */
73 #define EX_FAIL 32 /* mount failure */
74 #define EX_SOMEOK 64 /* some mount succeeded */