bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] dirname: move m4/dos.m4 functionality into lib/dosname.h


From: Jim Meyering
Subject: Re: [PATCH] dirname: move m4/dos.m4 functionality into lib/dosname.h
Date: Fri, 25 Feb 2011 09:32:48 +0100

Paul Eggert wrote:
> OK, here's that promised patch for review.  I've tested it with Emacs
> and with coreutils, but I haven't pushed it into gnulib yet.
...
> +     dirname: move m4/dos.m4 functionality into lib/dosname.h
> +
> +     m4/dos.m4 needs to go.  It laboriously invokes the C compiler, and
> +     extracts symbols from it, puts them into config.h; but it's much
> +     easier to use the symbols directly.  filename.h already does this,
> +     but it disagrees with dos.m4 in some respects.  This patch
> +     introduces a different include file dosname.h that packages up
> +     dos.m4, and then later we can work on merging filename.h and
> +     dosname.h.
> +     * lib/dosname.h: New file.
> +     * lib/dirname.h (ISSLASH, FILE_SYSTEM_PREFIX_LEN):
> +     (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE):
> +     (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): Move to lib/dosname.h.
> +     * lib/at-func.c, lib/at-func2.c, lib/openat.c, lib/savewd.c:
> +     Include dosname.h, not dirname.h.
> +     * lib/rmdir.c, lib/stat.c, lib/unlink.c, lib/unlinkat.c:
> +     Include dosname.h, for definitions of symbols like ISSLASH
> +     that used to be in config.h.
> +     * m4/dirname.m4 (gl_DIRNAME_LGPL): Do not require gl_AC_DOS.
> +     * m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise.
> +     * m4/stat.m4 (gl_FUNC_STAT): Likewise.
> +     * m4/unlink.m4 (gl_FUNC_UNLINK): Likewise.
> +     * modules/dirname-lgpl (Files): Replace m4/dos.m4 with lib/dosname.h.
> +     * modules/rmdir (Files): Likewise.
> +     * modules/stat (Files): Likewise.
> +     * modules/unlink (Files): Likewise.
> +     * modules/lstat (Files): Add lib/dosname.h.
> +     * modules/openat (Files): Likewise.
> +     * modules/savewd (Files): Likewise.
> +     * modules/openat (Depends-on): Remove dirname-lgpl.
> +     * modules/savewd (Depends-on): Likewise.
> +     * tests/test-dirname.c: Do not use removed symbols like
> +     FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR.  Instead, use
> +     the remaining symbols, e.g., ISSLASH ('\\').

I've skimmed through it and like what I see.
Having to include dirname.h solely for its unrelated-to-dirname
macro definitions has always been bothersome.  Your pulling those
into the new dosname.h is an improvement.  You might want to note
somewhere that existing projects (e.g., some of mine) may want to
#include "dosname.h" instead of "dirname.h", if that was the case.
Obviously, since your new dirname.h includes dosname.h, no client
is forced to adjust its #include directives.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]