s3/packaging: Fix rpm build issues on RHEL4.
[Samba.git] / source3 / script / gap.awk
blob11680d10f9ea83a44520e186cdb0c8e50f8b26ca
1 BEGIN { hv["0"] = 0; hv["1"] = 1; hv["2"] = 2; hv["3"] = 3;
2 hv["4"] = 4; hv["5"] = 5; hv["6"] = 6; hv["7"] = 7;
3 hv["8"] = 8; hv["9"] = 9; hv["A"] = 10; hv["B"] = 11;
4 hv["C"] = 12; hv["D"] = 13; hv["E"] = 14; hv["F"] = 15;
5 hv["a"] = 10; hv["b"] = 11; hv["c"] = 12; hv["d"] = 13;
6 hv["e"] = 14; hv["f"] = 15;
8 first = 0; last = 0; idx = 0;
11 function tonum(str)
13 num=0;
14 cnt=1;
15 while (cnt <= length(str)) {
16 num *= 16;
17 num += hv[substr(str,cnt,1)];
18 ++cnt;
20 return num;
24 u = tonum($1);
25 if (u - last > 6)
27 if (last)
29 printf (" { 0x%04x, 0x%04x, %5d },\n",
30 first, last, idx);
31 idx -= u - last - 1;
33 first = u;
35 last = u;
38 END { printf (" { 0x%04x, 0x%04x, %5d },\n",
39 first, last, idx); }