~blainsmith/public-inbox

hare-sqlite: fix errors in documentation, make style more consistent with stdlib docs v1 APPLIED

: 1
 fix errors in documentation, make style more consistent with stdlib docs

 3 files changed, 17 insertions(+), 17 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~blainsmith/public-inbox/patches/54996/mbox | git am -3
Learn more about email & git

[PATCH hare-sqlite] fix errors in documentation, make style more consistent with stdlib docs Export this patch

From: wackbyte <wackbyte@protonmail.com>

---
 sqlite/handle.ha    |  2 +-
 sqlite/results.ha   |  2 +-
 sqlite/statement.ha | 30 +++++++++++++++---------------
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/sqlite/handle.ha b/sqlite/handle.ha
index 7178534..ca6939f 100644
--- a/sqlite/handle.ha
+++ b/sqlite/handle.ha
@@ -40,7 +40,7 @@ export fn close(h: handle) (void | error) = {
};

@symbol("sqlite3_libversion") fn _version() *const c::char;
// returns the SQLite version of the libary used:
// returns the SQLite version of the library used:
// 
// https://sqlite.org/c3ref/libversion.html
export fn version() const str = {
diff --git a/sqlite/results.ha b/sqlite/results.ha
index 2927db2..b28b1e0 100644
--- a/sqlite/results.ha
+++ b/sqlite/results.ha
@@ -8,7 +8,7 @@ export type ok = void;
// indicates another row is available in the [[statement]] from [[step]]
export type row = void;

// indcates there are no more rows available in the [[statement]] from [[step]]
// indicates there are no more rows available in the [[statement]] from [[step]]
export type done = void;

// any successful result
diff --git a/sqlite/statement.ha b/sqlite/statement.ha
index 5d42a26..1864f1b 100644
--- a/sqlite/statement.ha
+++ b/sqlite/statement.ha
@@ -54,7 +54,7 @@ export fn prepare(h: handle, sql: str) (statement | error) = {
};

@symbol("sqlite3_bind_double") fn _bind_float(sqlite: nullable *opaque, col: int, val: f64) int;
// binds a `f64` to the parameter at `col` index which wraps:
// binds an f64 to the parameter at position "col" which wraps:
//
// https://www.sqlite.org/c3ref/bind_blob.html
export fn bind_float(s: statement, col: int, val: f64) (void | error) = {
@@ -62,7 +62,7 @@ export fn bind_float(s: statement, col: int, val: f64) (void | error) = {
};

@symbol("sqlite3_bind_int") fn _bind_int(sqlite: nullable *opaque, col: int, val: int) int;
// binds a `int` to the parameter at `col` index which wraps:
// binds an int to the parameter at position "col" which wraps:
//
// https://www.sqlite.org/c3ref/bind_blob.html
export fn bind_int(s: statement, col: int, val: int) (void | error) = {
@@ -70,7 +70,7 @@ export fn bind_int(s: statement, col: int, val: int) (void | error) = {
};

@symbol("sqlite3_bind_text") fn _bind_str(sqlite: nullable *opaque, col: int, val: const *c::char, bytelen: int, callback: nullable *fn(*opaque) void) int;
// binds a `str` to the parameter at `col` index which wraps:
// binds a str to the parameter at position "col" which wraps:
//
// https://www.sqlite.org/c3ref/bind_blob.html
export fn bind_str(s: statement, col: int, val: str) (void | error) = {
@@ -83,7 +83,7 @@ fn freecstr(cstr: *const c::char) void = {
};

@symbol("sqlite3_bind_null") fn _bind_null(sqlite: nullable *opaque, col: int) int;
// binds null to the parameter at `col` index which wraps:
// binds null to the parameter at position "col" which wraps:
//
// https://www.sqlite.org/c3ref/bind_blob.html
export fn bind_null(s: statement, col: int) (void | error) = {
@@ -101,22 +101,22 @@ export fn step(s: statement) (result | error) = {
@symbol("sqlite3_reset") fn _reset(stmt: nullable *opaque) int;
// resets a [[statement]] which wraps:
// 
// https://sqlite.org/c3ref/step.html
// https://sqlite.org/c3ref/reset.html
export fn reset(s: statement) (result | error) = {
	return wrapint(_reset(s.stmt));
};

@symbol("sqlite3_finalize") fn _finalize(stmt: nullable *opaque) int;
// finalizes a [[statement]] and frees [[statement]] to free the resourcs which wraps:
// finalizes a [[statement]] and frees its resources which wraps:
// 
// https://sqlite.org/c3ref/prepare.html
// https://sqlite.org/c3ref/finalize.html
export fn finalize(s: statement) (void | error) = {
	wrapvoid(_finalize(s.stmt))?;
	return;
};

@symbol("sqlite3_column_name") fn _column_name(stmt: nullable *opaque, col: int) const *c::char;
// gets the column's name at position `col` for the [[statement]] which wraps:
// gets the column's name at position "col" for the [[statement]] which wraps:
// 
// https://sqlite.org/c3ref/column_name.html
export fn column_name(s: statement, col: int) str = {
@@ -124,7 +124,7 @@ export fn column_name(s: statement, col: int) str = {
};

@symbol("sqlite3_column_type") fn _column_type(stmt: nullable *opaque, col: int) int;
// gets the column's type at position `col` for the [[statement]] which wraps:
// gets the column's type at position "col" for the [[statement]] which wraps:
// 
// https://sqlite.org/c3ref/column_type.html
export fn column_type(s: statement, col: int) columntype = {
@@ -144,7 +144,7 @@ export fn column_type(s: statement, col: int) columntype = {
};

@symbol("sqlite3_column_int") fn _column_int(stmt: nullable *opaque, col: int) int;
// return an int for position `col` of type `INTEGER` for the [[statement]] which wraps:
// returns an int for position "col" of type INTEGER for the [[statement]] which wraps:
// 
// https://sqlite.org/c3ref/column_blob.html
export fn column_int(s: statement, col: int) int = {
@@ -152,7 +152,7 @@ export fn column_int(s: statement, col: int) int = {
};

@symbol("sqlite3_column_double") fn _column_float(stmt: nullable *opaque, col: int) f64;
// return an f64 for position `col` of type `REAL` for the [[statement]] which wraps:
// returns an f64 for position "col" of type REAL for the [[statement]] which wraps:
// 
// https://sqlite.org/c3ref/column_blob.html
export fn column_float(s: statement, col: int) f64 = {
@@ -160,7 +160,7 @@ export fn column_float(s: statement, col: int) f64 = {
};

@symbol("sqlite3_column_text") fn _column_str(stmt: nullable *opaque, col: int) const *c::char;
// return a str for position `col` of type `TEXT` for the [[statement]] which wraps:
// returns a str for position "col" of type TEXT for the [[statement]] which wraps:
// 
// https://sqlite.org/c3ref/column_blob.html
export fn column_str(s: statement, col: int) str = {
@@ -168,18 +168,18 @@ export fn column_str(s: statement, col: int) str = {
};

@symbol("sqlite3_column_blob") fn _column_blob(stmt: nullable *opaque, col: int) const *opaque;
// return a *opaque for position `col` of type `BLOB` for the [[statement]] which wraps:
// returns a *opaque for position "col" of type BLOB for the [[statement]] which wraps:
// 
// https://sqlite.org/c3ref/column_blob.html
export fn column_blob(s: statement, col: int) nullable *opaque = _column_blob(s.stmt, col);

@symbol("sqlite3_column_bytes") fn _column_bytes(stmt: nullable *opaque, col: int) int;
// return the number of bytes as a size for position `col` for the [[statement]] which wraps:
// returns the number of bytes as a size for position "col" for the [[statement]] which wraps:
// 
// https://sqlite.org/c3ref/column_blob.html
export fn column_bytes(s: statement, col: int) size = _column_bytes(s.stmt, col): size;

// a convience function to return a []u8 for position `col` of type `BLOB` for the [[statement]]
// a convenience function to return a []u8 for position "col" of type BLOB for the [[statement]]
export fn column_byte_slice(s: statement, col: int) []u8 = {
	let blob = column_blob(s, col): *[*]u8;
	let sz = column_bytes(s, col);
-- 
2.46.0