aboutsummaryrefslogtreecommitdiff
path: root/src/regex/perf-regex.c
diff options
context:
space:
mode:
authorBart Polot <bart.polot+voyager@gmail.com>2017-05-10 20:58:28 +0200
committerBart Polot <bart.polot+voyager@gmail.com>2017-05-10 20:58:28 +0200
commit5031ce9079f9e5292468374fa8d4a95462e7168a (patch)
tree70812f66790a1775384ccd6006ac1a88fdd73a62 /src/regex/perf-regex.c
parent1c2ab4aa3b9b563ad2098984b5751e67d3267778 (diff)
downloadgnunet-5031ce9079f9e5292468374fa8d4a95462e7168a.tar.gz
gnunet-5031ce9079f9e5292468374fa8d4a95462e7168a.zip
Change regex combination, allow hex
Diffstat (limited to 'src/regex/perf-regex.c')
-rw-r--r--src/regex/perf-regex.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/regex/perf-regex.c b/src/regex/perf-regex.c
index c7a5e6c5f..ec42d2625 100644
--- a/src/regex/perf-regex.c
+++ b/src/regex/perf-regex.c
@@ -80,13 +80,14 @@ main (int argc, char *const *argv)
80 char *buffer; 80 char *buffer;
81 char *regex; 81 char *regex;
82 int compression; 82 int compression;
83 unsigned int alphabet_size;
83 long size; 84 long size;
84 85
85 GNUNET_log_setup ("perf-regex", "DEBUG", NULL); 86 GNUNET_log_setup ("perf-regex", "DEBUG", NULL);
86 if (3 != argc) 87 if (4 != argc)
87 { 88 {
88 fprintf (stderr, 89 fprintf (stderr,
89 "Usage: %s REGEX_FILE COMPRESSION\n", 90 "Usage: %s REGEX_FILE ALPHABET_SIZE COMPRESSION\n",
90 argv[0]); 91 argv[0]);
91 return 1; 92 return 1;
92 } 93 }
@@ -98,9 +99,13 @@ main (int argc, char *const *argv)
98 argv[1]); 99 argv[1]);
99 return 2; 100 return 2;
100 } 101 }
101 compression = atoi (argv[2]); 102 alphabet_size = atoi (argv[2]);
102 103 compression = atoi (argv[3]);
103 buffer = REGEX_TEST_combine (regexes); 104 printf ("********* PERF-REGEX *********'\n");
105 printf ("Using:\n file '%s'\n Alphabet size %u\n compression %d\n",
106 argv[1], alphabet_size, compression);
107 fflush(stdout);
108 buffer = REGEX_TEST_combine (regexes, alphabet_size);
104 GNUNET_asprintf (&regex, "GNUNET_REGEX_PROFILER_(%s)(0|1)*", buffer); 109 GNUNET_asprintf (&regex, "GNUNET_REGEX_PROFILER_(%s)(0|1)*", buffer);
105 size = strlen (regex); 110 size = strlen (regex);
106 111