feat: add cJSON and SQLite amalgamation source files under deps/
Add the cJSON library (cJSON.c, cJSON.h) and SQLite amalgamation (sqlite3.c, sqlite3.h, sqlite3ext.h, shell.c) as vendored dependencies in the deps/ directory for use by the project build system.
This commit is contained in:
Vendored
+51
@@ -0,0 +1,51 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "env" for Environment
|
||||
|
||||
System.print("=== Environment Module Demo ===\n")
|
||||
|
||||
System.print("--- Reading Environment Variables ---")
|
||||
var home = Environment.get("HOME")
|
||||
var path = Environment.get("PATH")
|
||||
var user = Environment.get("USER")
|
||||
|
||||
System.print("HOME: %(home)")
|
||||
System.print("USER: %(user)")
|
||||
System.print("PATH (first 80 chars): %(path[0...80])...")
|
||||
|
||||
System.print("\n--- Reading Non-existent Variable ---")
|
||||
var missing = Environment.get("WREN_NONEXISTENT_VAR_12345")
|
||||
System.print("Missing variable: %(missing)")
|
||||
|
||||
System.print("\n--- Setting Environment Variables ---")
|
||||
Environment.set("WREN_DEMO_VAR", "Hello from Wren!")
|
||||
var demoVar = Environment.get("WREN_DEMO_VAR")
|
||||
System.print("WREN_DEMO_VAR: %(demoVar)")
|
||||
|
||||
Environment.set("WREN_DEMO_NUMBER", "42")
|
||||
System.print("WREN_DEMO_NUMBER: %(Environment.get("WREN_DEMO_NUMBER"))")
|
||||
|
||||
System.print("\n--- Updating Environment Variables ---")
|
||||
Environment.set("WREN_DEMO_VAR", "Updated value")
|
||||
System.print("WREN_DEMO_VAR (updated): %(Environment.get("WREN_DEMO_VAR"))")
|
||||
|
||||
System.print("\n--- Deleting Environment Variables ---")
|
||||
Environment.delete("WREN_DEMO_VAR")
|
||||
var afterDelete = Environment.get("WREN_DEMO_VAR")
|
||||
System.print("WREN_DEMO_VAR (after delete): %(afterDelete)")
|
||||
|
||||
System.print("\n--- Listing All Environment Variables ---")
|
||||
var all = Environment.all
|
||||
System.print("Total environment variables: %(all.count)")
|
||||
|
||||
System.print("\nFirst 10 environment variables:")
|
||||
var count = 0
|
||||
for (entry in all) {
|
||||
if (count >= 10) break
|
||||
var value = entry.value
|
||||
if (value.count > 40) value = value[0...40] + "..."
|
||||
System.print(" %(entry.key) = %(value)")
|
||||
count = count + 1
|
||||
}
|
||||
|
||||
Environment.delete("WREN_DEMO_NUMBER")
|
||||
Reference in New Issue
Block a user