*/
/**
- * @file src/regex/prof-regex.c
+ * @file src/regex/perf-regex.c
* @brief Test how long it takes to create a automaton from a string regex.
* @author Bartlomiej Polot
*/
}
/**
- * The main function to obtain peer information.
+ * 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.
*
* @param argc number of arguments from the command line
* @param argv command line arguments
char **regexes;
char *buffer;
char *regex;
- unsigned int nr;
- unsigned int i;
int compression;
long size;
GNUNET_asprintf (®ex, "GNVPN-0001-PAD(%s)(0|1)*", buffer);
size = strlen (regex);
- // fprintf (stderr, "Combined regex (%ld bytes):\n%s\n", size, regex);
+ fprintf (stderr, "Combined regex (%ld bytes):\n%s\n", size, regex);
// return 0;
compression = atoi (argv[2]);
dfa = GNUNET_REGEX_construct_dfa (regex, size, compression);
GNUNET_REGEX_automaton_destroy (dfa);
GNUNET_free (buffer);
- for (i=0;NULL != regexes[i];i++)
- GNUNET_free_non_null (regexes[i]);
- GNUNET_free (regexes);
+ GNUNET_REGEX_free_from_file (regexes);
return 0;
}