summaryrefslogtreecommitdiffstats
path: root/mount-deprecated/sundries.h
diff options
context:
space:
mode:
authorKarel Zak2012-05-30 17:16:11 +0200
committerKarel Zak2012-06-26 20:48:22 +0200
commitd2feb47fb1ddc0d8ac946328e77ed86ea6937bef (patch)
tree3333ca26eb3b4f5df76714f93c41e7e300b45c66 /mount-deprecated/sundries.h
parentbuild-sys: convert login-utils/ to module (diff)
downloadkernel-qcow2-util-linux-d2feb47fb1ddc0d8ac946328e77ed86ea6937bef.tar.gz
kernel-qcow2-util-linux-d2feb47fb1ddc0d8ac946328e77ed86ea6937bef.tar.xz
kernel-qcow2-util-linux-d2feb47fb1ddc0d8ac946328e77ed86ea6937bef.zip
build-sys: convert mount/ to module, rename to mount-deprecated/
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount-deprecated/sundries.h')
-rw-r--r--mount-deprecated/sundries.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/mount-deprecated/sundries.h b/mount-deprecated/sundries.h
new file mode 100644
index 000000000..e58fa4975
--- /dev/null
+++ b/mount-deprecated/sundries.h
@@ -0,0 +1,55 @@
+/*
+ * sundries.h
+ * Support function prototypes. Functions are in sundries.c.
+ */
+#ifndef SUNDRIES_H
+#define SUNDRIES_H
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define XALLOC_EXIT_CODE 2 /* same as EX_SYSERR, for backwards compatibility */
+#include "xalloc.h"
+
+/* global mount, umount, and losetup variables */
+extern int mount_quiet;
+extern int verbose;
+extern int nocanonicalize;
+extern char *progname;
+
+#define streq(s, t) (strcmp ((s), (t)) == 0)
+#define my_free(_p) free((void *) _p)
+
+void block_signals (int how);
+
+void error (const char *fmt, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)));
+void die(int err, const char *fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+
+int matching_type (const char *type, const char *types);
+int matching_opts (const char *options, const char *test_opts);
+char *xstrndup (const char *s, int n);
+char *xstrconcat3 (char *, const char *, const char *);
+char *xstrconcat4 (char *, const char *, const char *, const char *);
+
+int is_pseudo_fs(const char *type);
+
+char *canonicalize (const char *path);
+char *canonicalize_spec (const char *path);
+
+/* exit status - bits below are ORed */
+#define EX_USAGE 1 /* incorrect invocation or permission */
+#define EX_SYSERR 2 /* out of memory, cannot fork, ... */
+#define EX_SOFTWARE 4 /* internal mount bug or wrong version */
+#define EX_USER 8 /* user interrupt */
+#define EX_FILEIO 16 /* problems writing, locking, ... mtab/fstab */
+#define EX_FAIL 32 /* mount failure */
+#define EX_SOMEOK 64 /* some mount succeeded */
+
+#endif /* SUNDRIES_H */