Upload Tizen:Base source
[framework/base/util-linux-ng.git] / mount / sundries.h
1 /*
2  * sundries.h
3  * Support function prototypes.  Functions are in sundries.c.
4  */
5 #ifndef SUNDRIES_H
6 #define SUNDRIES_H
7
8 #include <stdio.h>
9 #include <sys/types.h>
10 #include <fcntl.h>
11 #include <limits.h>
12 #include <signal.h>
13 #include <stdarg.h>
14 #include <stdlib.h>
15
16 /* global mount, umount, and losetup variables */
17 extern int mount_quiet;
18 extern int verbose;
19 extern char *progname;
20
21 #define streq(s, t)     (strcmp ((s), (t)) == 0)
22
23 void block_signals (int how);
24
25 void error (const char *fmt, ...)
26         __attribute__ ((__format__ (__printf__, 1, 2)));
27 void die(int err, const char *fmt, ...)
28         __attribute__ ((__format__ (__printf__, 2, 3)));
29
30 int matching_type (const char *type, const char *types);
31 int matching_opts (const char *options, const char *test_opts);
32 void *xmalloc (size_t size);
33 char *xstrdup (const char *s);
34 char *xstrndup (const char *s, int n);
35 char *xstrconcat3 (char *, const char *, const char *);
36 char *xstrconcat4 (char *, const char *, const char *, const char *);
37
38 int is_pseudo_fs(const char *type);
39
40 char *canonicalize (const char *path);
41 char *canonicalize_spec (const char *path);
42
43 /* exit status - bits below are ORed */
44 #define EX_USAGE        1       /* incorrect invocation or permission */
45 #define EX_SYSERR       2       /* out of memory, cannot fork, ... */
46 #define EX_SOFTWARE     4       /* internal mount bug or wrong version */
47 #define EX_USER         8       /* user interrupt */
48 #define EX_FILEIO      16       /* problems writing, locking, ... mtab/fstab */
49 #define EX_FAIL        32       /* mount failure */
50 #define EX_SOMEOK      64       /* some mount succeeded */
51
52 #endif /* SUNDRIES_H */
53