📄 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 programselect(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_PROGRAMwhile ( <> ) { chop; printf "\t%s, \n\t\t\"%s\", sizeof(%s));\n", $mask, $_,$_;}print "\n}\n";close CODE;# compile C programselect(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;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -