Sha256: 9063f1a056cded879412b3c08308bfce42deb4a2c4f7a54a8725656b09eaa526
Contents?: true
Size: 913 Bytes
Versions: 15
Compression:
Stored size: 913 Bytes
Contents
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <uv.h> #include "plugin.h" typedef void (*init_plugin_function)(); void mfp_register(const char *name) { fprintf(stderr, "Registered plugin \"%s\"\n", name); } int main(int argc, char **argv) { if (argc == 1) { fprintf(stderr, "Usage: %s [plugin1] [plugin2] ...\n", argv[0]); return 0; } uv_lib_t *lib = (uv_lib_t*) malloc(sizeof(uv_lib_t)); while (--argc) { fprintf(stderr, "Loading %s\n", argv[argc]); if (uv_dlopen(argv[argc], lib)) { fprintf(stderr, "Error: %s\n", uv_dlerror(lib)); continue; } init_plugin_function init_plugin; if (uv_dlsym(lib, "initialize", (void **) &init_plugin)) { fprintf(stderr, "dlsym error: %s\n", uv_dlerror(lib)); continue; } init_plugin(); } return 0; }
Version data entries
15 entries across 15 versions & 2 rubygems