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.

26 lines
915 B
Markdown

2 years ago
# Cozo C 语言库
[![C](https://img.shields.io/github/v/release/cozodb/cozo)](https://github.com/cozodb/cozo/releases)
2 years ago
这里是 Cozo 的 C API 的源代码。
2 years ago
本文叙述的是如何安装设置 Cozo 的 C 语言库。有关如何使用 CozoDBCozoScript的信息见 [文档](https://docs.cozodb.org/zh_CN/latest/index.html) 。
2 years ago
预编译的库可从 [GitHub 发布页面](https://github.com/cozodb/cozo/releases) 下载,其中 C 语言库以 `libcozo_c` 开头。
2 years ago
C 语言的 API 在这个 [头文件](./cozo_c.h) 中。
2 years ago
[这个程序](./example.c) 举例说明了如何调用此 API程序可使用以下命令编译安装
```bash
gcc -L../target/release/ -lcozo_c example.c -o example && ./example
```
2 years ago
# 从源码编译
2 years ago
首先需要安装 [Rust 工具链](https://www.rust-lang.org/tools/install) ,然后:
```bash
cargo build --release -p cozo_c -F compact -F storage-rocksdb
```