+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
* 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
*/
#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.
#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 */
#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.
*/
#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 */
* 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
struct expr e1;
char id[NCPS];
char opt[NCPS];
- char fn[FILENAME_MAX];
+ char fn[PATH_MAX];
char *p;
int d, n, uaf, uf;
d = getnb();
p = fn;
while ((c = get()) != d) {
- if (p < &fn[FILENAME_MAX-1]) {
+ if (p < &fn[PATH_MAX-1]) {
*p++ = c;
} else {
break;
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
}
while ((c = *p3++) != 0) { // strncpy
- if (p2 < &afn[FILENAME_MAX-1])
+ if (p2 < &afn[PATH_MAX-1])
*p2++ = c;
}
*p2++ = 0;
char* BaseFileName( int fileNumber )
{
static int prevFile = -1;
- static char baseName[ FILENAME_MAX ];
+ static char baseName[ PATH_MAX ];
char *p1, *p2;
{
static int prevFile = -1;
static struct area *pPrevArea = NULL;
- static char baseName[ FILENAME_MAX ];
+ static char baseName[ PATH_MAX ];
int j;
char *p1, *p2;
/*)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
*
* 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
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;
}
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;
}
}
while ((c = *p3++) != 0) {
- if (p2 < &fb[FILENAME_MAX-1])
+ if (p2 < &fb[PATH_MAX-1])
*p2++ = c;
}
*p2++ = 0;
#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;
/* 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
enum
{
- MAX_STRING_LENGTH = FILENAME_MAX,
+ MAX_STRING_LENGTH = PATH_MAX,
MAX_MACRO_NAME_LENGTH = 128
};
#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