]> git.notmuchmail.org Git - notmuch/commit - lib/open.cc
compat: rename {,notmuch_}canonicalize_file_name
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Sat, 24 Apr 2021 01:05:37 +0000 (08:05 +0700)
committerDavid Bremner <david@tethera.net>
Sat, 24 Apr 2021 11:07:00 +0000 (08:07 -0300)
commit441a327051f5357175029709030a0ee51131379d
treefcb47d140f922b4036f0f763e25ede21b0783c3c
parent62f03b6ab86bdc378198f9c1a86cb51ead289961
compat: rename {,notmuch_}canonicalize_file_name

When compat canonicalize_file_name was introduced, it was limited to
C code only because it was used by C code only during that time.

>From 5ec6fd4d, (lib/open: check for split configuration when creating
database., 2021-02-16), lib/open.cc, which is C++, relies on the
existent of canonicalize_file_name.

However, we can't blindly enable canonicalize_file_name for C++ code,
because different implementation has different additional signature for
C++ and users can arbitrarily add -DHAVE_CANONICALIZE_FILE_NAME=0 to
{C,CXX}FLAGS.

Let's move our implementation into a util library.

Helped-by: Tomi Ollila <tomi.ollila@iki.fi>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
compat/Makefile.local
compat/canonicalize_file_name.c [deleted file]
compat/compat.h
lib/open.cc
notmuch-config.c
util/Makefile.local
util/path-util.c [new file with mode: 0644]
util/path-util.h [new file with mode: 0644]