Lindenii Project Forge
Login

hare-lmdb

LMDB bindings for Hare

Hi… I am well aware that this diff view is very suboptimal. It will be fixed when the refactored server comes along!

Commit info
ID
a180c420f5712be3434da5778327a2d39d4c7afb
Author
Runxi Yu <me@runxiyu.org>
Author date
Sat, 15 Mar 2025 20:33:11 +0800
Committer
Runxi Yu <me@runxiyu.org>
Committer date
Sat, 15 Mar 2025 20:33:11 +0800
Actions
Add val and u8s_val
use types;

// Generic structure used for passing keys and data in and out
// of the database.
export type val = ffi::val;

// Convert a []u8 to a [[val]].
export fn u8s_val(s: []u8) val = {
	let ss = *(&s: *types::slice);
	return val {
		mv_size = ss.length,
		mv_data = ss.data,
	};
};