numtools

perform numerical operations on vectors and matrices in unix pipes
git clone git://src.adamsgaard.dk/numtools # fast
git clone https://src.adamsgaard.dk/numtools.git # slow
Log | Files | Refs | README | LICENSE Back to index

commit 59276b770d09a73afca015d649e2726d7ab2bec7
parent 7a3d0ac06b0b914fbd04bd19e76fc682fcb38a20
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Tue, 31 Aug 2021 10:42:38 +0200

Makefile: increment VERSION to 0.1.2

Diffstat:
MMakefile | 2+-
Aarg.h | 38++++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -1,7 +1,7 @@ .POSIX: NAME = mathtools -VERSION = 0.1.1 +VERSION = 0.1.2 # paths PREFIX = /usr/local diff --git a/arg.h b/arg.h @@ -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 +