summaryrefslogtreecommitdiffhomepage
path: root/src/chunklets/README-msg
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-07-29 14:32:06 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2023-08-02 21:02:31 +0100
commit9a0d8730fa977f666b5c12e4c5901e7d0391e245 (patch)
tree87eebcdcef04ae1e7348ef80e972c08aa4783649 /src/chunklets/README-msg
parentd337b09936ecd90bad07b28b48b7103395d97ce5 (diff)
Make various preparations for upcoming features
A lot of this is random WIP from a while back, at least a month ago, and is being committed now to get it out of the way so that other patches can be brought in and integrated against it without causing headaches. Also rolled into this commit is a way to distinguish plugin_unload from exiting the game. This is required for another soon-to-be-integrated feature to avoid crashing on exit, and could in theory also be used to speed up unloading on exit in future. While we're at it, this also avoids the need to linearly scan through the plugin list to do the old branch unloading fix, because we can. Rough summary of the other smaller stuff I can remember doing: - Rework bitbuf a bit - Add some cryptographic nonsense in ac.c (not final at all) - Introduce the first couple of "chunklets" libraries as a sort-of subproject of this one - Tidy up random small bits and bobs - Add source for a small keypair generation tool - Rework democustom to be very marginally more useful
Diffstat (limited to 'src/chunklets/README-msg')
-rw-r--r--src/chunklets/README-msg55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/chunklets/README-msg b/src/chunklets/README-msg
new file mode 100644
index 0000000..53d19f1
--- /dev/null
+++ b/src/chunklets/README-msg
@@ -0,0 +1,55 @@
+msg.{c,h}: fast low-level msgpack encoding
+
+== Compiling ==
+
+ gcc -c -O2 [-flto] msg.c
+ clang -c -O2 [-flto] msg.c
+ tcc -c msg.c
+ cl.exe /c /O2 msg.c
+
+In most cases you can just drop the .c file straight into your codebase/build
+system. LTO is advised to avoid dead code and enable more efficient calls
+including potential inlining.
+
+== Compiler compatibility ==
+
+- Any reasonable GCC
+- Any reasonable Clang
+- Any reasonable MSVC
+- TinyCC
+- Probably almost all others; this is very portable code
+
+Note that GCC and Clang will generally give the best-performing output.
+
+Once the .c file is built, the public header can be consumed by virtually any C
+or C++ compiler, as well as probably most half-decent FFIs.
+
+Note that the .c source file is not C++-compatible, only the header is. The
+source file relies on union type-punning, which is well-defined in C but
+undefined behaviour in C++.
+
+== API Usage ==
+
+See documentation comments in msg.h for a basic idea. Note that this library is
+very low-level and probably best suited use with some sort of metaprogramming/
+code-generation, or bindings to a higher-level langauge.
+
+== OS Compatibility ==
+
+- All.
+- Seriously, this library doesn’t even use libc.
+
+== Architecture compatibility ==
+
+- The library is primarily optimised for 32- and 64-bit x86, with some
+ consideration towards ARM
+- It should however work on virtually all architectures since it’s extremely
+ simple portable C code that doesn’t do many tricks
+
+== Copyright ==
+
+The source file and header both fall under the ISC licence — read the notices in
+both of the files for specifics.
+
+Thanks, and have fun!
+- Michael Smith <mikesmiffy128@gmail.com>