30 #pragma warning(disable : 4996)
53 int isdot(
register char *p);
55 int issymbolic(
register char *dir,
register char *component);
61 static char path[ BUFSIZ ];
62 register char **pp, *p;
68 const size_t inclen = strlen(include);
70 register char *cpp_point = include + inclen - 4;
71 if (!strcasecmp(
".cpp", cpp_point)) {
95 if (!found && (dot || *include ==
'/' || *include ==
'\\')) {
96 if (
stat(include, &st) == 0) {
109 for (p=file+strlen(file); p>file; p--)
110 if (*p ==
'/' || *p ==
'\\')
113 strcpy(
path, include);
115 strncpy(
path, file, (p-file) + 1);
116 path[ (p-file) + 1 ] =
'\0';
117 strcpy(
path + (p-file) + 1, include);
134 sprintf(
path,
"%s/%s", *pp, include);
138 bool exclude_it =
false;
141 if (!strncmp(*pp, *pp2, strlen(*pp2))) {
173 register char *end, *from, *to, **cp;
174 char *components[
MAXFILES ], newpath[ BUFSIZ ];
175 bool component_copied;
185 for (from=end=
path; *end; end++)
186 if (*end ==
'/' || *end ==
'\\') {
187 while (*end ==
'/' || *end ==
'\\')
210 if (cp != components)
220 component_copied =
false;
222 if (component_copied)
224 component_copied =
true;
225 for (from = *cp; *from; )
235 strcpy(
path, newpath);
240 if(p && *p++ ==
'.' && *p++ ==
'\0')
247 if(p && *p++ ==
'.' && *p++ ==
'.' && *p++ ==
'\0')
256 char buf[ BUFSIZ ], **pp;
258 sprintf(buf,
"%s%s%s", dir, *dir ?
"/" :
"", component);
260 if (strcmp(*pp, buf) == 0)
262 if (lstat(buf, &st) == 0
263 && (st.st_mode &
S_IFMT) == S_IFLNK) {
266 fatalerr(
"out of .. dirs, increase MAXDIRS\n");
285 fatalerr(
"out of space: increase MAXFILES\n");
288 if (incstring == NULL)
313 if (ip->
i_list[ i ] == newfile) {
314 i = int(strlen(newfile->
i_file));
317 newfile->
i_file[i-1] ==
'c' &&
318 newfile->
i_file[i-2] ==
'.'))
325 warning(
"%s includes %s more than once!\n",
char * copy(register char *str)
int isdot(register char *p)
int issymbolic(register char *dir, register char *component)
inclist * inc_path(register char *file, register char *include, bool dot, bool &failure_okay)
inclist * newinclude(register char *newfile, register char *incstring)
void remove_dotdot(char *path)
inclist inc_list[MAXFILES]
int isdotdot(register char *p)
void included_by(register inclist *ip, register inclist *newfile)
void warning1(const char *msg, x1, x2, x3, x4, x5, x6, x7, x8, x9)
void fatalerr(char *msg, x1, x2, x3, x4, x5, x6, x7, x8, x9)
void warning(const char *msg, x1, x2, x3, x4, x5, x6, x7, x8, x9)