70 unsigned int char_op_switch;
71 unsigned int last_was_op;
78 if (NULL != matching_str)
79 matching_strp = matching_str;
88 for (i = 0; i < rx_length; i++)
92 if ((0 == char_op_switch) && ! last_was_op)
112 if (i < rx_length - 1)
125 if ((NULL != matching_strp) &&
126 ((current_char !=
'+') && (current_char !=
'*') && (current_char !=
128 (current_char !=
'|') ))
130 *matching_strp = current_char;
134 *rx_p = current_char;
138 if (NULL != matching_strp)
139 *matching_strp =
'\0';
167 for (i = 0; i < len; i++)
uint32_t GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i)
Produce a random value.
@ GNUNET_CRYPTO_QUALITY_WEAK
No good quality of the operation is needed (i.e., random numbers can be pseudo-random).
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define ALLOWED_LITERALS
char array of literals that are allowed inside a regex (apart from the operators)
static char get_random_literal()
Get a (pseudo) random valid literal for building a regular expression.
char * REGEX_TEST_generate_random_regex(size_t rx_length, char *matching_str)
Generate a (pseudo) random regular expression of length 'rx_length', as well as a (optional) string t...
char * REGEX_TEST_generate_random_string(size_t max_len)
Generate a random string of maximum length 'max_len' that only contains literals allowed in a regular...