ddwaf_builder_add_or_update_config

Function ddwaf_builder_add_or_update_config 

Source
pub unsafe extern "C" fn ddwaf_builder_add_or_update_config(
    builder: ddwaf_builder,
    path: *const c_char,
    path_len: u32,
    config: *const ddwaf_object,
    diagnostics: *mut ddwaf_object,
) -> bool
Expand description

ddwaf_builder_add_or_update_config

Adds or updates a configuration based on the given path, which must be a unique identifier for the provided configuration.

@param builder Builder to perform the operation on. (nonnull) @param path A string containing the path of the configuration, this must uniquely identify the configuration. (nonnull) @param path_len The length of the string contained within path. @param config ddwaf::object map containing rules, exclusions, rules_override and rules_data. (nonnull) @param diagnostics Optional ruleset parsing diagnostics. (nullable)

@return Whether the operation succeeded (true) or failed (false).

@note if any of the arguments are NULL, the diagnostics object will not be initialised. @note The memory associated with the path, config and diagnostics must be freed by the caller. @note This function is not thread-safe.