aboutsummaryrefslogtreecommitdiffstats
path: root/sha3sum-mcb.c
diff options
context:
space:
mode:
Diffstat (limited to 'sha3sum-mcb.c')
-rw-r--r--sha3sum-mcb.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/sha3sum-mcb.c b/sha3sum-mcb.c
new file mode 100644
index 0000000..88990ca
--- /dev/null
+++ b/sha3sum-mcb.c
@@ -0,0 +1,27 @@
+/* See LICENSE file for copyright and license details. */
+#include <string.h>
+#include <stdio.h>
+
+#include "commands.h"
+
+#define _(NAME, MAIN) int MAIN(int argc, char *argv[]);
+LIST_COMMANDS(_)
+#undef _
+
+int
+main(int argc, char *argv[])
+{
+ char *p;
+
+ p = strrchr(argv[0], '/');
+ p = p ? &p[1] : argv[0];
+
+ #define _(NAME, MAIN)\
+ if (!strcmp(p, NAME))\
+ return MAIN(argc, argv);
+ LIST_COMMANDS(_)
+ #undef _
+
+ fprintf(stderr, "%s is a multicall binary and cannot be execute directly\n", argv[0]);
+ return 127;
+}