2 * This file is part of GNUnet
3 * (C) 2012 Christian Grothoff (and other contributing authors)
5 * GNUnet is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published
7 * by the Free Software Foundation; either version 3, or (at your
8 * option) any later version.
10 * GNUnet is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GNUnet; see the file COPYING. If not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 * @file src/regex/regex_test_lib.h
22 * @brief library to read regexes representing IP networks from a file.
23 * and simplyfinying the into one big regex, in order to run
24 * tests (regex performance, mesh profiler).
25 * @author Bertlomiej Polot
29 #ifndef GNUNET_REGEX_TEST_LIB_H
30 #define GNUNET_REGEX_TEST_LIB_H
36 #if 0 /* keep Emacsens' auto-indent happy */
42 * Combine an array of regexes into a single prefix-shared regex.
44 * @param regexes A NULL-terminated array of regexes.
46 * @retrun A string with a single regex that matches any of the original regexes
49 GNUNET_REGEX_combine(char * const regexes[]);
52 * Read a set of regexes from a file, one per line and return them in an array
53 * suitable for GNUNET_REGEX_combine.
54 * The array must be free'd using GNUNET_REGEX_free_from_file.
56 * @param filename Name of the file containing the regexes.
58 * @return A newly allocated, NULL terminated array of regexes.
61 GNUNET_REGEX_read_from_file (const char *filename);
65 * Free all memory reserved for a set of regexes created by read_from_file.
67 * @param regexes NULL-terminated array of regexes.
70 GNUNET_REGEX_free_from_file (char **regexes);
72 #if 0 /* keep Emacsens' auto-indent happy */
79 /* end of gnunet_regex_lib.h */