public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* DOS/Windows-related changes in the include subdirectory
@ 1999-09-06  1:14 Eli Zaretskii
  1999-09-06  8:10 ` Ian Lance Taylor
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 1999-09-06  1:14 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DOS/Windows-related changes in the include subdirectory
  1999-09-06  1:14 DOS/Windows-related changes in the include subdirectory Eli Zaretskii
@ 1999-09-06  8:10 ` Ian Lance Taylor
  1999-09-06 10:22   ` Eli Zaretskii
  1999-09-07  5:49   ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Ian Lance Taylor @ 1999-09-06  8:10 UTC (permalink / raw)
  To: eliz; +Cc: binutils

   Date: Mon, 6 Sep 1999 04:14:19 -0400
   From: Eli Zaretskii <eliz@gnu.org>

   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.

It might be nice to use the same set of macros that gcc uses, rather
than invent our own.  In gcc.c I see things like PATH_SEPARATOR,
DIR_SEPARATOR, DIR_SEPARATOR_2, IS_DIR_SEPARATOR,
HAVE_DOS_BASED_FILESYSTEM.

Ian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DOS/Windows-related changes in the include subdirectory
  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-07  5:54     ` Eli Zaretskii
  1999-09-07  5:49   ` Eli Zaretskii
  1 sibling, 2 replies; 7+ messages in thread
From: Eli Zaretskii @ 1999-09-06 10:22 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

> It might be nice to use the same set of macros that gcc uses, rather
> than invent our own.  In gcc.c I see things like PATH_SEPARATOR,
> DIR_SEPARATOR, DIR_SEPARATOR_2, IS_DIR_SEPARATOR,
> HAVE_DOS_BASED_FILESYSTEM.

Sorry, I didn't know GCC was special in this aspect.  I used the names
used by other packages, like Texinfo, Web2C and some others.

If you want me to change the definitions, please send me the
definitions from the GCC sources (I don't have them installed).
Please also tell me what to do in case some of the definitions I used
don't have any equivalents in GCC (the above names seem to indicate
that e.g. IS_ABSOLUTE and FILENAME_CMP aren't used by GCC).

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DOS/Windows-related changes in the include subdirectory
  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
  1 sibling, 1 reply; 7+ messages in thread
From: Ian Lance Taylor @ 1999-09-06 10:31 UTC (permalink / raw)
  To: eliz; +Cc: binutils

   Date: Mon, 6 Sep 1999 13:22:25 -0400
   From: Eli Zaretskii <eliz@gnu.org>

   > It might be nice to use the same set of macros that gcc uses, rather
   > than invent our own.  In gcc.c I see things like PATH_SEPARATOR,
   > DIR_SEPARATOR, DIR_SEPARATOR_2, IS_DIR_SEPARATOR,
   > HAVE_DOS_BASED_FILESYSTEM.

   Sorry, I didn't know GCC was special in this aspect.  I used the names
   used by other packages, like Texinfo, Web2C and some others.

If texinfo uses those macros, then they are fine with me.  I don't
know where the current version of texinfo lives.

   If you want me to change the definitions, please send me the
   definitions from the GCC sources (I don't have them installed).
   Please also tell me what to do in case some of the definitions I used
   don't have any equivalents in GCC (the above names seem to indicate
   that e.g. IS_ABSOLUTE and FILENAME_CMP aren't used by GCC).

For IS_ABSOLUTE, gcc uses specific code which tests
HAVE_DOS_BASED_FILESYSTEM.  I don't think gcc needs to compare file
names.

Ian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DOS/Windows-related changes in the include subdirectory
  1999-09-06 10:31     ` Ian Lance Taylor
@ 1999-09-06 11:20       ` Mark E.
  0 siblings, 0 replies; 7+ messages in thread
From: Mark E. @ 1999-09-06 11:20 UTC (permalink / raw)
  To: binutils, eliz

>    > It might be nice to use the same set of macros that gcc uses, rather
>    > than invent our own.  In gcc.c I see things like PATH_SEPARATOR,
>    > DIR_SEPARATOR, DIR_SEPARATOR_2, IS_DIR_SEPARATOR,
>    > HAVE_DOS_BASED_FILESYSTEM.
> 
>    If you want me to change the definitions, please send me the
>    definitions from the GCC sources (I don't have them installed).

Since I'm responsible for the above mentioned GCC changes, I can help you Eli if you are 
going to make the changes.

Mark

--- 
Mark Elbrecht, snowball3@bigfoot.com
http://snowball.frogspace.net/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DOS/Windows-related changes in the include subdirectory
  1999-09-06  8:10 ` Ian Lance Taylor
  1999-09-06 10:22   ` Eli Zaretskii
@ 1999-09-07  5:49   ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 1999-09-07  5:49 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

> If texinfo uses those macros, then they are fine with me.  I don't
> know where the current version of texinfo lives.

The latest pretest (texinfo-3.12s) is on alpha.gnu.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DOS/Windows-related changes in the include subdirectory
  1999-09-06 10:22   ` Eli Zaretskii
  1999-09-06 10:31     ` Ian Lance Taylor
@ 1999-09-07  5:54     ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 1999-09-07  5:54 UTC (permalink / raw)
  To: Mark E.; +Cc: binutils

> >    If you want me to change the definitions, please send me the
> >    definitions from the GCC sources (I don't have them installed).
> 
> Since I'm responsible for the above mentioned GCC changes, I can
> help you Eli if you are going to make the changes.

It's up to Ian.  If he wants me to change the macros to make them more
close to what GCC uses, I will do it.  I used these macros (with minor
changes, as the case in point might dictate) in quite a few packages
that now include them in official GNU releases, although GCC is
obviously not one of them.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1999-09-07  5:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-06  1:14 DOS/Windows-related changes in the include subdirectory Eli Zaretskii
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

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).