01/05/2020 03:08, Ranjit Menon: > On 4/30/2020 12:30 AM, Dmitry Kozlyuk wrote: > > On 2020-04-30 08:52 GMT+0200 Thomas Monjalon wrote: > >> 30/04/2020 01:24, Pallavi Kadam: > >>> Added fnmatch implementation on Windows to support > >>> log level arguments. > >>> The source file is with BSD-3-Clause license. > >>> https://github.com/lattera/freebsd/blob/master/usr.bin/csup/fnmatch.c > >> > >> Sorry for the naive question, I don't know Windows programming. > >> > >> Do we really need this external code? > >> Why RtlIsNameInExpression from Windows cannot be used? > >> https://docs.microsoft.com/en-us/windows/win32/devnotes/rtlisnameinexpression > > > > The general reason not to use Win32 API for globbing is poorly documented > > contract: what are the exact matching rules? They're definitely incompatible > > with fnmatch(3). IMO small external code is better than unknown behavior. > > > > RtlIsNameInExpression is an internal call for drivers and services with a > > cumbersome API. PathMatchSpecA is the user-mode interface, but see above. > > > > https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-pathmatchspeca > > > > I will agree with Dmitry here. The fnmatch external code is shipping, > production quality code. So it's better to use it than writing something > new.
OK thank you for the explanations and opinions.