Added the ca_type_from_string function

This function can be used from tools that deal with raw tables directly, i.e.
not throught a schema.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Added "stat" and "utime" functions to the table interface

This allows tools to behave like make, i.e. only updating a table if the files
it is generated from are modified.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
table-backend-writeonce.c: Use shared instead of own "likely" macros

The ca_likely and ca_unlikely macros for providing hints about the likelyhood
of conditional branches have recently been added to ca-table.h.  This patch
removes a duplicate definition from table-backend-writeonce.c and uses the ones
in ca-table.h instead.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
table-backend-writeonce: Respect umask

Since we're using mkstemp+chmod instead of open(O_CREAT), umask was not being
preserved.  This is now fixed through explicit calls to the umask() system
call.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
ts-merge: Support merging different types of data

I needed to be able to merge tables of timestamped text fields.  Hopefully this
tool will go away in favor of aggregate functions in the shell.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
ts-merge: Exit with EXIT_FAILURE on failure

Most of the logic to accomplish this was already in place, but the work was
discarded and EXIT_SUCCESS was returned anyway.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
ts-merge: Support --update

This option prevents the table from being rebuilt if the output is newer than
all the inputs.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>