test/utils: support operator name aliases
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Thu, 9 Apr 2015 10:13:09 +0000 (13:13 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 15 Apr 2015 09:41:47 +0000 (12:41 +0300)
commit2c5fac932061351ae2153026003539745aa9b44e
tree93db6674a47bd3f565c26353fe715972358d81fc
parentf122907dc1d18cdd7e11fec5e4f9c220c62e6e77
test/utils: support operator name aliases

Previously there was a flat list of operators (pixman_op_t), used to
iterate over all operators when looking up an operator from name or
listing them. This cannot support name aliases.

To support name aliases (multiple name strings mapping to the same
operator), create an operator-name mapping table. Functions
operator_name, operator_from_string, and list_operators should keep on
working exactly like before, except operator_from_string now recognizes
a few aliases too.

Name aliases will be useful in follow-up patches, where
lowlevel-blt-bench.c is converted to parse operator names from strings.
Lowlevel-blt-bench uses shorthand names instead of the usual names. This
change allows lowlevel-blt-bench.s to use operator_from_string in the
future.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ben Avison <bavison@riscosopen.org>
test/utils.c