Created
December 3, 2012 00:31
-
-
Save akoskovacs/4191793 to your computer and use it in GitHub Desktop.
AkLisp hello, world module
This file contains hidden or 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 <aklisp.h> | |
| #include <stdio.h> | |
| AKL_CFUN_DEFINE(hello, in, args) | |
| { | |
| printf("Hello, world from 'hello' module!\n"); | |
| /* Every function must return something, | |
| the type of 'akl_value' */ | |
| return &NIL_VALUE; | |
| } | |
| static int hello_load(struct akl_state *in) | |
| { | |
| AKL_ADD_CFUN(in, hello, "HELLO", "Hey hello!"); | |
| return AKL_LOAD_OK; | |
| } | |
| static int hello_unload(struct akl_state *in) | |
| { | |
| AKL_REMOVE_CFUN(in, hello); | |
| return AKL_LOAD_OK; | |
| } | |
| AKL_MODULE_DEFINE(hello_load, hello_unload, "hello" | |
| , "A simple demo module", "Akos Kovacs"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment