On Sun, Jun 17, 2018 at 6:39 AM, David Mason <dma...@ryerson.ca> wrote:
> Just had a quick thought that might make the conversion to library much > easier. > > If you have a relatively small API interface, each of the API functions > could do a setjmp https://en.wikipedia.org/wiki/Setjmp.h and then the > fatal error routines could longjmp back. This would give you API safety, at > very limited code intervention. And if a flag got set by the API functions, > then the fatal routines could check, so that fossil the program would need > no changes as only the API functions would change the default fail-hard > behaviour. > > But perhaps the API would be too big to make this a win. > > Just a thought. > > ../Dave > > > This is the kind of approach I glossed over as a "goto cleanup", so we're on the same track here. I haven't had a chance to go over some of the core C files in libfossil yet, curious to what degree it follows this pattern already. Stephan has indicated that allocation is necessarily somewhat more fine-grained than this, and elsewhere in the documentation, exceptions are mentioned... -Sam
_______________________________________________ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users