blob: 675c6b0ee67a1a3607f0c3f332e129ecd6106fb9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/usr/bin/perl
# $Id$
###############################################################################
## ##
## File: invert-bitfields.pl ##
## Author: Wolfgang S. Rupprecht <wolfgang@wsrcc.com> ##
## Created: Mon Jul 25 01:58:12 PDT 2005 ##
## Contents: invert the bitfields ##
## ##
## Copyright (c) 2005 Wolfgang S. Rupprecht. ##
## All rights reserved. ##
## ##
###############################################################################
$inside = 0;
$linestack = "";
while (<>) {
if (/^[ ]+uint[ ]+parity:6;/) {
$inside = 1;
# print ">>> starting inside\n";
$linestack = $_ . $linestack;
}
elsif (/^[ ]+uint[ ]+_pad:2;/) {
$inside = 0;
$linestack = $_ . $linestack;
print $linestack;
$linestack = "";
# print ">>> starting outside\n";
}
else {
if ($inside) {
$linestack = $_ . $linestack;
}
else {
print $_;
}
}
}
# end
|