Skip to content

Commit

Permalink
(libretrodb) Add headers and cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Mar 21, 2016
1 parent 6f8a1e8 commit 12e51eb
Show file tree
Hide file tree
Showing 15 changed files with 330 additions and 55 deletions.
29 changes: 15 additions & 14 deletions libretro-db/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DEBUG = 0
LIBRETRODB_DIR := .
LIBRETRO_COMMON_DIR := ../libretro-common
INCFLAGS = -I. -I$(LIBRETRO_COMMON_DIR)/include

Expand All @@ -14,12 +15,12 @@ LIBRETRO_COMMON_C = \
$(LIBRETRO_COMMON_DIR)/streams/file_stream.c

C_CONVERTER_C = \
rmsgpack.c \
rmsgpack_dom.c \
libretrodb.c \
bintree.c \
query.c \
c_converter.c \
$(LIBRETRODB_DIR)/rmsgpack.c \
$(LIBRETRODB_DIR)/rmsgpack_dom.c \
$(LIBRETRODB_DIR)/libretrodb.c \
$(LIBRETRODB_DIR)/bintree.c \
$(LIBRETRODB_DIR)/query.c \
$(LIBRETRODB_DIR)/c_converter.c \
$(LIBRETRO_COMMON_DIR)/hash/rhash.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_fnmatch.c \
$(LIBRETRO_COMMON_C) \
Expand All @@ -28,21 +29,21 @@ C_CONVERTER_C = \
C_CONVERTER_OBJS := $(C_CONVERTER_C:.c=.o)

RARCHDB_TOOL_C = \
rmsgpack.c \
rmsgpack_dom.c \
libretrodb_tool.c \
bintree.c \
query.c \
libretrodb.c \
$(LIBRETRODB_DIR)/rmsgpack.c \
$(LIBRETRODB_DIR)/rmsgpack_dom.c \
$(LIBRETRODB_DIR)/libretrodb_tool.c \
$(LIBRETRODB_DIR)/bintree.c \
$(LIBRETRODB_DIR)/query.c \
$(LIBRETRODB_DIR)/libretrodb.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_fnmatch.c \
$(LIBRETRO_COMMON_C) \
$(LIBRETRO_COMMON_DIR)/compat/compat_strl.c

RARCHDB_TOOL_OBJS := $(RARCHDB_TOOL_C:.c=.o)

RMSGPACK_C = \
rmsgpack.c \
rmsgpack_test.c \
$(LIBRETRODB_DIR)/rmsgpack.c \
$(LIBRETRODB_DIR)/rmsgpack_test.c \
$(LIBRETRO_COMMON_C)

RMSGPACK_OBJS := $(RMSGPACK_C:.c=.o)
Expand Down
22 changes: 22 additions & 0 deletions libretro-db/bintree.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (bintree.c).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
Expand Down
26 changes: 24 additions & 2 deletions libretro-db/bintree.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
#ifndef __RARCHDB_BINTREE_H__
#define __RARCHDB_BINTREE_H__
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (bintree.h).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef __LIBRETRODB_BINTREE_H__
#define __LIBRETRODB_BINTREE_H__

