---
name: "rulexdb_load_ruleset"
section: "3"
platform: "linux"
package: "librulexdb-dev"
version: "3.8.6-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rulexdb_load_ruleset"
---

# rulexdb\_load\_ruleset(3)

load specified ruleset from a rulex database

## NAME

rulexdb\_load\_ruleset - load specified ruleset from a rulex database

## SYNOPSIS

```
#include <rulexdb.h>

int rulexdb_load_ruleset(RULEXDB *rulexdb, int rule_type);
```

## DESCRIPTION

The **rulexdb\_load\_ruleset**() function preloads all data for the ruleset specified by *rule\_type* argument that may accept one of the following values:

- **RULEXDB\_LEXCLASS**

  Load the **Classifiers** ruleset.

- **RULEXDB\_PREFIX**

  Load the **Prefix detectors** ruleset.

- **RULEXDB\_RULE**

  Load the **General** ruleset.

- **RULEXDB\_CORRECTOR**

  Load the **Correctors** ruleset.

The argument *rulexdb* references the database to deal with.

Loaded ruleset cannot be modified.

## RETURN VALUE

The **rulexdb\_load\_ruleset**() function returns number of loaded records or negative error code.

## ERRORS

- **RULEXDB\_FAILURE**

  Referenced database has not been opened, internal data structures are corrupted or some other general failure has occurred.

- **RULEXDB\_EPARM**

  Invalid arguments are specified.

- **RULEXDB\_EACCESS**

  The database cannot be initialized for loading.

## SEE ALSO

[**rulexdb\_classify**(3)](/rulexdb_classify/3.md), [**rulexdb\_close**(3)](/rulexdb_close/3.md), [**rulexdb\_dataset\_name**(3)](/rulexdb_dataset_name/3.md), [**rulexdb\_discard\_dictionary**(3)](/rulexdb_discard_dictionary/3.md), [**rulexdb\_discard\_ruleset**(3)](/rulexdb_discard_ruleset/3.md), [**rulexdb\_fetch\_rule**(3)](/rulexdb_fetch_rule/3.md), [**rulexdb\_lexbase**(3)](/rulexdb_lexbase/3.md), [**rulexdb\_open**(3)](/rulexdb_open/3.md), [**rulexdb\_remove\_item**(3)](/rulexdb_remove_item/3.md), [**rulexdb\_remove\_rule**(3)](/rulexdb_remove_rule/3.md), [**rulexdb\_remove\_this\_item**(3)](/rulexdb_remove_this_item/3.md), [**rulexdb\_retrieve\_item**(3)](/rulexdb_retrieve_item/3.md), [**rulexdb\_search**(3)](/rulexdb_search/3.md), [**rulexdb\_seq**(3)](/rulexdb_seq/3.md), [**rulexdb\_subscribe\_item**(3)](/rulexdb_subscribe_item/3.md), [**rulexdb\_subscribe\_rule**(3)](/rulexdb_subscribe_rule/3.md)

## AUTHOR

Igor B. Poretsky \<poretsky@mlbox.ru\>.
