Created
March 27, 2012 15:32
-
-
Save kishikawakatsumi/2217051 to your computer and use it in GitHub Desktop.
Reflection C function call by ffcall
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 <stdio.h> | |
#include <dlfcn.h> | |
#include <avcall.h> | |
int main(int argc, char *argv[]) { | |
int ret; | |
av_alist alist; | |
void *dlh; | |
void *fp; | |
dlh = dlopen(argv[0], RTLD_LAZY); | |
fp = dlsym(dlh, "puts"); | |
av_start_int(alist, fp, &ret); | |
av_ptr(alist, char *, "Hello World!"); | |
av_call(alist); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment