mkpflags.pl
musicmud-2.1.6/src/mkpflags.pl · 492 B
From the archive musicmud2.1.6.tar.gz
Download the archive « Back to the archive contents
#!/usr/bin/perl
print "// This file made from ../data/pflags. Don't edit, it'll go away.\n";
print "\#ifndef PFLAGS_H\n\#define PFLAGS_H\n\n";
$temp = 0;
print "enum PFlag {\n";
while (<STDIN>) {
s/\n//;
@thing = split(' ');
print " PFL_", uc $thing[0], " = ", $temp, " , \n";
$temp++;
}
if ($temp>(32*16)) {
print "#error too many pflags to fit";
}
print "};\n";
print "inline void operator++(PFlag &p, int=0) { p = PFlag(p + 1); }\n";
print "\nextern int PFL_MAX;\n\n#endif\n";