File: genofsmacro.pl

package info (click to toggle)
gatling 0.13-6
  • links: PTS
  • area: main
  • in suites: sid, stretch
  • size: 1,196 kB
  • ctags: 1,115
  • sloc: ansic: 23,805; makefile: 143; sh: 71; perl: 30
file content (16 lines) | stat: -rw-r--r-- 407 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl
$max=80;

# print "#define OFS32(buf,x) \\\n";
# for ($i=0; $i<$max; ++$i) {
#   print "  ((buf[$i]==x[0] && buf[$i+1]==x[1] && buf[$i+2]==x[2] && buf[$i+3]==x[3])?$i: \\\n";
# }
# print "  -1",")" x $max,"\n\n";

print "#define OFS16(buf,x) \\\n";
for ($i=0; $i<$max; ++$i) {
  print "  ((sizeof(buf)>$i+1 && buf[$i]==x[0] && buf[$i+1]==x[1])?$i: \\\n";
}
print "  -1",")" x $max,"\n\n";