On Sat, Nov 24, 2012 at 3:20 PM, Gilles <gilles.gana...@free.fr> wrote:

> Hello
>
>         Unless there's a way to call fossil.exe and know  how the command
> ended...
>
> http://imageshack.us/photo/my-images/688/fossilprompt.jpg
>
> ... is there a way to recompile the Fossil source code to turn it into
> a DLL* to get some feedback when calling Fossil programmatically?
>
> Since SQLite is available as a DLL and can be called from either a CLI
> application (sqlite.exe) or an application, how much work would it be
> to convert its source code to a library?
>

The current Fossil implementation is not appropriate for converting into a
library due to its extensive using of global variables and due to a
cavalier attitude toward freeing allocated memory.  Fossil is designed to
run a single operation quickly, then quit and let the operating system
clean up the mess.  Even commands like "fossil ui" operate by having the
parent process start up a new short-lived child process to process every
HTTP request.

This idea of starting a new process to handle each operation seems to be
seems to be unfamiliar many newer programers.  Everyone these days just
assumes that a process is long-lived and handles multiple operations.
Having a long-lived process is perhaps a good idea if you are building
massive applications using a complex "framework" with dozens or hundreds of
dependent libraries, since start-up costs can be expensive. But Fossil is
self-contained and has minimal start-up cost, and so kicking off a new
process to handle each operation really isn't such a bad thing.  And it
certainly makes programming easier, since you are free to hold program
state in global or static variables and you no longer have to worry so much
about leaking resources.

This question needs to be a FAQ....


>
> Thank you.
>
> * "shared library", in *nix parlance
>
> _______________________________________________
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to