aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/autoload.cpp
diff options
context:
space:
mode:
authorGravatar Aaron Gyes <me@aaron.gy>2016-06-05 21:30:24 -0700
committerGravatar Aaron Gyes <me@aaron.gy>2016-06-05 21:32:57 -0700
commit2fafb13eaa30981754a8cd0ba8f3c082e3147fa8 (patch)
tree027e2968792ff62f079f62657e056928d75d065e /src/autoload.cpp
parent90ee810c737d3492f38a45425e46e1d6b7cfa9d3 (diff)
Be a bit more consistent and proper.
Diffstat (limited to 'src/autoload.cpp')
-rw-r--r--src/autoload.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/autoload.cpp b/src/autoload.cpp
index 9a8ebf40..56292fc6 100644
--- a/src/autoload.cpp
+++ b/src/autoload.cpp
@@ -22,7 +22,7 @@
#include "exec.h"
#include "wutil.h" // IWYU pragma: keep
-// The time before we'll recheck an autoloaded file.
+/// The time before we'll recheck an autoloaded file.
static const int kAutoloadStalenessInterval = 15;
file_access_attempt_t access_file(const wcstring &path, int mode) {
@@ -135,8 +135,9 @@ bool autoload_t::has_tried_loading(const wcstring &cmd) {
return func != NULL;
}
+/// @return Whether this function is stale.
+/// Internalized functions can never be stale.
static bool is_stale(const autoload_function_t *func) {
- // Return whether this function is stale. Internalized functions can never be stale.
return !func->is_internalized &&
time(NULL) - func->access.last_checked > kAutoloadStalenessInterval;
}
@@ -159,14 +160,12 @@ autoload_function_t *autoload_t::get_autoloaded_function_with_creation(const wcs
/// This internal helper function does all the real work. By using two functions, the internal
/// function can return on various places in the code, and the caller can take care of various
/// cleanup work.
-///
-/// cmd: the command name ('grep')
-/// really_load: whether to actually parse it as a function, or just check it it exists
-/// reload: whether to reload it if it's already loaded
-/// path_list: the set of paths to check
-///
-/// Result: if really_load is true, returns whether the function was loaded. Otherwise returns
-/// whether the function existed.
+/// @param cmd the command name ('grep')
+/// @param really_load Whether to actually parse it as a function, or just check it it exists
+/// @param reload Whether to reload it if it's already loaded
+/// @param path_list The set of paths to check
+/// @return If really_load is true, returns whether the function was loaded. Otherwise returns
+/// whether the function existed.
bool autoload_t::locate_file_and_maybe_load_it(const wcstring &cmd, bool really_load, bool reload,
const wcstring_list_t &path_list) {
// Note that we are NOT locked in this function!