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

# rulexdb\_seq(3)

sequential retrieving dictionary items from the rulex database

## NAME

rulexdb\_seq - sequential retrieving dictionary items from the rulex database

## SYNOPSIS

```
#include <rulexdb.h>

int rulexdb_search(RULEXDB *rulexdb, char *key, char *value, int item_type, int mode);
```

## DESCRIPTION

The **rulexdb\_seq**() function sequentially fetches lexical records one by one. It's operations are not disturbed by the key-based search.

The argument *rulexdb* references the rulex database.

The arguments *key* and *value* must point to the buffers with enough space for retrieved data.

The argument *item\_type* specifies the dictionary dataset from which data will be retrieved. It may accept one of the following values:

- **RULEXDB\_LEXBASE**

  Extract data from the **Implicit** dictionary.

- **RULEXDB\_EXCEPTION**

  Extract data from the **Explicit** dictionary.

Note that the data type must be specified explicitly. The value **RULEXDB\_DEFAULT** is not allowed here.

When fetching data from the **Explicit** dictionary the correction rules will be applied. To prevent this feature you can specify **RULEXDB\_EXCEPTION\_RAW** instead of **RULEXDB\_EXCEPTION**.

The *mode* argument specifies direction of the dictionary scanning. Allowed\
  values are: **DB\_FIRST**, **DB\_NEXT**, **DB\_PREV**, or **DB\_LAST** as defined for the underlying database library.

## RETURN VALUE

The **rulexdb\_seq**() function returns **RULEXDB\_SUCCESS** which is zero upon success, positive value **RULEXDB\_SPECIAL** when no more records can be fetched, or negative error code if something is wrong.

## ERRORS

- **RULEXDB\_FAILURE**

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

- **RULEXDB\_EMALLOC**

  Internal memory allocation error.

- **RULEXDB\_EPARM**

  Invalid parameters are specified.

## 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\_load\_ruleset**(3)](/rulexdb_load_ruleset/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\_subscribe\_item**(3)](/rulexdb_subscribe_item/3.md), [**rulexdb\_subscribe\_rule**(3)](/rulexdb_subscribe_rule/3.md)

## AUTHOR

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