Exemplo n.º 1
0
Arquivo: main.c Projeto: koron/ctags
static void makeTags (cookedArgs *args)
{
	clock_t timeStamps [3];
	boolean resize = FALSE;
	boolean files = (boolean)(! cArgOff (args) || Option.fileList != NULL
							  || Option.filter);

	if (! files)
	{
		if (filesRequired ())
			error (FATAL, "No files specified. Try \"%s --help\".",
				getExecutableName ());
		else if (! Option.recurse && ! etagsInclude ())
			return;
	}

#define timeStamp(n) timeStamps[(n)]=(Option.printTotals ? clock():(clock_t)0)
	if ((! Option.filter) && (! Option.printLanguage))
		openTagFile ();

	timeStamp (0);

	if (! cArgOff (args))
	{
		verbose ("Reading command line arguments\n");
		resize = createTagsForArgs (args);
	}
	if (Option.fileList != NULL)
	{
		verbose ("Reading list file\n");
		resize = (boolean) (createTagsFromListFile (Option.fileList) || resize);
	}
	if (Option.filter)
	{
		verbose ("Reading filter input\n");
		resize = (boolean) (createTagsFromFileInput (stdin, TRUE) || resize);
	}
	if (! files  &&  Option.recurse)
		resize = recurseIntoDirectory (".");

	timeStamp (1);

	if ((! Option.filter) && (!Option.printLanguage))
		closeTagFile (resize);

	timeStamp (2);

	if (Option.printTotals)
		printTotals (timeStamps);
#undef timeStamp
}
Exemplo n.º 2
0
Arquivo: main.c Projeto: att/uwin
static boolean createTagsForEntry (const char *const entryName)
{
    boolean resize = FALSE;
    fileStatus *status = eStat (entryName);

    Assert (entryName != NULL);
    if (isExcludedFile (entryName))
	verbose ("excluding \"%s\"\n", entryName);
    else if (status->isSymbolicLink  &&  ! Option.followLinks)
	verbose ("ignoring \"%s\" (symbolic link)\n", entryName);
    else if (! status->exists)
	error (WARNING | PERROR, "cannot open source file \"%s\"", entryName);
    else if (status->isDirectory)
	resize = recurseIntoDirectory (entryName);
    else if (! status->isNormalFile)
	verbose ("ignoring \"%s\" (special file)\n", entryName);
    else
	resize = parseFile (entryName);

    return resize;
}