projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixing parallel build, getting rid of useless _DEPENDENCIES declarations
[oweals/gnunet.git]
/
src
/
regex
/
perf-regex.c
diff --git
a/src/regex/perf-regex.c
b/src/regex/perf-regex.c
index c2ec7441ee103988b14f607dbc3e1c97a8694773..3f1e771154dcbc1defbcff28e7b7cca95cd44e7e 100644
(file)
--- a/
src/regex/perf-regex.c
+++ b/
src/regex/perf-regex.c
@@
-41,7
+41,7
@@
* @param num_edges number of edges leaving current state.
* @param edges edges leaving current state.
*/
* @param num_edges number of edges leaving current state.
* @param edges edges leaving current state.
*/
-static void
+static void
print_edge (void *cls,
const struct GNUNET_HashCode *key,
const char *proof,
print_edge (void *cls,
const struct GNUNET_HashCode *key,
const char *proof,
@@
-64,7
+64,7
@@
print_edge (void *cls,
/**
* The main function of the regex performace test.
/**
* The main function of the regex performace test.
- *
+ *
* Read a set of regex from a file, combine them and create a DFA from the
* resulting combined regex.
*
* Read a set of regex from a file, combine them and create a DFA from the
* resulting combined regex.
*
@@
-86,7
+86,7
@@
main (int argc, char *const *argv)
if (3 != argc)
{
fprintf (stderr,
if (3 != argc)
{
fprintf (stderr,
- "Usage: %s REGEX_FILE COMPRESSION\n",
+ "Usage: %s REGEX_FILE COMPRESSION\n",
argv[0]);
return 1;
}
argv[0]);
return 1;
}
@@
-101,15
+101,18
@@
main (int argc, char *const *argv)
compression = atoi (argv[2]);
buffer = REGEX_TEST_combine (regexes);
compression = atoi (argv[2]);
buffer = REGEX_TEST_combine (regexes);
- GNUNET_asprintf (®ex, "GN
VPN-0001-PAD
(%s)(0|1)*", buffer);
+ GNUNET_asprintf (®ex, "GN
UNET_REGEX_PROFILER_
(%s)(0|1)*", buffer);
size = strlen (regex);
size = strlen (regex);
- fprintf (stderr,
- "Combined regex (%ld bytes):\n%s\n",
- size,
+ fprintf (stderr,
+ "Combined regex (%ld bytes):\n%s\n",
+ size,
regex);
dfa = REGEX_INTERNAL_construct_dfa (regex, size, compression);
regex);
dfa = REGEX_INTERNAL_construct_dfa (regex, size, compression);
+ printf ("********* ALL EDGES *********'\n");
REGEX_INTERNAL_iterate_all_edges (dfa, &print_edge, NULL);
REGEX_INTERNAL_iterate_all_edges (dfa, &print_edge, NULL);
+ printf ("\n\n********* REACHABLE EDGES *********'\n");
+ REGEX_INTERNAL_iterate_reachable_edges (dfa, &print_edge, NULL);
REGEX_INTERNAL_automaton_destroy (dfa);
GNUNET_free (buffer);
REGEX_TEST_free_from_file (regexes);
REGEX_INTERNAL_automaton_destroy (dfa);
GNUNET_free (buffer);
REGEX_TEST_free_from_file (regexes);