It’s (slowly) getting somewhere.
I updated the
libwpd configuration settings in wordptr.libwpd to support a client override of the default daemon loop. This method gets injected into the daemon
start method on reconfiguration.
There’s a little more work to do in this space, but here’s a brief outline…
First, the following typedef was added for the hook signature:
1 2 3 4 5
wp_daemon_start_method_fn typedef is utilized by the internal configuration class with the following getters and setters:
Finally, the hook is installed within the client reconfiguration method like so:
1 2 3
If the hook is not installed, the daemon creates its own loop: It sits in a perpetual wait state, listening for signals. By overriding the main loop with your own
daemon_start method, you can alter the default run loop.
The current default run loop looks something like this (see the latest commit on GitHub for wp_daemonizer.c, method
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Note that in the override case, the
sigsuspend method is never called. Consider a similar pattern in your own main loop or you’ll eat CPU cycles.