Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

arg.h

Name: Anonymous 2016-02-21 17:04

/*
* Copy me if you can.
* by 20h
*/

#ifndef ARG_H__
#define ARG_H__

extern char *argv0;

/* use main(int argc, char *argv[]) */
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
argv[0] && argv[0][0] == '-'\
&& argv[0][1];\
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 }\
}

#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

Name: Anonymous 2016-02-21 17:48

Plan9 will never be unix. Pike started this splinter cult nobody pays attention to.

Please use K&R-approved getopt(3) API.

Name: Anonymous 2016-02-21 18:04

ARGB EGIN

Name: Anonymous 2016-02-22 4:11

What the fuck. Use a language with proper macros next time.

Name: Anonymous 2016-02-22 18:35

>>4
A proper language wouldn't need macros to do that.

Name: Anonymous 2016-02-22 18:51

This thread represents everything that's wrong with the Unix process model, as well as everything that's wrong with C. Burn the mistakes of the past, salt the earth.

Name: Anonymous 2016-02-22 20:43

>>6
What is wrong with the ``Unix process model''?

Name: Anonymous 2016-02-22 21:14

>>7
Everything. Modular kernel is shit. Layered kernels will inherit the Earth. Praise Dickstra.

Name: Anonymous 2016-02-22 21:44

>>7
Parameters, input/output, and return codes to name 3.

Name: Anonymous 2016-02-22 22:26

>>9
How would you fix it?

Name: Anonymous 2016-02-22 23:01

>>10
systemd

Name: Anonymous 2016-02-22 23:02

>>10
Make processes into proper objects a la Powershell, it's current year for fuck's sake.

Name: Anonymous 2016-02-23 11:24

aaaaaaarrrrrgggggggg.h

Name: Anonymous 2016-02-23 19:13

>>12
Done, done and done. Powershell is just a CLR REPL. Choose your language.

Name: Anonymous 2016-02-24 15:45

>>11
>>12
let's not get crazy here.

Don't change these.
Name: Email:
Entire Thread Thread List