Rev | Line | |
---|
[9] | 1 | dnl This probably will not run on any m4 that cannot
|
---|
| 2 | dnl handle char constants in eval.
|
---|
| 3 | dnl
|
---|
| 4 | changequote(<,>) define(HASHVAL,99) dnl
|
---|
| 5 | define(hash,<eval(str(substr($1,1),0)%HASHVAL)>) dnl
|
---|
| 6 | define(str,
|
---|
| 7 | <ifelse($1,",$2,
|
---|
| 8 | <str(substr(<$1>,1),<eval($2+'substr($1,0,1)')>)>)
|
---|
| 9 | >) dnl
|
---|
| 10 | define(KEYWORD,<$1,hash($1),>) dnl
|
---|
| 11 | define(TSTART,
|
---|
| 12 | <struct prehash {
|
---|
| 13 | char *keyword;
|
---|
| 14 | int hashval;
|
---|
| 15 | } keytab[] = {>) dnl
|
---|
| 16 | define(TEND,< "",0
|
---|
| 17 | };>) dnl
|
---|
Note:
See
TracBrowser
for help on using the repository browser.