As an example, here is the beginning of the JS (JavaScript) extension module using C BASIC masking.
/* V7 JavaScript Engine Extension Module */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <time.h>
#include <unistd.h>
#include "../../basext.h"
#include "../../scriba.h"
#include "cbasic.h"
#include "v7.h"
/****************************
Extension Module Functions
****************************/
besVERSION_NEGOTIATE
RETURN_FUNCTION((int)INTERFACE_VERSION);
besEND
besSUB_START
DIM AS long PTR p;
besMODULEPOINTER = besALLOC(sizeof(long));
IF (besMODULEPOINTER EQ NULL) THEN_DO RETURN_FUNCTION(0);
p = (long PTR)besMODULEPOINTER;
RETURN_FUNCTION(0);
besEND
besSUB_FINISH
DIM AS long PTR p;
p = (long PTR)besMODULEPOINTER;
IF (p EQ NULL) THEN_DO RETURN_FUNCTION(0);
RETURN_FUNCTION(0);
besEND
/*******
V7 API
*******/
besFUNCTION(js_create)
struct v7 *v7 = v7_create();
besRETURN_LONG(v7);
besEND
besFUNCTION(js_destroy)
DIM AS unsigned long v7;
besARGUMENTS("i")
AT v7
besARGEND
v7_destroy(v7);
besRETURNVALUE = NULL;
besEND
besFUNCTION(js_exec)
DIM AS unsigned long v7;
DIM AS const char *js_code;
DIM AS v7_val_t result;
enum v7_err rcode = V7_OK;
besARGUMENTS("iz")
AT v7, AT js_code
besARGEND
rcode = v7_exec(v7, js_code, result);
besRETURN_LONG(rcode);
besEND
js.bas include
MODULE JS
declare sub ::CREATE alias "js_create" lib "js"
declare sub ::DESTROY alias "js_destroy" lib "js"
declare sub ::EXEC alias "js_exec" lib "js"
END MODULE