Building a custom database in C with/without SQL?
You many want to look into using the Sphinx Search tools.

It allows you to create a MySQL instance that runs on port 9036 and only stores indexing info along with keys into real MySQL databases/tables.

There is a third party MySQL Storage Engine called SphinxSE.

Theoretically, the keys can you store in Sphinx do not have to be for MySQL. They could be for any DBMS. Sphinx is just a good key store that is built for FULLTEXT indexing.

Now, if you need to access the Sphinx DB using C/C++, then you need CodeBase.