+#define ENSC_WRAPPERS_PREFIX "vdu: "
+#define ENSC_WRAPPERS_VSERVER 1
+#define ENSC_WRAPPERS_UNISTD 1
+#define ENSC_WRAPPERS_DIRENT 1
+#define ENSC_WRAPPERS_FCNTL 1
+#define ENSC_WRAPPERS_STAT 1
+#include <wrappers.h>
+
+#define CMD_HELP 0x1000
+#define CMD_VERSION 0x1001
+#define CMD_XID 0x2000
+#define CMD_SPACE 0x2001
+#define CMD_INODES 0x2002
+#define CMD_SCRIPT 0x2003
+#define CMD_BLOCKSIZE 0x2005
+
+int wrapper_exit_code = 1;
+
+struct option const
+CMDLINE_OPTIONS[] = {
+ { "help", no_argument, 0, CMD_HELP },
+ { "version", no_argument, 0, CMD_VERSION },
+ { "xid", required_argument, 0, CMD_XID },
+ { "space", no_argument, 0, CMD_SPACE },
+ { "inodes", no_argument, 0, CMD_INODES },
+ { "script", no_argument, 0, CMD_SCRIPT },
+ { "blocksize", required_argument, 0, CMD_BLOCKSIZE },
+ {0,0,0,0}
+};
+
+struct Arguments {
+ xid_t xid;
+ bool space;
+ bool inodes;
+ bool script;
+ unsigned long blocksize;
+};
+
+struct Result {
+ uint_least64_t blocks;
+ uint_least64_t inodes;
+};
+
+struct TraversalParams {
+ struct Arguments const * const args;
+ struct Result * const result;
+};
+
+static void
+showHelp(int fd, char const *cmd, int res)
+{
+ WRITE_MSG(fd, "Usage:\n ");
+ WRITE_STR(fd, cmd);
+ WRITE_MSG(fd,
+ " --xid <xid> (--space|--inodes) [--blocksize <blocksize>] [--script] <directory>*\n"
+ "\n"
+ "Please report bugs to " PACKAGE_BUGREPORT "\n");
+
+ exit(res);
+}