This is untested, but I can't test it until I implement other
things first. I also need to do some refactoring, so I need to
commit and make a checkpoint now.
Consider this code as good as if didn't exist.
Looking at this page https://cryptopp.com/wiki/CMake#Using_the_library_in_other_projects
it seems to me there should be or there is going to be a system-wide
official FindCryptoPP module. Those changes should match the case convention
from that page... somewhat. I'm not going to do the cryptopp-shared thing.
So *if* that official module will ever become available on mainstream distros,
and *if* they start using proper names, this file should just be deleted
and everything should keep on working just fine.
This also fixes a subtle bug: the size passed to MaxSizedArray in
int_to_string() was calculated on the max value of type F, but when
F was a signed type the max would only be for example 31 bits.
Conversion of negative numbers would then fail with an assertion.
They are useful in the Redis backend and in helpers itself.
People wanting to use pq alone from this project will have to cope and
search for all the needed files.
Pass -DDINDEXER_ENABLED_BACKENDS="list,of,backends" to cmake to tell
which backends you want to be built. Currently available backends are
postgresql and redis. Default is postgresql.
Allowed strings in the comma separated list above are the names of the
directories in src/backends.
Note that the postgresql backend does something like
"select blah... where hash=$1 limit 1", so it only returns one match.
The SRANDMEMBER used in this implementation also returns one match,
but it's not deterministic I suppose.
This is helpful so when running dindexer in a dev environment you don't
need to list all the possible paths to every backend. Symlinks to all
backends will all be in the same place.