All pastes #364286 Raw Edit

Cody Brocious

public text v1 · immutable
#364286 ·published 2007-02-20 01:26 UTC
rendered paste body
@_ = <STDIN>;
$_ = join("", @_);

$W = /[ \t]*/;
$WR = /[ \t]+/;

# preprocessor directives
s/^\#.*$//gm;

# comments
s/\/\*.*?\*\///gs;

# whitespace
s/\n//gs;
s/\t/ /;
s/  / /gs while(/  /);
s/; /;/gs;

# externs
s/extern.*?\{//gs;

# typedefs
s/typedef$WR[^{};]+;//gs;
s/typedef$WR//gs;

# clean for output
s/;/;\n/gs;

print $_;