pub unsafe extern "C" fn hs_compile_ext_multi(
    expressions: *const *const c_char,
    flags: *const c_uint,
    ids: *const c_uint,
    ext: *const *const hs_expr_ext_t,
    elements: c_uint,
    mode: c_uint,
    platform: *const hs_platform_info_t,
    db: *mut *mut hs_database_t,
    error: *mut *mut hs_compile_error_t
) -> hs_error_t
Expand description

The multiple regular expression compiler with extended parameter support.

This function call compiles a group of expressions into a database in the same way as @ref hs_compile_multi(), but allows additional parameters to be specified via an @ref hs_expr_ext_t structure per expression.

@param expressions Array of NULL-terminated expressions to compile. Note that (as for @ref hs_compile()) these strings must contain only the pattern to be matched, with no delimiters or flags. For example, the expression /abc?def/i should be compiled by providing abc?def as the first string in the @p expressions array, and @ref HS_FLAG_CASELESS as the first value in the @p flags array.

@param flags Array of flags which modify the behaviour of each expression. Multiple flags may be used by ORing them together. Specifying the NULL pointer in place of an array will set the flags value for all patterns to zero. Valid values are: - HS_FLAG_CASELESS - Matching will be performed case-insensitively. - HS_FLAG_DOTALL - Matching a . will not exclude newlines. - HS_FLAG_MULTILINE - ^ and $ anchors match any newlines in data. - HS_FLAG_SINGLEMATCH - Only one match will be generated by patterns with this match id per stream. - HS_FLAG_ALLOWEMPTY - Allow expressions which can match against an empty string, such as .*. - HS_FLAG_UTF8 - Treat this pattern as a sequence of UTF-8 characters. - HS_FLAG_UCP - Use Unicode properties for character classes. - HS_FLAG_PREFILTER - Compile pattern in prefiltering mode. - HS_FLAG_SOM_LEFTMOST - Report the leftmost start of match offset when a match is found. - HS_FLAG_COMBINATION - Parse the expression in logical combination syntax. - HS_FLAG_QUIET - Ignore match reporting for this expression. Used for the sub-expressions in logical combinations.

@param ids An array of integers specifying the ID number to be associated with the corresponding pattern in the expressions array. Specifying the NULL pointer in place of an array will set the ID value for all patterns to zero.

@param ext An array of pointers to filled @ref hs_expr_ext_t structures that define extended behaviour for each pattern. NULL may be specified if no extended behaviour is needed for an individual pattern, or in place of the whole array if it is not needed for any expressions. Memory used by these structures must be both allocated and freed by the caller.

@param elements The number of elements in the input arrays.

@param mode Compiler mode flags that affect the database as a whole. One of @ref HS_MODE_STREAM, @ref HS_MODE_BLOCK or @ref HS_MODE_VECTORED must be supplied, to select between the generation of a streaming, block or vectored database. In addition, other flags (beginning with HS_MODE_) may be supplied to enable specific features. See @ref HS_MODE_FLAG for more details.

@param platform If not NULL, the platform structure is used to determine the target platform for the database. If NULL, a database suitable for running on the current host platform is produced.

@param db On success, a pointer to the generated database will be returned in this parameter, or NULL on failure. The caller is responsible for deallocating the buffer using the @ref hs_free_database() function.

@param error If the compile fails, a pointer to a @ref hs_compile_error_t will be returned, providing details of the error condition. The caller is responsible for deallocating the buffer using the @ref hs_free_compile_error() function.

@return @ref HS_SUCCESS is returned on successful compilation; @ref HS_COMPILER_ERROR on failure, with details provided in the @p error parameter.