This is a big commit. It started with a patch from Scott McKellar to
clean up several memory leaks in cstore and provide const-ification. I
was then inspired to add HAVING and multiple predicates per column support.
From Scott:
1. I applied the static qualifier to a number of functions, and a few
variables, that aren't referenced by other files. I left as global
those functions that are registered for dynamic calls.
2. I found a number of cases where a call to buffer_data() was being
passed as a parameter to a function, guaranteeing a memory leak. I
added code to capture the pointer returned by buffer_data() so that I
could free it later.
3. I added code to free a number of growing_buffers, jsonObjects,
and dynamically allocated buffers that were otherwise leaking. In
some cases I had to juggle some extra pointers so that I could
distinguish between things I could delete and things I couldn't. In
other cases I rearranged operations so that the freeing wouldn't get
bypassed. I don't guarantee that I have plugged all the leaks.
4. Whenever possible I replaced buffer_data() with buffer_release(),
to eliminate a round of malloc() and free(). In some cases this
change enabled me to eliminate an intermediate variable.
5. Whenever possible I replaced jsonObjectGetKey() with
jsonObjectGetKeyConst(). Sometimes I had to juggle an extra pointer
or two in order to distinguish between what was const and what wasn't.
6. I applied the const qualifier to a number of local variables and
function parameters.
7. Here and there I changed double leading underscores to single
leading underscores.
git-svn-id: svn://svn.open-ils.org/ILS/trunk@8123
dcc99617-32d9-48b4-a31d-
7c20da2025e4