Mercurial
view third_party/libuv/docs/code/plugin/main.c @ 262:0f45474c1b1a
Add cyberpunk JRPG blog browser
Show the latest posts in the JRPG preview and render the full blog archive and sanitized post details in the Inspect modal.
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <mrjunejune@users.noreply.github.com> |
|---|---|
| date | Thu, 06 Aug 2026 04:08:45 -0700 |
| parents | 948de3f54cea |
| children |
line wrap: on
line source
#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; 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; }