Documentation to core librdg usage.
More...
|
const char * | rdg_get_version (void) |
| Gets the library version string. More...
|
|
struct rdg * | rdg_new (const char *expression) |
| Creates a new data generator based off the provided expression. More...
|
|
int | rdg_generate (const unsigned char **result, size_t *size, struct rdg *rdg) |
| Generates the next result from the data generator. More...
|
|
size_t | rdg_permutations (const struct rdg *rdg) |
| Calculates the number of permutations. More...
|
|
void | rdg_free (struct rdg *rdg) |
| Frees the data generator object. More...
|
|
Documentation to core librdg usage.
◆ rdg_free()
void rdg_free |
( |
struct rdg * |
rdg | ) |
|
Frees the data generator object.
- Parameters
-
[in] | rdg | The data generator |
◆ rdg_generate()
int rdg_generate |
( |
const unsigned char ** |
result, |
|
|
size_t * |
size, |
|
|
struct rdg * |
rdg |
|
) |
| |
Generates the next result from the data generator.
- Warning
- This is not thread-safe.
- Parameters
-
[out] | result | Generated data |
[out] | size | Size of generated data |
[in] | rdg | A data generator |
- Returns
- Whether a value was generated
◆ rdg_get_version()
const char* rdg_get_version |
( |
void |
| ) |
|
Gets the library version string.
- Returns
- A pointer to the static version string
◆ rdg_new()
struct rdg* rdg_new |
( |
const char * |
expression | ) |
|
Creates a new data generator based off the provided expression.
Creates the rdg object that stores the state of the generated regular expression. It is the application's responsibility to free with rdg_free();
- Parameters
-
[in] | expression | A regular expression (within the defined subset) |
- Returns
- A data generator
◆ rdg_permutations()
size_t rdg_permutations |
( |
const struct rdg * |
rdg | ) |
|
Calculates the number of permutations.
- Parameters
-
- Returns
- The number of permutations the data generator can create.