diff options
author | Aaron Marcher <info@nulltime.net> | 2016-09-17 18:07:03 +0200 |
---|---|---|
committer | Aaron Marcher (drkhsh) <info@nulltime.net> | 2016-09-17 18:07:03 +0200 |
commit | 37959ca569a4bf69c6c1bbb16991cfc6d8452970 (patch) | |
tree | 9554e8d808f72b39bd66c512aff96aa2d5292de3 /arg.h | |
parent | d73118eaa47a9c4ea9ac9860b3d8b6e4c7c388dc (diff) |
moved headers to extern
Diffstat (limited to 'arg.h')
-rw-r--r-- | arg.h | 55 |
1 files changed, 0 insertions, 55 deletions
@@ -1,55 +0,0 @@ -/* - * Copy me if you can. - * by 20h - */ - -#ifndef __ARG_H__ -#define __ARG_H__ - -extern char *argv0; - -#define USED(x) ((void)(x)) - -/* use main(int argc, char *argv[]) */ -#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\ - argv[0] && argv[0][1]\ - && argv[0][0] == '-';\ - argc--, argv++) {\ - char _argc;\ - char **_argv;\ - int brk;\ - if (argv[0][1] == '-' && argv[0][2] == '\0') {\ - argv++;\ - argc--;\ - break;\ - }\ - for (brk = 0, argv[0]++, _argv = argv;\ - argv[0][0] && !brk;\ - argv[0]++) {\ - if (_argv != argv)\ - break;\ - _argc = argv[0][0];\ - switch (_argc) - -#define ARGEND }\ - USED(_argc);\ - }\ - USED(argv);\ - USED(argc); - -#define ARGC() _argc - -#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\ - ((x), abort(), (char *)0) :\ - (brk = 1, (argv[0][1] != '\0')?\ - (&argv[0][1]) :\ - (argc--, argv++, argv[0]))) - -#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\ - (char *)0 :\ - (brk = 1, (argv[0][1] != '\0')?\ - (&argv[0][1]) :\ - (argc--, argv++, argv[0]))) - -#endif - |