diff --git a/src/fuse_local.c b/src/fuse_local.c index d368a79..58c83fd 100644 --- a/src/fuse_local.c +++ b/src/fuse_local.c @@ -143,9 +143,12 @@ fs_readdir(const char *path, void *buf, fuse_fill_dir_t dir_add, (void) fi; LinkTable *linktbl; +#ifdef DEBUG static int j = 0; lprintf(debug, "\n!!!!Calling fs_readdir for the %d time!!!!\n", j) j++; +#endif + linktbl = path_to_Link_LinkTable_new(path); if (!linktbl) { return -ENOENT; diff --git a/src/link.c b/src/link.c index ade8b56..fb5a323 100644 --- a/src/link.c +++ b/src/link.c @@ -644,9 +644,12 @@ LinkTable *LinkTable_new(const char *url) curl_free(unescaped_path); curl_easy_cleanup(c); +#ifdef DEBUG static int i = 0; lprintf(debug, "\n!!!!Calling LinkTable_new for the %d time!!!!\n", i) i++; +#endif + LinkTable_print(linktbl); return linktbl; diff --git a/src/log.h b/src/log.h index 9dde80e..ef06e99 100644 --- a/src/log.h +++ b/src/log.h @@ -1,6 +1,7 @@ #ifndef LOG_H #define LOG_H +#define DEBUG 0 /** * \brief Log types */ @@ -9,7 +10,7 @@ typedef enum { error = 1 << 1, warning = 1 << 2, info = 1 << 3, - debug = 1 << 4, + debug = DEBUG << 4, link_lock_debug = 1 << 5, network_lock_debug = 1 << 6, cache_lock_debug = 1 << 7, @@ -40,9 +41,10 @@ void log_printf(LogType type, const char *file, const char *func, int line, */ #define lprintf(type, ...) \ log_printf(type, __FILE__, __func__, __LINE__, __VA_ARGS__); -#endif /** * \brief Print the version information for HTTPDirFS */ void print_version(); + +#endif \ No newline at end of file