New, simpler locking function that does not require cleanup, nor promise or attribute structs.
Currently depends on (includes) error.h from pull request #52.
error handling constants
New errid for generic failure
errid for db write
simpler persistent lock function, convenient from e.g. cf-hub
support lock invalidation, useful when taken a lock, but need to redo…
… later due to failure after it has been taken
This approach has the following problems:
If function returns cf_errid, then it is potentially returns any of the errors defined in the enum. This works to the some extent in Unix tradition with errno, but only due to the fact every function documents all the errors that could be returned, and the reasons why the errors are returned.
handling errors with switch() statement will either have to use "default:" case, which is error-prone, or huge list of case CFERRID_THIS_ONE: FatalError("can't happen").
It breaks if(fun()) convention, as the only cf_errid value which evaluates to False is CFERRID_SUCCESS. Negative error codes would help though, if(fun() >= 0) is more-or-less accepted convention.
if (fun() == CFERRID_SUCCESS) is ugly.
Removing error handling and pushing this directly