On Tue, Aug 18, 2020 at 07:48:43AM -0500, Eric Blake wrote:
>+extern int nbdkit_main (int argc, char *argv[]);
A bit odd to declare this in a .c; but I don't see any existing
decent .h to put it in, nor is it worth adding a new one just for
this. So it is fine right here.
Yup, better suggestions greatfully accepted, but I couldn't see
anywhere obvious. Maybe internal.h?
>+
>+int
>+main (int argc, char *argv[])
>+{
>+ /* This does nothing except call into the real main function in
>+ * libnbdkit.so.
>+ */
>+ return nbdkit_main (argc, argv);
>+}
>diff --git a/server/nbdkit.syms b/server/nbdkit.syms
>index a67669b7..a516cc0f 100644
>--- a/server/nbdkit.syms
>+++ b/server/nbdkit.syms
>@@ -54,6 +54,7 @@
> nbdkit_extents_new;
> nbdkit_get_extent;
> nbdkit_is_tls;
>+ nbdkit_main;
Do we want to export it as _nbdkit_main, to make it obvious that
plugins shouldn't try calling it? That's cosmetic if you think it
is worth it.
I was a bit in two minds about whether this API should be public or
not. Could it be called by other programs? Would it be useful for
other programs? Would that just cause us trouble in future?
I don't intend to push any of this stuff until the 1.23 development
branch opens.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW