#!/usr/bin/perl
open STDIN, "<AIO.xs"
or die "AIO.xs: $!";
open STDOUT, ">def0.h"
or die "def0.h: $!";
print <<EOF;
/* GENERATED FILE */
/* use ./gendef0 to regenerate this file */
EOF
while (<>) {
if (/^\s*const_iv\s*\((\S+)\)\s*$/ || /^\s*const_niv\s*\([^,]+,\s*(\S+)\)\s*$/) {
print "#ifndef $1\n",
"#define $1 0\n",
"#endif\n";
}
}