Lines Matching refs:file

4  * The contents of this file are subject to the terms of the
6 * (the "License"). You may not use this file except in compliance
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
48 #define SRCINC HASHMOD /* source file list size increment */
61 static struct listitem { /* source file table entry */
62 char *file;
68 static BOOL issrcfile(char *file);
137 /* make the source file list */
143 FILE *names; /* name file pointer */
147 char *file;
151 /* if there are source file arguments */
155 file = fileargv[i];
156 if (infilelist(file) == NO) {
157 if (vpaccess(file, READ) == 0) {
158 addsrcfile(file);
161 "cscope: cannot find file %s\n",
162 file);
169 /* see if a file name file exists */
173 /* if there is a file of source file names */
179 /* get the names in the file */
191 case 'I': /* #include file directory */
192 case 'p': /* file path components to */
201 case 'I': /* #include file directory */
210 /* file path components */
215 "in file %s: "
228 "options can be in file %s\n",
235 "cscope: cannot find file %s\n",
264 /* get the source file names in this directory */
269 DIR *dirfile; /* directory file descriptor */
279 /* if it is a source file not already found */
290 /* see if this is a source file */
293 issrcfile(char *file)
298 /* if there is a file suffix */
299 if ((s = strrchr(file, '.')) != NULL && *++s != '\0') {
301 /* if an SCCS or versioned file */
302 if (file[1] == '.' && file + 2 != s) { /* 1 character prefix */
303 switch (*file) {
330 * suffixes so make sure it is a file
332 if (vpstat(file, &statstruct) == 0 &&
342 /* add an include file to the source file list */
345 incfile(char *file, int type)
350 /* see if the file is already in the source file list */
351 if (infilelist(file) == YES) {
354 /* look in current directory if it was #include "file" */
355 if (type == '"' && vpaccess(file, READ) == 0) {
356 addsrcfile(file);
358 /* search for the file in the #include directory list */
361 /* don't include the file from two directories */
362 (void) sprintf(path, "%s/%s", incdirs[i], file);
375 /* see if the file is already in the list */
378 infilelist(char *file)
382 for (p = srcfiletable[hash(compath(file)) % HASHMOD];
384 if (strequal(file, p->file)) {
391 /* add a source file to the list */
399 /* make sure there is room for the file */
404 /* add the file to the list */
406 p->file = stralloc(compath(path));
407 i = hash(p->file) % HASHMOD;
410 srcfiles[nsrcfiles++] = p->file;
413 /* free the memory allocated for the source file list */