Skip to content

Instantly share code, notes, and snippets.

@earl
Created September 23, 2010 15:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save earl/0677266b8511d83ce76a to your computer and use it in GitHub Desktop.
Save earl/0677266b8511d83ce76a to your computer and use it in GitHub Desktop.
#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