Instead of lumping all strings of a file into a single hash function,
split them up into their respective sections, as there is no point in
matching against strings that aren't part of the switch statement. This
should give a bit of a performance boost.
Nested hash sections require special handling as the wrapper script
isn't smart enough to hande them automaticaly.
Change-Id: I74863dfe6ca412d58101d37f9c9c85078826f1a4
For source files generated from the "strhash" helper script, output line
and file number information into the generated .c source to help gdb and
other tools correspond the compiled code with the correct source code.
Change-Id: Ieddc86ab59b41ab26942e8a7d3c24e7800e9936f
Code generated by gperf does not have complete initialisers for all
struct elements, producing a warning from gcc. Suppress this warning for
code from gperf.
Change-Id: Ie61eb42b293041e43c62df702123f725f6116a9c
If the gperf dependency isn't present then people
seem to miss that it's not available. Admittedly,
the error message isn't entirely obvious:
| Makefile:135: .depend: No such file or directory
| ../utils/const_str_hash < sdp.c > sdp.strhash.c
| open2: exec of gperf -t -E -l -c -t -I -H __csh_hash -N __csh_lookup_raw failed at ../utils/const_str_hash line 37.
Change-Id: I15edcd0517e88c690be246dc628cb55e25297dd0
Closes: https://github.com/sipwise/rtpengine/issues/718
To avoid repeated strcmp()s and make use of switch()'s optimised binary
lookup, we employ a second build step that preprocesses certain .c files
and uses gperf to substitute pseudomacros with their respective constant
hash value.
Change-Id: Id89c4728a0fc7aa911691d4dd1ba8e7b3916a983