You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
913 B
Markdown

2 years ago
# Cozo C lib
2 years ago
[![C](https://img.shields.io/github/v/release/cozodb/cozo)](https://github.com/cozodb/cozo/releases)
2 years ago
This directory contains the source of the Cozo C API.
2 years ago
This document describes how to set up the C library.
2 years ago
To learn how to use CozoDB (CozoScript), read the [docs](https://docs.cozodb.org/en/latest/index.html).
2 years ago
You can download pre-built libraries from the [release page](https://github.com/cozodb/cozo/releases),
look for those starting with `libcozo_c`.
2 years ago
The API is contained in this single [header file](./cozo_c.h).
An example for using the API is [here](./example.c).
To build and run the example:
2 years ago
```bash
gcc -L../target/release/ -lcozo_c example.c -o example && ./example
2 years ago
```
2 years ago
2 years ago
# Building Cozo from source
2 years ago
2 years ago
You need to install the [Rust toolchain](https://www.rust-lang.org/tools/install) on your system. Then:
2 years ago
```bash
2 years ago
cargo build --release -p cozo_c -F compact -F storage-rocksdb
2 years ago
```