aboutsummaryrefslogtreecommitdiff
path: root/src/regex/perf-regex.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-06-20 08:32:50 +0000
committerChristian Grothoff <christian@grothoff.org>2013-06-20 08:32:50 +0000
commit21a2b4f95b4488645ba5a6254fcb8919c4915f73 (patch)
tree00c92cb7103cc14fba7e63e8dee99fe711856863 /src/regex/perf-regex.c
parent5533b105943b4f6dd688c1758350cd83ebeab3b9 (diff)
downloadgnunet-21a2b4f95b4488645ba5a6254fcb8919c4915f73.tar.gz
gnunet-21a2b4f95b4488645ba5a6254fcb8919c4915f73.zip
continuing refactoring of regex library structure, disambiguating symbol names between old regex library which is now internal and the public API; moving IP-to-regex conversion functions to tun library, as only vpn is using those to begin with
Diffstat (limited to 'src/regex/perf-regex.c')
-rw-r--r--src/regex/perf-regex.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/regex/perf-regex.c b/src/regex/perf-regex.c
index 8fce34f37..210b16b81 100644
--- a/src/regex/perf-regex.c
+++ b/src/regex/perf-regex.c
@@ -26,7 +26,7 @@
26#include <regex.h> 26#include <regex.h>
27#include <time.h> 27#include <time.h>
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_regex_lib.h" 29#include "regex_internal_lib.h"
30#include "regex_test_lib.h" 30#include "regex_test_lib.h"
31 31
32static const char *exe; 32static const char *exe;
@@ -53,7 +53,7 @@ iter (void *cls,
53 const char *proof, 53 const char *proof,
54 int accepting, 54 int accepting,
55 unsigned int num_edges, 55 unsigned int num_edges,
56 const struct GNUNET_REGEX_Edge *edges) 56 const struct REGEX_ITERNAL_Edge *edges)
57{ 57{
58 unsigned int i; 58 unsigned int i;
59 59
@@ -66,9 +66,9 @@ iter (void *cls,
66} 66}
67 67
68static void 68static void
69print_dfa (struct GNUNET_REGEX_Automaton* dfa) 69print_dfa (struct REGEX_ITERNAL_Automaton* dfa)
70{ 70{
71 GNUNET_REGEX_iterate_all_edges (dfa, iter, NULL); 71 REGEX_ITERNAL_iterate_all_edges (dfa, iter, NULL);
72} 72}
73 73
74/** 74/**
@@ -84,7 +84,7 @@ print_dfa (struct GNUNET_REGEX_Automaton* dfa)
84int 84int
85main (int argc, char *const *argv) 85main (int argc, char *const *argv)
86{ 86{
87 struct GNUNET_REGEX_Automaton* dfa; 87 struct REGEX_ITERNAL_Automaton* dfa;
88 char **regexes; 88 char **regexes;
89 char *buffer; 89 char *buffer;
90 char *regex; 90 char *regex;
@@ -98,14 +98,14 @@ main (int argc, char *const *argv)
98 usage(); 98 usage();
99 return 1; 99 return 1;
100 } 100 }
101 regexes = GNUNET_REGEX_read_from_file (argv[1]); 101 regexes = REGEX_ITERNAL_read_from_file (argv[1]);
102 102
103 if (NULL == regexes) 103 if (NULL == regexes)
104 { 104 {
105 usage(); 105 usage();
106 return 2; 106 return 2;
107 } 107 }
108 buffer = GNUNET_REGEX_combine (regexes); 108 buffer = REGEX_ITERNAL_combine (regexes);
109 109
110 GNUNET_asprintf (&regex, "GNVPN-0001-PAD(%s)(0|1)*", buffer); 110 GNUNET_asprintf (&regex, "GNVPN-0001-PAD(%s)(0|1)*", buffer);
111 size = strlen (regex); 111 size = strlen (regex);
@@ -114,11 +114,11 @@ main (int argc, char *const *argv)
114 // return 0; 114 // return 0;
115 115
116 compression = atoi (argv[2]); 116 compression = atoi (argv[2]);
117 dfa = GNUNET_REGEX_construct_dfa (regex, size, compression); 117 dfa = REGEX_ITERNAL_construct_dfa (regex, size, compression);
118 print_dfa (dfa); 118 print_dfa (dfa);
119 GNUNET_REGEX_automaton_destroy (dfa); 119 REGEX_ITERNAL_automaton_destroy (dfa);
120 GNUNET_free (buffer); 120 GNUNET_free (buffer);
121 GNUNET_REGEX_free_from_file (regexes); 121 REGEX_ITERNAL_free_from_file (regexes);
122 GNUNET_free (regex); 122 GNUNET_free (regex);
123 return 0; 123 return 0;
124} 124}