tMakefile: increment VERSION to 0.1.2 - numtools - perform numerical operations on vectors and matrices in unix pipes
(HTM) git clone git://src.adamsgaard.dk/numtools
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 59276b770d09a73afca015d649e2726d7ab2bec7
(DIR) parent 7a3d0ac06b0b914fbd04bd19e76fc682fcb38a20
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 31 Aug 2021 10:42:38 +0200
Makefile: increment VERSION to 0.1.2
Diffstat:
M Makefile | 2 +-
A arg.h | 38 +++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/Makefile b/Makefile
t@@ -1,7 +1,7 @@
.POSIX:
NAME = mathtools
-VERSION = 0.1.1
+VERSION = 0.1.2
# paths
PREFIX = /usr/local
(DIR) diff --git a/arg.h b/arg.h
t@@ -0,0 +1,38 @@
+/* by 20h */
+#ifndef ARG_H
+#define ARG_H
+
+#define USED(x) ((void)(x))
+
+extern char *argv0;
+
+#define ARGBEGIN for(argv0 = *argv, argv++, argc--;\
+ argv[0] && argv[0][0] == '-'\
+ && argv[0][1];\
+ argc--, argv++) {\
+ char _argc;\
+ char **_argv;\
+ if(argv[0][1] == '-' && argv[0][2] == '\0') {\
+ argv++;\
+ argc--;\
+ break;\
+ }\
+ int i_;\
+ for(i_ = 1, _argv = argv; argv[0][i_];\
+ i_++) {\
+ if(_argv != argv)\
+ break;\
+ _argc = argv[0][i_];\
+ switch(_argc)
+
+#define ARGEND }\
+ USED(_argc);\
+ }\
+ USED(argv);\
+ USED(argc);
+
+#define EARGF(x) ((argv[1] == NULL)? ((x), abort(), (char *)0) :\
+ (argc--, argv++, argv[0]))
+
+#endif
+