aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-10-14 13:18:19 +0200
committerMattias Andrée <maandree@kth.se>2017-10-14 13:18:19 +0200
commit47caacbfc9870db62552138baf3805e4ffc99778 (patch)
tree43803b19807bc472bdca13c872a7eb765552af1a /common.h
parentUpdate readme (diff)
downloadsha3sum-47caacbfc9870db62552138baf3805e4ffc99778.tar.gz
sha3sum-47caacbfc9870db62552138baf3805e4ffc99778.tar.bz2
sha3sum-47caacbfc9870db62552138baf3805e4ffc99778.tar.xz
Use arg.h instead of argparser
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'common.h')
-rw-r--r--common.h43
1 files changed, 19 insertions, 24 deletions
diff --git a/common.h b/common.h
index e3182dc..f4fff6b 100644
--- a/common.h
+++ b/common.h
@@ -1,39 +1,34 @@
/* See LICENSE file for copyright and license details. */
#include <libkeccak.h>
-#include <argparser.h>
-
-#define libkeccak_spec_keccak libkeccak_spec_sha3
-#define LIBKECCAK_KECCAK_SUFFIX ""
-
/**
* Wrapper for `run` that also initialises the command line parser
*
- * @param algo The name of the hashing algorithm, must be a string literal
- * @param prog The name of program, must be a string literal
* @param suffix The message suffix
*/
-#define RUN(algo, prog, suffix)\
- (args_init(algo " checksum calculator",\
- prog " [options...] [--] [files...]", NULL,\
- NULL, 1, 0, args_standard_abbreviations),\
- run(argc, argv, &spec, suffix))
-
-
-/**
- * Print the checksum in binary
- */
-#define REPRESENTATION_BINARY 0
+#define RUN(suffix)\
+ (run(argc, argv, &spec, suffix))
-/**
- * Print the checksum in upper case hexadecimal
- */
-#define REPRESENTATION_UPPER_CASE 1
/**
- * Print the checksum in lower case hexadecimal
+ * Message digest representation formats
*/
-#define REPRESENTATION_LOWER_CASE 2
+enum representation {
+ /**
+ * Print the checksum in binary
+ */
+ REPRESENTATION_BINARY,
+
+ /**
+ * Print the checksum in upper case hexadecimal
+ */
+ REPRESENTATION_UPPER_CASE,
+
+ /**
+ * Print the checksum in lower case hexadecimal
+ */
+ REPRESENTATION_LOWER_CASE
+};
/**