Repository navigation
OpenECS-std 0.6.0
Pre-releaseOpenECS-std 0.6.0 adds eight plugins: parse, compress, process, gamepad, hash, sqlite and notify, and the plugin list. web speaks HTTP/2 and takes compressed answers. cglm's vectors and matrices are structs, with methods and operators. The release has the plugins built for Linux and Windows.
It comes out with OpenECS 0.6.0, which ships these plugins built, in its plugins/ folder. The examples of OpenECS-examples 0.6.0 use them.
What you can do
Read and write data formats. parse reads and writes JSON, TOML, INI, .env and CSV texts as values: parse.json.read(text) and parse.json.write(value), and the same for the others. A text that cannot be read gives nothing and why, with the line. Writes sort named fields, so the same data gives the same text.
Pack and unpack. compress packs and unpacks gzip, zlib, deflate and zstd, such as compress.gzip.pack(data), and compress.unpack(data) tells gzip, zlib and zstd by their first bytes. compress.zip lists, reads, writes and extracts zip archives; an extract refuses entries that would go outside its folder.
Run programs. process.run(command, folder, input) runs a short program to its end and gives its output. process.start(command, folder) gives a handle whose read, readErrors, write, closeInput, exited and kill never block the tool. A program whose handle is gone is killed.
Read gamepads. gamepad.list() and gamepad.open(id) give the gamepads that are plugged in, whose buttons, sticks and triggers have SDL's names: pad:button("a"), pad:axis("leftx"), pad:rumble(low, high, seconds). The events gamepad.added, gamepad.removed, gamepad.button and gamepad.axis tell what changes, so nothing polls. gamepad.attachVirtual(name) plugs in a virtual gamepad, for tests and for tools that turn other input into a gamepad's. The setting gamepad.background reads the gamepads while another program has the focus.
Hash data. hash.of(algorithm, data) gives a CRC-32, MD5, SHA-1, SHA-256, SHA-512, XXH64, XXH3 or XXH128 as hexadecimal text, as sha256sum and xxhsum write it. hash.new(algorithm) takes the data in parts, such as a large file's, with hasher:update(data) and hasher:digest().
Keep records in SQLite. sqlite.open(path) opens a database file, or ":memory:". database:query(sql, parameters) gives the rows as tables of their columns, with ? or :name parameters, so a value never becomes part of the SQL. exec, changes, lastId and close do the rest. Full-text search and the math functions are in.
Show notifications and tray icons. notify.send(notification) shows a desktop notification, with buttons, an image and a priority. notify.tray(tray) shows a tray icon with a menu of entries and checkboxes. Clicks come back as the events notify.action, notify.trayEntry and notify.trayClicked.
Enable and disable plugins while the tool runs. The plugin list, a first-party plugin, lists every plugin in the plugin folders and enables or disables one. It refreshes when the plugins change.
Download faster with web. web uses HTTP/2 over HTTPS, and asks for answers compressed with gzip, deflate or zstd; the body comes unpacked.
Do 3D math with operators. cglm's vec2, vec3, vec4 and quat have the fields x, y, z and w, and mat4 is a list of 16 floats. a + b, v * s, m1 * m2 and p * q work, and so do methods such as v:normalize() and m:inv(). bytes gives a struct's floats for a shader's uniforms. C plugins pass them as CglmVec3 and CglmMat4, by pointer.
Small fixes
- ui: a text without wrap keeps its own lines, each cut with an ellipsis, so it no longer draws over what follows it. Wrapped text keeps the blanks a line starts with.
cglm.mat4Invgives zeros for a matrix without an inverse.- The launcher's preset is format 2, with the category of its desktop entry.
What will break
cglm. Vectors, quaternions and matrices are structs, not buffers of floats. Read their fields, such as v.x, in place of cglm.components, which is gone. Pass v:bytes() where a buffer is needed, such as a shader's uniforms. C plugins pass CglmVec3, CglmMat4 and the others by pointer.
OpenECS. The plugins need OpenECS 0.6.0: cglm's structs and the plugin list use its new functions. They still use plugin API version 2.
Building. std's build compiles SQLite, xxHash, yyjson, tomlc17, zlib, zstd and nghttp2 too. Update the submodules first, as README.md says.
Downloads
openecs-std-0.6.0-linux-x86_64.tar.gzandopenecs-std-0.6.0-windows-x86_64.zip: the plugins built, as above, with the licenses of the libraries in them.openecs-std-0.6.0-source.tar.gz: the source with the libraries it compiles in. Build it inside a checkout of OpenECS, as README.md says.SHA256SUMS: checksums of the archives.
The standard plugins are under the zlib license. The libraries in dependencies/ keep their own licenses, which OpenECS's release lists.