Mercurial > hg > xemacs-beta
diff lib-src/ootags.c @ 442:abe6d1db359e r21-2-36
Import from CVS: tag r21-2-36
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:35:02 +0200 |
parents | 84b14dcb0985 |
children | b39c14581166 |
line wrap: on
line diff
--- a/lib-src/ootags.c Mon Aug 13 11:33:40 2007 +0200 +++ b/lib-src/ootags.c Mon Aug 13 11:35:02 2007 +0200 @@ -64,31 +64,18 @@ # define DEBUG FALSE #endif -#ifdef MSDOS -# include <fcntl.h> -# include <sys/param.h> -# include <io.h> -# ifndef HAVE_CONFIG_H -# define DOS_NT -# include <sys/config.h> -# endif -#endif /* MSDOS */ - -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE # include <stdlib.h> # include <fcntl.h> # include <string.h> # include <io.h> # define MAXPATHLEN _MAX_PATH -# ifdef HAVE_CONFIG_H -# undef HAVE_NTGUI -# else -# define DOS_NT +# ifndef HAVE_CONFIG_H # define HAVE_GETCWD # endif /* not HAVE_CONFIG_H */ -#endif /* WINDOWSNT */ - -#if !defined (WINDOWSNT) && defined (STDC_HEADERS) +#endif /* WIN32_NATIVE */ + +#if !defined (WIN32_NATIVE) && defined (STDC_HEADERS) #include <stdlib.h> #include <string.h> #endif @@ -870,9 +857,9 @@ bool got_err; #endif -#ifdef DOS_NT +#ifdef WIN32_NATIVE _fmode = O_BINARY; /* all of files are treated as binary files */ -#endif /* DOS_NT */ +#endif /* WIN32_NATIVE */ progname = argv[0]; nincluded_files = 0; @@ -1064,12 +1051,12 @@ if (streq (tagfile, "-")) { tagf = stdout; -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* Switch redirected `stdout' to binary mode (setting `_fmode' doesn't take effect until after `stdout' is already open). */ if (!isatty (fileno (stdout))) setmode (fileno (stdout), O_BINARY); -#endif /* DOS_NT */ +#endif /* WIN32_NATIVE */ } else tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); @@ -4960,7 +4947,7 @@ if (p > buffer && p[-1] == '\r') { p -= 1; -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* Assume CRLF->LF translation will be performed by Emacs when loading this file, so CRs won't appear in the buffer. It would be cleaner to compensate within Emacs; @@ -5216,19 +5203,6 @@ return path; #else /* not HAVE_GETCWD */ -#ifdef MSDOS - char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ - - getwd (path); - - for (p = path; *p != '\0'; p++) - if (*p == '\\') - *p = '/'; - else - *p = lowcase (*p); - - return strdup (path); -#else /* not MSDOS */ linebuffer path; FILE *pipe; @@ -5239,7 +5213,6 @@ pclose (pipe); return path.buffer; -#endif /* not MSDOS */ #endif /* not HAVE_GETCWD */ } @@ -5289,7 +5262,7 @@ if (filename_is_absolute (file)) res = savestr (file); -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* We don't support non-absolute file names with a drive letter, like `d:NAME' (it's too much hassle). */ else if (file[1] == ':') @@ -5313,8 +5286,8 @@ while (cp >= res && !filename_is_absolute (cp)); if (cp < res) cp = slashp; /* the absolute name begins with "/.." */ -#ifdef DOS_NT - /* Under MSDOS and NT we get `d:/NAME' as absolute +#ifdef WIN32_NATIVE + /* Under Windows we get `d:/NAME' as absolute file name, so the luser could say `d:/../NAME'. We silently treat this as `d:/NAME'. */ else if (cp[0] != '/') @@ -5369,7 +5342,7 @@ char *fn; { return (fn[0] == '/' -#ifdef DOS_NT +#ifdef WIN32_NATIVE || (isalpha(fn[0]) && fn[1] == ':' && fn[2] == '/') #endif ); @@ -5380,7 +5353,7 @@ canonicalize_filename (fn) register char *fn; { -#ifdef DOS_NT +#ifdef WIN32_NATIVE for (; *fn != '\0'; fn++) if (*fn == '\\') *fn = '/';