|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T m
Length: 716 (0x2cc) Types: TextFile Names: »mksizes«
└─⟦4f9d7c866⟧ Bits:30007245 EUUGD6: Sikkerheds distributionen └─⟦b5330643c⟧ »./cops/perl-4.019/perl.tar.Z« └─⟦2b9a58213⟧ └─⟦this⟧ »perl-4.019/h2pl/mksizes«
#!/usr/local/bin/perl ($iam = $0) =~ s%.*/%%; $tmp = "$iam.$$"; open (CODE,">$tmp.c") || die "$iam: cannot create $tmp.c: $!\n"; $mask = q/printf ("$sizeof{'%s'} = %d;\n"/; # write C program select(CODE); print <<EO_C_PROGRAM; #include <sys/param.h> #include <sys/types.h> #include <sys/socket.h> #include <net/if_arp.h> #include <net/if.h> #include <net/route.h> #include <sys/ioctl.h> main() { EO_C_PROGRAM while ( <> ) { chop; printf "\t%s, \n\t\t\"%s\", sizeof(%s));\n", $mask, $_,$_; } print "\n}\n"; close CODE; # compile C program select(STDOUT); system "cc $tmp.c -o $tmp"; die "couldn't compile $tmp.c" if $?; system "./$tmp"; die "couldn't run $tmp" if $?; unlink "$tmp.c", $tmp;