예제 #1
0
파일: main.c 프로젝트: koron/ctags
static boolean recurseUsingOpendir (const char *const dirName)
{
	boolean resize = FALSE;
	DIR *const dir = opendir (dirName);
	if (dir == NULL)
		error (WARNING | PERROR, "cannot recurse into directory \"%s\"", dirName);
	else
	{
		struct dirent *entry;
		while ((entry = readdir (dir)) != NULL)
		{
			if (strcmp (entry->d_name, ".") != 0  &&
				strcmp (entry->d_name, "..") != 0)
			{
				char *filePath;
				boolean free_p = FALSE;
				if (strcmp (dirName, ".") == 0)
					filePath = entry->d_name;
				else
				  {
					filePath = combinePathAndFile (dirName, entry->d_name);
					free_p = TRUE;
				  }
				resize |= createTagsForEntry (filePath);
				if (free_p)
					eFree (filePath);
			}
		}
		closedir (dir);
	}
	return resize;
}
예제 #2
0
파일: main.c 프로젝트: att/uwin
static boolean recurseUsingOpendir (const char *const dirName)
{
    boolean resize = FALSE;
    DIR *const dir = opendir (dirName);
    if (dir == NULL)
	error (WARNING | PERROR, "cannot recurse into directory \"%s\"", dirName);
    else
    {
	struct dirent *entry;
	while ((entry = readdir (dir)) != NULL)
	{
	    if (strcmp (entry->d_name, ".") != 0  &&
		strcmp (entry->d_name, "..") != 0)
	    {
		vString *filePath;
		if (strcmp (dirName, ".") == 0)
		    filePath = vStringNewInit (entry->d_name);
		else
		    filePath = combinePathAndFile (dirName, entry->d_name);
		resize |= createTagsForEntry (vStringValue (filePath));
		vStringDelete (filePath);
	    }
	}
	closedir (dir);
    }
    return resize;
}
예제 #3
0
파일: read.c 프로젝트: ajitvin/v
static boolean setSourceFileName (vString *const fileName)
{
	boolean result = FALSE;
	if (getFileLanguage (vStringValue (fileName)) != LANG_IGNORE)
	{
		vString *pathName;
		if (isAbsolutePath (vStringValue (fileName)) || File.path == NULL)
			pathName = vStringNewCopy (fileName);
		else
			pathName = combinePathAndFile (
					vStringValue (File.path), vStringValue (fileName));
		setSourceFileParameters (pathName);
		result = TRUE;
	}
	return result;
}
예제 #4
0
파일: read.c 프로젝트: pragmaware/ctags
static bool setSourceFileName (vString *const fileName)
{
	const langType language = getLanguageForFilenameAndContents (vStringValue (fileName));
	bool result = false;
	if (language != LANG_IGNORE)
	{
		vString *pathName;
		if (isAbsolutePath (vStringValue (fileName)) || File.path == NULL)
			pathName = vStringNewCopy (fileName);
		else
		{
			char *tmp = combinePathAndFile (
				vStringValue (File.path), vStringValue (fileName));
			pathName = vStringNewOwn (tmp);
		}
		setSourceFileParameters (pathName, language);
		result = true;
	}
	return result;
}
예제 #5
0
파일: read.c 프로젝트: acarlson1029/ctags
static boolean setSourceFileName (vString *const fileName)
{
	const langType language = getFileLanguage (vStringValue (fileName));
	boolean result = FALSE;
	if (language != LANG_IGNORE)
	{
		vString *pathName;
		if (isAbsolutePath (vStringValue (fileName)) || File.path == NULL)
			pathName = vStringNewCopy (fileName);
		else
		{
			char *tmp = combinePathAndFile (
				vStringValue (File.path), vStringValue (fileName));
			pathName = vStringNewOwn (tmp);
		}
		setSourceFileParameters (pathName, language);
		result = TRUE;
	}
	return result;
}