replace FILENAME_MAX with PATH_MAX
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 12 Oct 2001 19:06:23 +0000 (19:06 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 12 Oct 2001 19:06:23 +0000 (19:06 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1392 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
as/mcs51/asdata.c
as/mcs51/aslink.h
as/mcs51/asm.h
as/mcs51/asmain.c
as/mcs51/asnoice.c
as/mcs51/lklex.c
as/mcs51/lkmain.c
src/SDCCglobl.h
src/SDCCmacro.c
src/SDCCmain.c

index 7fef267823c434a790e215b8ce0cb6a129bc3ebc..c8b25d8cedeb552406cf8fe57e3840ddb2f8f132 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2001-10-11  Bernhard Held  <bernhard@bernhardheld.de>
+
+       * as/mcs51/asdata.c: replaced FILENAME_MAX with PATH_MAX
+
+       * as/mcs51/aslink.h: define PATH_MAX
+
+       * as/mcs51/asm.h: define PATH_MAX
+
+       * as/mcs51/asmain.c: replaced FILENAME_MAX with PATH_MAX
+
+       * as/mcs51/asnoice.c: replaced FILENAME_MAX with PATH_MAX
+
+       * as/mcs51/lklex.c: replaced FILENAME_MAX with PATH_MAX
+
+       * as/mcs51/lkmain.c: replaced FILENAME_MAX with PATH_MAX
+
+       * src/SDCCglobl.h: define PATH_MAX
+
+       * src/SDCCmacro.c: replaced FILENAME_MAX with PATH_MAX
+
+       * src/SDCCmain.c: replaced FILENAME_MAX with PATH_MAX
+
 2001-10-11  Michael Hope  <michaelh@juju.net.nz>
 
        * src/z80/gen.c (gencjneshort): Fixed
index f952d961ed965135eac49ab3399e547da9e6ea2e..07c065ce0f765c89c5b4deed983cb7bd4352a9fa 100644 (file)
@@ -51,13 +51,13 @@ int iflvl[MAXIF+1]; /*      array of IF-ELSE-ENDIF flevel
                         *      values indexed by tlevel
                         */
 
-char   afn[FILENAME_MAX];              /*      afile temporary file name
+char   afn[PATH_MAX];          /*      afile temporary file name
                                 */
-char   srcfn[MAXFIL][FILENAME_MAX];    /*      array of source file names
+char   srcfn[MAXFIL][PATH_MAX];        /*      array of source file names
                                 */
 int    srcline[MAXFIL];        /*      source line number
                                 */
-char   incfn[MAXINC][FILENAME_MAX];    /*      array of include file names
+char   incfn[MAXINC][PATH_MAX];        /*      array of include file names
                                 */
 int    incline[MAXINC];        /*      include line number
                                 */
index 12ef9053dcbf1e1685f9f8d5e90e19f9bdaacf31..0c746ca7d91a36c0d2ea6c5c2df24d034664d103 100644 (file)
 #define        OTHERSYSTEM 
 #endif
 
+/*
+ * PATH_AMX
+ */
+#include <limits.h>
+#ifndef PATH_MAX               /* POSIX, but not required   */
+#define PATH_MAX 255           /* define a reasonable value */
+#endif
+
 /*
  * This file defines the format of the
  * relocatable binary file.
@@ -86,7 +94,7 @@
 
 #define NCPS   80              /* characters per symbol (JLH: change from 8) */
 #define        NDATA   16              /* actual data */
-#define        NINPUT  FILENAME_MAX    /* Input buffer size (BH: change from 128) */
+#define        NINPUT  PATH_MAX        /* Input buffer size */
 #define        NHASH   64              /* Buckets in hash table */
 #define        HMASK   077             /* Hash mask */
 #define        NLPP    60              /* Lines per page */
index 9134686a699d2e6d6794517dbc4231a23cfd0c41..5cfdab99817ad5ee45e89f172d4fde291ba7b247 100644 (file)
 #define        OTHERSYSTEM
 #endif
 
+/*
+ * PATH_MAX
+ */
+#include <limits.h>
+#ifndef PATH_MAX               /* POSIX, but not required   */
+#define PATH_MAX               /* define a reasonable value */
+#endif
+
 /*
  * Assembler definitions.
  */
@@ -85,7 +93,7 @@
 #define NCPS   80              /* Chars. per symbol (JLH: change from 8) */
 #define        HUGE    1000            /* A huge number */
 #define NERR   3               /* Errors per line */
-#define        NINPUT  FILENAME_MAX    /* Input buffer size (BH: change from 128) */
+#define        NINPUT  PATH_MAX        /* Input buffer size (BH: change from 128) */
 #define NCODE  128             /* Listing code buffer size */
 #define NTITL  64              /* Title buffer size */
 #define        NSBTL   64              /* SubTitle buffer size */
@@ -370,16 +378,16 @@ extern    int     iflvl[MAXIF+1]; /*      array of IF-ELSE-ENDIF flevel
                                 *      values indexed by tlevel
                                 */
 extern char
-       afn[FILENAME_MAX];              /*      afile() temporary filespec
+       afn[PATH_MAX];          /*      afile() temporary filespec
                                 */
 extern char
-       srcfn[MAXFIL][FILENAME_MAX];    /*      array of source file names
+       srcfn[MAXFIL][PATH_MAX];        /*      array of source file names
                                 */
 extern int
        srcline[MAXFIL];        /*      current source file line
                                 */
 extern char
-       incfn[MAXINC][FILENAME_MAX];    /*      array of include file names
+       incfn[MAXINC][PATH_MAX];        /*      array of include file names
                                 */
 extern int
        incline[MAXINC];        /*      current include file line
index 9947ae3faa547f104ebad0d7ffbf88c000137b07..bb2194286945ad9c698ff7308eb90a69b5c6225b 100644 (file)
@@ -479,7 +479,7 @@ asmbl()
        struct expr e1;
        char id[NCPS];
        char opt[NCPS];
-       char fn[FILENAME_MAX];
+       char fn[PATH_MAX];
        char *p;
        int d, n, uaf, uf;
 
@@ -911,7 +911,7 @@ loop:
                d = getnb();
                p = fn;
                while ((c = get()) != d) {
-                       if (p < &fn[FILENAME_MAX-1]) {
+                       if (p < &fn[PATH_MAX-1]) {
                                *p++ = c;
                        } else {
                                break;
@@ -1053,8 +1053,8 @@ int wf;
        p2 = strrchr (afn, FSEPX);              // search last '.'
        if (!p2)
                p2 = afn + strlen (afn);
-       if (p2 > &afn[FILENAME_MAX-4])          // truncate filename, if it's too long
-               p2 = &afn[FILENAME_MAX-4];
+       if (p2 > &afn[PATH_MAX-4])              // truncate filename, if it's too long
+               p2 = &afn[PATH_MAX-4];
        *p2++ = FSEPX;
 
        // choose a file-extension
@@ -1067,7 +1067,7 @@ int wf;
        }
 
        while ((c = *p3++) != 0) {              // strncpy
-               if (p2 < &afn[FILENAME_MAX-1])
+               if (p2 < &afn[PATH_MAX-1])
                        *p2++ = c;
        }
        *p2++ = 0;
index a61449694b01aa9ddc5751d9ed49936857e350a3..38d3233f5b95c14969c9cd8f1dae34432d2d47db 100644 (file)
@@ -17,7 +17,7 @@ static char* BaseFileName( int fileNumber );
 char* BaseFileName( int fileNumber )
 {
        static int prevFile = -1;
-        static char baseName[ FILENAME_MAX ];
+        static char baseName[ PATH_MAX ];
 
         char *p1, *p2;
 
@@ -85,7 +85,7 @@ void DefineNoICE_Line()
 {
         static int prevFile = -1;
         static struct area *pPrevArea = NULL;
-        static char baseName[ FILENAME_MAX ];
+        static char baseName[ PATH_MAX ];
 
         int j;
         char *p1, *p2;
index 5c51c5939995673d04787c579cd1c75dafbf0df4..4f6c45759ece25aef59b08760b5e27c20d8784e5 100644 (file)
@@ -156,7 +156,7 @@ char *id;
 /*)Function    VOID    getfid(fid,c)
  *
  *             char *  str             a pointer to a string of
- *                                     maximum length FILENAME_MAX
+ *                                     maximum length PATH_MAX
  *             int     c               this is first character to
  *                                     copy to the string buffer
  *
@@ -164,9 +164,9 @@ char *id;
  *     from the current position copying the next string
  *     into the external string buffer (str).  The string ends when a
  *     non SPACE type character is found. The maximum number of
- *     characters copied is FILENAME_MAX. If the input string is larger than
- *     FILENAME_MAX characters then the string is truncated, if the input string
- *     is shorter than FILENAME_MAX characters then the string is NULL filled.
+ *     characters copied is PATH_MAX. If the input string is larger than
+ *     PATH_MAX characters then the string is truncated, if the input string
+ *     is shorter than PATH_MAX characters then the string is NULL filled.
  *
  *     local variables:
  *             char *  p               pointer to external string buffer
@@ -195,11 +195,11 @@ char *str;
 
        p = str;
        do {
-               if (p < &str[FILENAME_MAX-1])
+               if (p < &str[PATH_MAX-1])
                        *p++ = c;
                c = get();
        } while (c && ((ctype[c] != SPACE)||(c == ':')||(c == '\\')));
-       while (p < &str[FILENAME_MAX])
+       while (p < &str[PATH_MAX])
                *p++ = 0;
 }
 
index 17277c2fcee548eae31eaa76ccdcc79b64524868..58abc7212be9af10fd674772643f88a8d3bf19ec 100644 (file)
@@ -1045,14 +1045,14 @@ char *ft;
        register char *p1, *p2, *p3;
        register int c;
        FILE *fp;
-       char fb[FILENAME_MAX];
+       char fb[PATH_MAX];
        char *omode = (wf ? (wf == 2 ? "a" : "w") : "r");
 
        p1 = fn;
        p2 = fb;
        p3 = ft;
        while ((c = *p1++) != 0 && c != FSEPX) {
-               if (p2 < &fb[FILENAME_MAX-4])
+               if (p2 < &fb[PATH_MAX-4])
                        *p2++ = c;
        }
        *p2++ = FSEPX;
@@ -1064,7 +1064,7 @@ char *ft;
                }
        }
        while ((c = *p3++) != 0) {
-               if (p2 < &fb[FILENAME_MAX-1])
+               if (p2 < &fb[PATH_MAX-1])
                        *p2++ = c;
        }
        *p2++ = 0;      
index 07eec1dd9cccd15c003fb31daa1721d216c73c9a..3df24562d11f28a698b5d10da1d19ff45401c298 100644 (file)
 #define SPACE ' '
 #define ZERO  0
 
+#include <limits.h>            /* PATH_MAX                  */
+#ifndef PATH_MAX               /* POSIX, but not required   */
+#define PATH_MAX 255           /* define a reasonable value */
+#endif
+
 #define  MAX_FNAME_LEN  128
 #define  MAX_REG_PARMS  1
 typedef int bool;
@@ -316,6 +321,6 @@ extern struct _dumpFiles dumpFiles[];
 /* Buffer which can be used to hold a file name; assume it will
  * be trashed by any function call within SDCC.
  */
-extern char scratchFileName[FILENAME_MAX];
+extern char scratchFileName[PATH_MAX];
 
 #endif
index 8487178dbfe5a010c11522b66f28ece64545e60f..eb2b49c107229aa515cd3b35daccb2bc779f5855 100644 (file)
@@ -26,7 +26,7 @@
 
 enum 
   {
-    MAX_STRING_LENGTH  = FILENAME_MAX,
+    MAX_STRING_LENGTH  = PATH_MAX,
     MAX_MACRO_NAME_LENGTH = 128
   };
 
index e7f5eea422791665b69493d3cbf3819d6e0a79d2..9ea904fa3f5f1d9c98651aeb7846b4b5d53bc2da 100644 (file)
@@ -79,8 +79,8 @@ int ds390_jammed = 0;
 #endif
 
 // Globally accessible scratch buffer for file names.
-char scratchFileName[FILENAME_MAX];
-char buffer[FILENAME_MAX];
+char scratchFileName[PATH_MAX];
+char buffer[PATH_MAX];
 
 // In MSC VC6 default search path for exe's to path for this