rdg  1.1.0
Functions
librdg

Documentation to core librdg usage. More...

Functions

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...
 

Detailed Description

Documentation to core librdg usage.

Function Documentation

◆ rdg_free()

void rdg_free ( struct rdg *  rdg)

Frees the data generator object.

Parameters
[in]rdgThe 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]resultGenerated data
[out]sizeSize of generated data
[in]rdgA 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]expressionA 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
[in]rdgA data generator
Returns
The number of permutations the data generator can create.