Skip to content

OUIsolutions/LuaCEmbed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WARNING: THIS IS ALPHA SOFTWARE. USE AT YOUR OWN RISK. NO WARRANTY IS PROVIDED AND BUGS ARE EXPECTED.

LuaCEmbed is a Lua wrapper to allow easy interoperability between C and Lua, providing methods to control Lua code from C, create Lua libraries, or set up environments for safe evaluation of Lua code.

Releases

Item Description
LuaCEmbedOne.c One File
LuaCEmbed.c Definition
LuaCEmbed.h Header
LuaCEmbed.zip Zip Mode

Most Basic Example

Like all OUI libraries, LuaCEmbed adopts the idea of a single-file library, so you just need to copy the LuaCEmbedOne.c file into your project and compile with gcc/clang.

#include "LuaCEmbedOne.c"

int main(int argc, char *argv[]){
    LuaCEmbed *l = newLuaCEmbedEvaluation();
    LuaCEmbed_evaluate(l, "r = 30");
    long calc = LuaCEmbed_get_evaluation_long(l, "r + 20");
    printf("result %ld", calc);
    
    if(LuaCEmbed_has_errors(l)){
        printf("error: %s\n", LuaCEmbed_get_error_message(l));
    }
    LuaCEmbed_free(l);
    return 0;
}

Documentation

Item Description
build_and_install.md Installation and Compilation
native_functions.md Running Native Functions
making_a_library.md Creating Libraries
evaluations.md Lua Evaluation
timeout.md Timeout
memory_usage.md Memory Usage
callbacks.md Callbacks
table_handling.md Table Handling
table_setting.md Setting Table Properties
table_size.md Table Size
dependencies.md Licenses and Attributions