LIBEDIT_MANIFEST

Constant LIBEDIT_MANIFEST 

Source
pub const LIBEDIT_MANIFEST: &str = "# FFI Manifest for libedit (BSD-licensed readline alternative)\n#\n# Provides line-editing and history functionality for interactive programs.\n# This is the BSD-licensed alternative to GNU readline, used by PostgreSQL,\n# Python (on macOS), and many other projects.\n#\n# Installation:\n#   macOS: Already installed (Apple ships libedit)\n#   Ubuntu/Debian: apt install libedit-dev\n#   Fedora: dnf install libedit-devel\n#\n# Usage in Seq:\n#   include ffi:libedit\n#\n#   \"prompt> \" readline  # Read a line with editing\n#   dup add-history      # Add to history\n#\n# Persistent history:\n#   \"/path/to/history\" read-history drop   # Load at startup\n#   # ... run REPL ...\n#   \"/path/to/history\" write-history drop  # Save at exit\n#\n# Note: These functions accept file paths as-is. Shell expansions like ~\n# are not performed - that\'s the responsibility of your application.\n# A future std:os module could provide getenv for building paths like\n# \"$HOME/.myapp_history\".\n#\n# Note: The function names (readline, add-history) match GNU readline\'s API,\n# making it easy to switch between the two libraries.\n\n[[library]]\nname = \"libedit\"\nlink = \"edit\"\n\n[[library.function]]\nc_name = \"readline\"\nseq_name = \"readline\"\nstack_effect = \"( String -- String )\"\nargs = [\n  { type = \"string\", pass = \"c_string\" }\n]\n[library.function.return]\ntype = \"string\"\nownership = \"caller_frees\"\n\n[[library.function]]\nc_name = \"add_history\"\nseq_name = \"add-history\"\nstack_effect = \"( String -- )\"\nargs = [\n  { type = \"string\", pass = \"c_string\" }\n]\n[library.function.return]\ntype = \"void\"\n\n# read_history(const char *filename) -> int\n# Loads command history from a file. Call at program startup.\n# Returns 0 on success, non-zero on error (e.g., file not found).\n[[library.function]]\nc_name = \"read_history\"\nseq_name = \"read-history\"\nstack_effect = \"( String -- Int )\"\nargs = [\n  { type = \"string\", pass = \"c_string\" }\n]\n[library.function.return]\ntype = \"int\"\n\n# write_history(const char *filename) -> int\n# Saves command history to a file. Call at program exit.\n# Returns 0 on success, non-zero on error.\n[[library.function]]\nc_name = \"write_history\"\nseq_name = \"write-history\"\nstack_effect = \"( String -- Int )\"\nargs = [\n  { type = \"string\", pass = \"c_string\" }\n]\n[library.function.return]\ntype = \"int\"\n";
Expand description

Embedded libedit FFI manifest (BSD-licensed)