#!/usr/bin/perl open NPAPI, "genconst.c" or die "genconst.c: $!"; my @words = do { local $/; =~ /(\w+)/g }; print GENCONST "#include \"SDK/Include/npapi.h\"\nint main(void) {\n"; for ( grep !/NP_NOERR|NP_EINVAL|NP_EABORT|NP_LOADDS|NPERR_BASE|NP_SETWINDOW|NP_Port|NP_PRINT/, grep /NPERR_|NP_|NPVERS_/, @words ) { print GENCONST " printf (\"sub $_ (){ %d }\\n\", $_);\n"; } print GENCONST " return 0;\n}"; close GENCONST; close NPAPI;