shared: Add a function to prefix filenames with datadir
authorDerek Foreman <derekf@osg.samsung.com>
Tue, 6 Feb 2018 21:18:36 +0000 (15:18 -0600)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 7 Feb 2018 09:38:21 +0000 (11:38 +0200)
commit83b900fb4649346162e8f8165bcff1927177c31f
tree0e0be6415d8a0a5c17a07853a624c91a0abc5345
parent598ee9ddf53f17494e7e1e83d8d576712f0dad19
shared: Add a function to prefix filenames with datadir

Currently we look for png files in their install directory, and we
manufacture filenames with string pasting at compile time.

This new function will allow overriding the compile time setting with
the env var WESTON_DATA_DIR so we can do neat tricks like allow our
test suite to pass when we haven't yet installed icons system-wide.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
[Pekka: split if-branch into two lines.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
shared/file-util.c
shared/file-util.h