Support SELECT with no FROM items

This allows calling SELECT to evaluate an expression without having to list a
table.  Especially useful for testing.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
ca-llvm.c: Added the concept of anonymous functions

Anonymous function are not added the our function map, so they cannot be called
from SQL.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Made a generic infrastructure for adding cast functions

The first function to be added is one that maps from TEXT and NUMERIC to
FLOAT4.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
llvm-vm.c: Slight reorganization of code

Moved function declarations out of initialize_types() and into
CA_compiler_init().

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Added cast from TEXT and NUMERIC to FLOAT8

This is a simple call to strtod plus error detection.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Added output support for FLOAT8

This is accomplished by passing %.17g to printf, which will preserve the full
precision of a double.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Added unary C math functions returning the same type they take

This includes:

  abs acos asin atan cbrt ceil cos cosh exp floor log log10 round sin sinh sqrt
  tan tanh trunc

And their float counterparts, with identical names except "f" is appened, for
example absf.