[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r26973 - gnunet/src/regex
From: |
gnunet |
Subject: |
[GNUnet-SVN] r26973 - gnunet/src/regex |
Date: |
Mon, 22 Apr 2013 17:20:46 +0200 |
Author: bartpolot
Date: 2013-04-22 17:20:46 +0200 (Mon, 22 Apr 2013)
New Revision: 26973
Modified:
gnunet/src/regex/gnunet-daemon-regexprofiler.c
Log:
- add disk scan
Modified: gnunet/src/regex/gnunet-daemon-regexprofiler.c
===================================================================
--- gnunet/src/regex/gnunet-daemon-regexprofiler.c 2013-04-22 14:46:55 UTC
(rev 26972)
+++ gnunet/src/regex/gnunet-daemon-regexprofiler.c 2013-04-22 15:20:46 UTC
(rev 26973)
@@ -267,7 +267,30 @@
return rx_cnt;
}
+/**
+ * Scan through the policy_dir looking for the n-th filename.
+ *
+ * @param cls Closure (target number n).
+ * @param filename complete filename (absolute path).
+ * @return GNUNET_OK to continue to iterate,
+ * GNUNET_NO to stop when found
+ */
+static int
+scan (void *cls, const char *filename)
+{
+ long n = (long) cls;
+ static long c = 0;
+ if (c == n)
+ {
+ policy_filename = GNUNET_strdup (filename);
+ return GNUNET_NO;
+ }
+ c++;
+ return GNUNET_OK;
+}
+
+
/**
* @brief Main function that will be run by the scheduler.
*
@@ -363,6 +386,7 @@
}
/* Read regexes from policy files */
+ GNUNET_assert (-1 != GNUNET_DISK_directory_scan (policy_dir, &scan,
peer_id));
if (0 == load_regexes (policy_filename, ®ex))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r26973 - gnunet/src/regex,
gnunet <=