2017-12-08 00:51:19 -05:00
|
|
|
/ANSI-C code/{
|
|
|
|
h
|
|
|
|
s/.*/ANSI:offset:/
|
|
|
|
x
|
|
|
|
}
|
2017-12-15 09:42:43 -05:00
|
|
|
/\/\*!ANSI{\*\//{
|
2017-12-08 00:51:19 -05:00
|
|
|
G
|
2017-12-15 09:42:43 -05:00
|
|
|
s/\/\*!ANSI{\*\/\(.*\)\/\*}!ANSI\*\/\(.*\)\nANSI:.*/\/\*\1\*\/\2/
|
2017-12-08 00:51:19 -05:00
|
|
|
}
|
|
|
|
s/(int)([a-z_]*)&((struct \([a-zA-Z_0-9][a-zA-Z_0-9]*\)_t *\*)0)->\1_str\([1-9][0-9]*\),/gperf_offsetof(\1, \2),/g
|
|
|
|
/^#line/{
|
|
|
|
G
|
|
|
|
x
|
|
|
|
s/:offset:/:/
|
|
|
|
x
|
|
|
|
s/\(.*\)\(\n\).*:offset:.*/#define gperf_offsetof(s, n) (short)offsetof(struct s##_t, s##_str##n)\2\1/
|
|
|
|
s/\n[^#].*//
|
|
|
|
}
|
|
|
|
/^[a-zA-Z_0-9]*hash/,/^}/{
|
|
|
|
s/ hval = / hval = (unsigned int)/
|
|
|
|
s/ return / return (unsigned int)/
|
|
|
|
}
|
2022-05-24 04:23:23 -04:00
|
|
|
s/^\(static\) \(unsigned char gperf_downcase\)/\1 const \2/
|