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; }
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; }
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; }
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; }
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; }