| 1 |
root |
1.1 |
#!/usr/bin/perl |
| 2 |
|
|
|
| 3 |
|
|
open NPAPI, "<SDK/Include/npapi.h" or die "SDK/Include/npapi.h: $!"; |
| 4 |
|
|
open GENCONST, ">genconst.c" or die "genconst.c: $!"; |
| 5 |
|
|
|
| 6 |
|
|
my @words = do { local $/; <NPAPI> =~ /(\w+)/g }; |
| 7 |
|
|
|
| 8 |
|
|
print GENCONST "#include \"SDK/Include/npapi.h\"\nint main(void) {\n"; |
| 9 |
root |
1.2 |
for ( grep !/NP_NOERR|NP_EINVAL|NP_EABORT|NP_LOADDS|NPERR_BASE|NP_SETWINDOW|NP_Port|NP_PRINT/, |
| 10 |
root |
1.1 |
grep /NPERR_|NP_|NPVERS_/, |
| 11 |
|
|
@words ) { |
| 12 |
|
|
print GENCONST " printf (\"sub $_ (){ %d }\\n\", $_);\n"; |
| 13 |
|
|
} |
| 14 |
|
|
|
| 15 |
|
|
print GENCONST " return 0;\n}"; |
| 16 |
|
|
|
| 17 |
|
|
close GENCONST; |
| 18 |
|
|
close NPAPI; |