From 4eda629c8dc44b59b07eb4a47b2efa697254ff23 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 17 Jun 2026 13:02:57 +0000 Subject: [PATCH] cleanup, docs --- site/doc/areas/memcache.txt | 2 ++ site/doc/areas/string.txt | 6 ++++++ site/doc/areas/sys.txt | 5 +++++ site/doc/areas/types.txt | 2 ++ site/doc/areas/uri.txt | 1 + site/doc/pages/draw_float.txt | 2 +- site/doc/pages/gen_float.txt | 2 +- site/doc/pages/gen_int.txt | 2 +- site/doc/pages/gen_noise01.txt | 2 +- site/doc/pages/gen_noise32.txt | 2 +- site/doc/pages/gen_noise64.txt | 2 +- site/doc/pages/gen_sha1.txt | 2 +- site/doc/pages/http_request.txt | 4 ---- site/doc/pages/http_request_async.txt | 4 ---- site/doc/pages/mysql_query.txt | 9 --------- site/doc/pages/server_stop.txt | 4 ---- site/doc/pages/session_destroy.txt | 2 +- site/doc/pages/sqlite_affected_rows.txt | 5 ----- site/doc/pages/sqlite_insert_id.txt | 5 ----- site/doc/pages/sqlite_query.txt | 11 ----------- 20 files changed, 24 insertions(+), 50 deletions(-) diff --git a/site/doc/areas/memcache.txt b/site/doc/areas/memcache.txt index 6bb5731..9844e9c 100644 --- a/site/doc/areas/memcache.txt +++ b/site/doc/areas/memcache.txt @@ -6,3 +6,5 @@ memcache_delete memcache_get memcache_get_multiple memcache_set +memcache_escape_key +memcache_escape_keys diff --git a/site/doc/areas/string.txt b/site/doc/areas/string.txt index 43264db..777f662 100644 --- a/site/doc/areas/string.txt +++ b/site/doc/areas/string.txt @@ -30,3 +30,9 @@ regex_split to_lower to_upper trim +float_val +int_val +html_escape +safe_name +var_dump +json_decode diff --git a/site/doc/areas/sys.txt b/site/doc/areas/sys.txt index f456f12..6ed19be 100644 --- a/site/doc/areas/sys.txt +++ b/site/doc/areas/sys.txt @@ -47,3 +47,8 @@ file_temp file_chmod file_symlink file_fsync +path_is_within +path_real +process_start_directory +request_perf +runtime_safe_key diff --git a/site/doc/areas/types.txt b/site/doc/areas/types.txt index ea8ccd4..1dfb2d9 100644 --- a/site/doc/areas/types.txt +++ b/site/doc/areas/types.txt @@ -36,3 +36,5 @@ to_bool to_f64 to_s64 to_u64 +ucb_encode +ucb_decode diff --git a/site/doc/areas/uri.txt b/site/doc/areas/uri.txt index 3edde51..e29744a 100644 --- a/site/doc/areas/uri.txt +++ b/site/doc/areas/uri.txt @@ -15,3 +15,4 @@ parse_query parse_uri uri_decode uri_encode +request_route_from_raw_path diff --git a/site/doc/pages/draw_float.txt b/site/doc/pages/draw_float.txt index 436eae4..bdf6553 100644 --- a/site/doc/pages/draw_float.txt +++ b/site/doc/pages/draw_float.txt @@ -1,5 +1,5 @@ :sig -f64 draw_float(f64 from, f64 to) +f64 draw_float(f64 from, f64 to, f64 decimal_precision = 0.000000000001) :params from : minimum value diff --git a/site/doc/pages/gen_float.txt b/site/doc/pages/gen_float.txt index e8194d4..fd2fdda 100644 --- a/site/doc/pages/gen_float.txt +++ b/site/doc/pages/gen_float.txt @@ -1,5 +1,5 @@ :sig -f64 generate_float(f64 from, f64 to, u64 index, u64 seed = 0) +f64 gen_float(f64 from, f64 to, u64 index, u64 seed = 0, f64 decimal_precision = 0.000000000001) :params from : minimum result diff --git a/site/doc/pages/gen_int.txt b/site/doc/pages/gen_int.txt index 5c47696..528e963 100644 --- a/site/doc/pages/gen_int.txt +++ b/site/doc/pages/gen_int.txt @@ -1,5 +1,5 @@ :sig -u64 generate_int(u64 from, u64 to, u64 index, u64 seed = 0) +u64 gen_int(u64 from, u64 to, u64 index, u64 seed = 0) :params from : minimum result diff --git a/site/doc/pages/gen_noise01.txt b/site/doc/pages/gen_noise01.txt index 6ecf61c..6ac2ea9 100644 --- a/site/doc/pages/gen_noise01.txt +++ b/site/doc/pages/gen_noise01.txt @@ -1,5 +1,5 @@ :sig -u32 noise01(u64 index, u64 seed = 0) +f64 gen_noise01(u64 index, u64 seed = 0) :params index : index position diff --git a/site/doc/pages/gen_noise32.txt b/site/doc/pages/gen_noise32.txt index 3dfe62c..f0f0cdc 100644 --- a/site/doc/pages/gen_noise32.txt +++ b/site/doc/pages/gen_noise32.txt @@ -1,5 +1,5 @@ :sig -u32 noise32(u32 index, u32 seed = 0) +u32 gen_noise32(u32 index, u32 seed = 0) :params index : index position diff --git a/site/doc/pages/gen_noise64.txt b/site/doc/pages/gen_noise64.txt index 0b80241..34d02d1 100644 --- a/site/doc/pages/gen_noise64.txt +++ b/site/doc/pages/gen_noise64.txt @@ -1,5 +1,5 @@ :sig -u32 noise64(u64 index, u64 seed = 0) +u64 gen_noise64(u64 index, u64 seed = 0) :params index : index position diff --git a/site/doc/pages/gen_sha1.txt b/site/doc/pages/gen_sha1.txt index 9ee5b9b..8533c9c 100644 --- a/site/doc/pages/gen_sha1.txt +++ b/site/doc/pages/gen_sha1.txt @@ -1,5 +1,5 @@ :sig -String sha1(String s, bool as_binary = false) +String gen_sha1(String s, bool as_binary = false) :params s : data to be hashed diff --git a/site/doc/pages/http_request.txt b/site/doc/pages/http_request.txt index 05b9f5c..c7e3385 100644 --- a/site/doc/pages/http_request.txt +++ b/site/doc/pages/http_request.txt @@ -1,9 +1,5 @@ # http_request -```cpp -DValue http_request(DValue req) -``` - Performs a bounded outbound HTTP(S) request using the runtime `curl` binary. Request fields: `method`, `url`, `headers`, `body`, `timeout_ms`, `follow_redirects`. Returns `{ status, headers, body, error }`. `headers` is a name/value map. A missing `curl` binary returns a clear `error` string. diff --git a/site/doc/pages/http_request_async.txt b/site/doc/pages/http_request_async.txt index ab9b17d..c2a4e6a 100644 --- a/site/doc/pages/http_request_async.txt +++ b/site/doc/pages/http_request_async.txt @@ -1,9 +1,5 @@ # http_request_async -```cpp -u64 http_request_async(DValue req) -``` - Starts the same bounded curl-backed request as `http_request()` in the file-backed async job registry and returns a job id. Use `job_await()` or `job_result()` to retrieve the HTTP result. :see diff --git a/site/doc/pages/mysql_query.txt b/site/doc/pages/mysql_query.txt index cbd040b..0e46a57 100644 --- a/site/doc/pages/mysql_query.txt +++ b/site/doc/pages/mysql_query.txt @@ -15,15 +15,6 @@ Executes a MySQL query and returns the resulting data, if any. `params` provides the query parameter values used by the statement. Use named `:name` placeholders only; positional `?` placeholders are rejected. -```cpp -StringMap params; -params["email"] = "ada@example.test"; -DValue rows = mysql_query(m, - "select id, email from users where email = :email", - params -); -``` - The result is returned as a `DValue`, which makes it easy to iterate through rows and read fields with the usual `DValue` accessors. :example diff --git a/site/doc/pages/server_stop.txt b/site/doc/pages/server_stop.txt index be692e3..ad7ba35 100644 --- a/site/doc/pages/server_stop.txt +++ b/site/doc/pages/server_stop.txt @@ -12,10 +12,6 @@ server_start_http :content Stops a custom server listener by key and removes its registry config. -```uce -server_stop("site-tests-http"); -``` - `server_stop()` currently targets custom servers started through `server_start_http()`. The same key model is intended to extend to future `server_start_tcp()` and `server_start_udp()` helpers. :example diff --git a/site/doc/pages/session_destroy.txt b/site/doc/pages/session_destroy.txt index 9fa57f6..c0853eb 100644 --- a/site/doc/pages/session_destroy.txt +++ b/site/doc/pages/session_destroy.txt @@ -1,5 +1,5 @@ :sig -void session_destroy(String session_name) +void session_destroy(String session_name = "uce-session") :params session_name : the name of the session diff --git a/site/doc/pages/sqlite_affected_rows.txt b/site/doc/pages/sqlite_affected_rows.txt index 9889efa..b521d9a 100644 --- a/site/doc/pages/sqlite_affected_rows.txt +++ b/site/doc/pages/sqlite_affected_rows.txt @@ -13,11 +13,6 @@ sqlite_insert_id :content Returns the number of rows changed by the most recent insert, update, or delete statement on the connection. -```cpp -sqlite_query(db, "update users set visits = visits + 1 where id = :id", params); -print(sqlite_affected_rows(db)); -``` - :example SQLite* db = sqlite_connect("/tmp/doc-sqlite-affected.db"); sqlite_query(db, "drop table if exists t"); diff --git a/site/doc/pages/sqlite_insert_id.txt b/site/doc/pages/sqlite_insert_id.txt index 5f6090e..8cb93ca 100644 --- a/site/doc/pages/sqlite_insert_id.txt +++ b/site/doc/pages/sqlite_insert_id.txt @@ -13,11 +13,6 @@ sqlite_affected_rows :content Returns SQLite's last inserted rowid for the connection after an insert statement. -```cpp -sqlite_query(db, "insert into notes(body) values(:body)", params); -u64 id = sqlite_insert_id(db); -``` - :example SQLite* db = sqlite_connect("/tmp/doc-sqlite-insertid.db"); sqlite_query(db, "drop table if exists t"); diff --git a/site/doc/pages/sqlite_query.txt b/site/doc/pages/sqlite_query.txt index c534aca..0c117ee 100644 --- a/site/doc/pages/sqlite_query.txt +++ b/site/doc/pages/sqlite_query.txt @@ -21,17 +21,6 @@ Executes one SQLite statement and returns result rows as a `DValue` array. Multi Use named parameters with `:name` placeholders only. Positional `?` placeholders and SQLite's other named marker forms (`@name`, `$name`) are rejected so UCE SQLite queries use the same placeholder style as the MySQL helper. UCE binds parameters with SQLite prepared statements; it does not substitute values into the SQL string. -```cpp -SQLite* db = sqlite_connect("/tmp/app.sqlite"); - -StringMap params; -params["email"] = "ada@example.test"; -DValue rows = sqlite_query(db, - "select id, email from users where email = :email", - params -); -``` - Result rows are objects keyed by column name. SQLite integer, float, text, blob, and null values are converted to DValue values. Blob values are returned as byte strings. For statements that do not return rows, inspect `sqlite_affected_rows()` or `sqlite_insert_id()` after the call.