RetroArch/rarchdb
2015-01-09 17:55:56 +01:00
..
.ycm_extra_conf.py Add rarchdb 2014-12-30 21:02:15 +01:00
bintree.c (RarchDB) Some build fixes for XDK 360 2014-12-31 14:37:28 +01:00
bintree.h Add rarchdb 2014-12-30 21:02:15 +01:00
dat_converter Update rarchdb 2015-01-07 18:34:37 +01:00
dat_converter.c Add rarchdb 2014-12-30 21:02:15 +01:00
dat_converter.lua Update rarchdb 2015-01-07 18:34:37 +01:00
db_parser.c Add rarchdb 2014-12-30 21:02:15 +01:00
db_parser.h Add rarchdb 2014-12-30 21:02:15 +01:00
lua_converter.c Update rarchdb 2015-01-07 18:34:37 +01:00
Makefile Update rarchdb 2015-01-07 18:34:37 +01:00
mkdb.sh Add rarchdb 2014-12-30 21:02:15 +01:00
rarchdb_endian.h Move SWAP16 to retro_endianness.h 2014-12-30 21:49:45 +01:00
rarchdb_tool.c Add rarchdb 2014-12-30 21:02:15 +01:00
rarchdb.c (rarchdb) Silence some warnings 2015-01-09 17:55:56 +01:00
rarchdb.h (rarchdb.h) Fix 'no previous prototype for function' warning 2014-12-31 10:42:58 +01:00
README.md Update rarchdb 2015-01-07 18:34:37 +01:00
rmsgpack_dom.c (rarchdb) Silence some warnings 2015-01-09 17:55:56 +01:00
rmsgpack_dom.h Add rarchdb 2014-12-30 21:02:15 +01:00
rmsgpack_test.c Add rarchdb 2014-12-30 21:02:15 +01:00
rmsgpack.c (rarchdb) Silence some warnings 2015-01-09 17:55:56 +01:00
rmsgpack.h Add rarchdb 2014-12-30 21:02:15 +01:00

rarchdb

A small read only database Mainly to be used by retroarch

Usage

To convert a dat file use dat_converter <dat file> <db file>

To list out the content of a db rarchdb_tool <db file> list To create an index rarchdb_tool <db file> create-index <index name> <field name> To find an entry with an index rarchdb_tool <db file> find <index name> <value>

The util mkdb.sh <dat file> <db file> will create a db file with indexes for crc sha1 and md5

lua converters

In order to write you own converter you must have a lua file that implements the following functions:

-- this function gets called before the db is created and shuold validate the
-- arguments and set up the ground for db insertion
function init(...)
	local args = {...}
	local script_name = args[1]
end

-- this is in iterator function. It is called before each insert.
-- the function should return a table for insertion or nil when there are no
-- more records to insert.
function get_value()
	return {
		key = "value", -- will be saved as string
		num = 3, -- will be saved as int
		bin = binary("some string"), -- will be saved as binary
		unum = uint(3), -- will be saved as uint
		some_bool = true, -- will be saved as bool
	}
end