#238 Add dirname and basename functions to libmingwex.a

closed-accepted
2007-04-18
2005-06-23
Keith Marshall
No

This patch provides implementations of the dirname and
basename functions, suitable for inclusion in libmingwex.a.

Conforming generally to SUSv3, these implementations
have been extended to accommodate peculiarities of the
Win32 path naming conventions, viz. handling of drive
prefixes, and the use of slash and backslash as
alternative directory separator characters.

Included in the attached patch tarball:--

- Changes.txt: a ChangeLog entry.

- libgen.patch: the patch file; it has been generated
against the runtime module of MinGW CVS, as of 2005-06-23.

- dirname.cat.bz2: a preformatted manpage, specific to
this implementation of the dirname and basename
functions; it may be viewed by "bzip2 -c -d
dirname.cat.bz2 | less -is".

- testcase.c: a test program for evaluating the
behaviour of the dirname and basename functions.

Discussion

  • Keith Marshall
    Keith Marshall
    2005-06-23

    patch tarball for dirname and basename functions

     
    Attachments
  • Keith Marshall
    Keith Marshall
    2005-06-23

    Logged In: YES
    user_id=823908

    Original mandoc (nroff) source for the included
    dirname.cat.bz2 is also available. It probably is not much
    use, until the man port is completed. However, it may be
    useful to consider adding a manpage module to the CVS, or
    maybe just man directories within existing modules, where
    such documents could be stored.

     
  • Keith Marshall
    Keith Marshall
    2005-12-22

    Logged In: YES
    user_id=823908

    Although they may need some adaptation, to suit multibyte
    character locales, I propose committing these to CVS in
    their present form, so we have a tested base point against
    which to raise future patches. (I will add a note in the
    manpage about the locale restriction).

    Any objections? Any thoughts on an approriate CVS location
    for manpage sources -- should we keep them with the code
    sources, or add a separate manpage module?

    Regards,
    Keith.

     
  • Keith Marshall
    Keith Marshall
    2005-12-22

    • milestone: --> 519165
    • assigned_to: nobody --> keithmarshall
     
  • Keith Marshall
    Keith Marshall
    2006-12-31

    Logged In: YES
    user_id=823908
    Originator: YES

    I finally found a round tuit for this; libgen.h, basename.c and dirname.c are now in CVS.

    I haven't committed the manpage source yet; I'd like to review it beforehand. When ready, I'll add a `man' directory to the CVSROOT/mingw tree. Any thoughts on how manpages should be delivered? A separate `mandist' target, building a separate manpage package perhaps?

    I'd also like to commit the `testcase.c' somewhere in the same source tree; perhaps in a new `testsuite' directory. We might then wish to consider relocating other existing test programs to there; I'm really not very keen on polluting the top level directory with testcase code.

    Finally, I've had some thoughts on the multibyte character locale issue; I'll post a proposed follow up patch to address this, in a day or two.

    Regards,
    Keith.

     
  • Howard Chu
    Howard Chu
    2006-12-31

    Logged In: YES
    user_id=330860
    Originator: NO

    I tend to expect to find everything associated with a package all in one place, i.e., manpage source in the same area as the code.

    If anyone is interested, I have a very simple man2html program that I use for rendering manpages. It works either as a CGI or as a regular commandline app. You can see a sample at http://76.168.84.21/~hyc/man/. That's a symbolic link into my source tree's manpages; the output is generated on the fly.

     
  • Keith Marshall
    Keith Marshall
    2006-12-31

    Logged In: YES
    user_id=823908
    Originator: YES

    Once I finish with it, the manpage source will certainly be included in the package source tarball; that is necessary, to ensure that the source is self contained. But, I suspect that the majority of MinGW users won't bother to download that; most will go for the binary distribution.

    Traditionally, we haven't supplied manpages with the MinGW specific packages. That's likely because, until I put out the snapshot of a man port a few months back, there has been no easy way to display them on Woe32. That argument no longer applies, but this will probably be the first manpage which is actually MinGW specific.

    I don't have any strong opinion on whether this should be bundled with the binary tarball, or whether we should provide a separate manpage package; that's why I invited comment. Do bear in mind, that to get the manpage reader, the user must install the mingwPORT of groff, and the separate man package. Thus, if I bundle the manpage with the binary runtime tarball, users won't be able to use it without additional downloads anyway. Ok, for just one page, the additional overhead in the binary tarball wouldn't be great, but I'd hope that we can expand on that one offering in the future. So, what it boils down to is, do we maintain two tarballs for distribution, namely source and binary+doc, or do we provide three, namely source, binary and doc as separate entities?

    As I say, I don't have a strong opinion on the binary+doc composite, or separate binary and doc formats. I would not be comfortable, however, with providing the docs only within the source distribution; that would force users who want only the binary plus the docs to download the source too, and they may not be happy with that.

    I appreciate you taking the time to respond, Howard. Would I be correct in interpreting your opinion as a vote in favour of the composite binary+doc format?

    Regards,
    Keith.

     
  • Howard Chu
    Howard Chu
    2006-12-31

    Logged In: YES
    user_id=330860
    Originator: NO

    Yes, I vote for binary+doc in one package. Defaulting to providing software with its documentation just seems wrong to me, and creating a separate package for the doc seems like unnecessary effort. Also, even if the manpage text isn't pretty, it at least can still be read even without the full groff suite, and there are other options (like man2html) as well.

     
  • Ross Crawford
    Ross Crawford
    2007-04-17

    Logged In: YES
    user_id=54532
    Originator: NO

    Anything happening with this? I'd like to use dirname and basename, I currently use my own version but it would be nice to be able to use a "standard" version.

     
  • Keith Marshall
    Keith Marshall
    2007-04-18

    • milestone: 519165 --> IINR_-_Include_In_Next_Release
    • status: open --> closed-accepted