From: Eli Zaretskii <eliz@gnu.org>
To: binutils@sourceware.cygnus.com
Subject: DOS/Windows-related changes in the include subdirectory
Date: Mon, 06 Sep 1999 01:14:00 -0000 [thread overview]
Message-ID: <199909060814.EAA23317@mescaline.gnu.org> (raw)
This adds a new file with several macros for platform-independent
handling of file names.
1999-07-08 Eli Zaretskii <eliz@is.elta.co.il>
* filenames.h: New file.
(DOSISH_FILENAMES, MONOCASE_FILENAMES, FILENAME_CMP): New macros.
*** /dev/null Sat Jul 31 17:57:06 1999
--- include/filename.h Tue Jul 27 19:15:42 1999
***************
*** 0 ****
--- 1,23 ----
+ /* Macros for taking apart, interpreting and processing file names.
+
+ These are here because some non-Posix (a.k.a. DOSish) systems have
+ the drive letter brain-damage at the beginning of an absolute file
+ name, use forward- and back-slash in path names interchangeably, and
+ some of them have case-insensitive file names. */
+
+ #if defined(__MSDOS__) || defined(_WIN32)
+ #define IS_SLASH(c) ((c) == '/' || (c) == '\\')
+ #define IS_ABSOLUTE(f) (IS_SLASH((f)[0]) || (f)[0] && (f)[1] == ':')
+ #define DOSISH_FILENAMES 1
+ #define MONOCASE_FILENAMES 1
+ #else
+ #define IS_SLASH(c) ((c) == '/')
+ #define IS_ABSOLUTE(f) (IS_SLASH((f)[0]))
+ #define MONOCASE_FILENAMES 0
+ #endif
+
+ #if MONOCASE_FILENAMES
+ #define FILENAME_CMP(s1, s2) strcasecmp(s1, s2)
+ #else
+ #define FILENAME_CMP(s1, s2) strcmp(s1, s2)
+ #endif
next reply other threads:[~1999-09-06 1:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-06 1:14 Eli Zaretskii [this message]
1999-09-06 8:10 ` Ian Lance Taylor
1999-09-06 10:22 ` Eli Zaretskii
1999-09-06 10:31 ` Ian Lance Taylor
1999-09-06 11:20 ` Mark E.
1999-09-07 5:54 ` Eli Zaretskii
1999-09-07 5:49 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199909060814.EAA23317@mescaline.gnu.org \
--to=eliz@gnu.org \
--cc=binutils@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).