#ifdef __cplusplus
extern "C" {
Expand Down
22 changes: 22 additions & 0 deletions libretro-db/c_converter.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (c_converter.c).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
Expand Down
21 changes: 21 additions & 0 deletions libretro-db/libretrodb.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (libretrodb.c).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#include <stdio.h>
#include <sys/types.h>
Expand Down
22 changes: 22 additions & 0 deletions libretro-db/libretrodb.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (libretrodb.h).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef __LIBRETRODB_H__
#define __LIBRETRODB_H__

Expand Down
22 changes: 22 additions & 0 deletions libretro-db/libretrodb_tool.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (libretrodb_tool.c).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#include <stdio.h>
#include <string.h>

Expand Down
55 changes: 28 additions & 27 deletions libretro-db/Makefile.lua → libretro-db/lua/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
DEBUG = 0
LIBRETRO_COMMON_DIR := ../libretro-common
INCFLAGS = -I. -I$(LIBRETRO_COMMON_DIR)/include
LIBRETRODB_DIR := ../
LIBRETRO_COMMON_DIR := ../../libretro-common
INCFLAGS = -I. -I$(LIBRETRODB_DIR) -I$(LIBRETRO_COMMON_DIR)/include

TARGETS = rmsgpack_test libretrodb_tool lua_converter

Expand All @@ -11,49 +12,49 @@ CFLAGS = -g -O2 -Wall -DNDEBUG
endif

LUA_CONVERTER_C = \
rmsgpack.c \
rmsgpack_dom.c \
lua/lua_common.c \
libretrodb.c \
bintree.c \
query.c \
lua/lua_converter.c \
$(LIBRETRODB_DIR)/rmsgpack.c \
$(LIBRETRODB_DIR)/rmsgpack_dom.c \
lua_common.c \
$(LIBRETRODB_DIR)/libretrodb.c \
$(LIBRETRODB_DIR)/bintree.c \
$(LIBRETRODB_DIR)/query.c \
lua_converter.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_fnmatch.c \
$(LIBRETRO_COMMON_DIR)/file/retro_file.c \
$(LIBRETRO_COMMON_DIR)/streams/file_stream.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_strl.c

LUA_CONVERTER_OBJS := $(LUA_CONVERTER_C:.c=.o)

RARCHDB_TOOL_C = \
rmsgpack.c \
rmsgpack_dom.c \
libretrodb_tool.c \
bintree.c \
query.c \
libretrodb.c \
$(LIBRETRODB_DIR)/rmsgpack.c \
$(LIBRETRODB_DIR)/rmsgpack_dom.c \
$(LIBRETRODB_DIR)/libretrodb_tool.c \
$(LIBRETRODB_DIR)/bintree.c \
$(LIBRETRODB_DIR)/query.c \
($LIBRETRODB_DIR)/libretrodb.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_fnmatch.c \
$(LIBRETRO_COMMON_DIR)/file/retro_file.c \
$(LIBRETRO_COMMON_DIR)/streams/file_stream.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_strl.c

RARCHDB_TOOL_OBJS := $(RARCHDB_TOOL_C:.c=.o)

TESTLIB_C = \
lua/testlib.c \
query.c \
libretrodb.c \
bintree.c \
rmsgpack.c \
rmsgpack_dom.c \
testlib.c \
$(LIBRETRODB_DIR)/query.c \
($LIBRETRODB_DIR)/libretrodb.c \
$(LIBRETRODB_DIR)/bintree.c \
$(LIBRETRODB_DIR)/rmsgpack.c \
$(LIBRETRODB_DIR)/rmsgpack_dom.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_fnmatch.c \
$(LIBRETRO_COMMON_DIR)/file/retro_file.c \
$(LIBRETRO_COMMON_DIR)/streams/file_stream.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_strl.c

TESTLIB_OBJS := $(TESTLIB_C:.c=.o)

RMSGPACK_C = \
rmsgpack.c \
rmsgpack_test.c \
$(LIBRETRO_COMMON_DIR)/file/retro_file.c
$(LIBRETRODB_DIR)/rmsgpack.c \
$(LIBRETRODB_DIR)/rmsgpack_test.c \
$(LIBRETRO_COMMON_DIR)/streams/file_stream.c

RMSGPACK_OBJS := $(RMSGPACK_C:.c=.o)

Expand Down
22 changes: 22 additions & 0 deletions libretro-db/query.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (query.c).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#ifdef _WIN32
#include <direct.h>
#else
Expand Down
22 changes: 22 additions & 0 deletions libretro-db/query.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (query.h).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef __LIBRETRODB_QUERY_H__
#define __LIBRETRODB_QUERY_H__

Expand Down
26 changes: 18 additions & 8 deletions libretro-db/rmsgpack.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
/*
* An almost complete implementation of msgpack by
* Saggi Mizrahi <[email protected]>
/* Copyright (C) 2010-2016 The RetroArch team
*
* TODO:
* - float types
* - ext types
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (rmsgpack.c).
* ---------------------------------------------------------------------------------------
*
* For more information http://msgpack.org/
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/


#include <stdlib.h>
#ifdef _WIN32
#include <direct.h>
Expand Down
Loading

0 comments on commit 12e51eb

Please sign in to comment.