-
-
Save earl/0677266b8511d83ce76a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "reb-host.h" | |
const char *init_block = | |
"REBOL [\n" | |
"Title: {Example extension}\n" | |
"Name: example\n" | |
"Type: extension\n" | |
"Exports: [add-mul]\n" | |
"]\n" | |
"add-mul: command [{Add and multiply integers.} a b c]\n" | |
; | |
RL_LIB *RL; | |
const char *RX_Init(int opts, RL_LIB *lib) { | |
RL = lib; | |
return init_block; | |
} | |
int RX_Call(int cmd, RXIFRM *frm, void *data) { | |
RXA_INT64(frm, 1) = | |
(RXA_INT64(frm, 1) + RXA_INT64(frm, 2)) * | |
RXA_INT64(frm, 3); | |
return RXR_VALUE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment