arg.h (426B)
1 #ifndef ARG_H 2 #define ARG_H 3 4 #define USED(x) ((void)(x)) 5 6 extern char *argv0; 7 8 #define ARGBEGIN for(argv0 = *argv, argv++, argc--;\ 9 argv[0] && argv[0][0]=='-' && argv[0][1];\ 10 argc--, argv++) {\ 11 char _argc;\ 12 _argc = argv[0][1];\ 13 switch(_argc) 14 #define ARGEND USED(_argc);} USED(argv);USED(argc); 15 #define EARGF(x) ((argv[1] == nil)? ((x), abort(), (char *)0) :\ 16 (argc--, argv++, argv[0])) 17 18 #endif 19