From 088c7f7c533e4f09550693c0fa0a92642c4aae09 Mon Sep 17 00:00:00 2001 From: DiamondNether90 Date: Thu, 15 Jan 2026 17:18:01 +1100 Subject: [PATCH] Add External Libraries --- External-Libraries.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 External-Libraries.md diff --git a/External-Libraries.md b/External-Libraries.md new file mode 100644 index 0000000..0814de2 --- /dev/null +++ b/External-Libraries.md @@ -0,0 +1,17 @@ +CGround supports creating your own ground functions written in C. While theoretically any language that can compile to a shared object file can be used, C is the language most supported. + +# Creating an External Library (in C) +For this example, we will make a function that returns "Hello, {arg1}!" + +Our ground syntax will be `call !Example_GreetUser $username &greet` + +## C code +First, import `groundext.h`. Then, start a new function. For our example, we will call it `greetUser`. +```c +#include + +GroundValue greetUser(GroundScope* scope, List args) { + +} +``` +To create our function, we need to access our arguments. Use `args.value` \ No newline at end of file