3 system("grep 'define NETSNMP_DS_' ../../include/net-snmp/library/default_store.h > default_store.h");
4 #gcc -E ../../include/net-snmp/library/default_store.h | grep -v default_store.h >> default_store.h
5 system("h2xs -n NetSNMP::default_store -O default_store.h");
7 open(ORIG,"default_store.xs");
8 open(NEW,"NetSNMP/default_store/default_store.xs");
9 open(OUT,">default_store_new.xs");
11 # get up to the include from the original file
14 last if (/include <net-snmp\/library\/default_store.h/);
17 # skip up to the include from the original file
19 last if (/include <default_store.h>/);
22 # include the entire new file
25 # skip past the constant portion of the old file
27 last if (/netsnmp_ds_get_bool/);
31 # We need the last two lines
43 open(H,"default_store.h");
45 open(OUT,">test.pl.new");
49 last if (/\%tests =/);
53 if (/define\s+(\w+)\s+(\d+)/) {
54 printf OUT (" %-40s => %d,\n", "\"$1\"", $2);
55 $tokenlist .= " $1\n";
67 # modify the perl module itself
69 open(H,"default_store.h");
70 open(ORIG,"default_store.pm");
71 open(OUT,">default_store_new.pm");
76 last if (/\%EXPORT_TAGS =/);
80 last if (/netsnmp_ds_get_boolean/);
87 last if (/\@EXPORT =/);
98 last if (/head2 Exportable constants/);
101 print OUT $tokenlist;
103 last if (/head2 Exportable functions/);
115 print "updated test.pl\n";
116 rename("test.pl.new","test.pl");
117 rename("default_store_new.pm", "default_store.pm");
118 print "updated default_store.pm\n";
119 rename("default_store_new.xs", "default_store.xs");
120 print "updated default_store.xs\n";
123 # remove the temp files.
125 system("rm -rf NetSNMP");
126 unlink("default_store.h");