RetroArch
libretrodb.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2017 The RetroArch team
2  *
3  * ---------------------------------------------------------------------------------------
4  * The following license statement only applies to this file (libretrodb.h).
5  * ---------------------------------------------------------------------------------------
6  *
7  * Permission is hereby granted, free of charge,
8  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation the rights to
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef __LIBRETRODB_H__
24 #define __LIBRETRODB_H__
25 
26 #include <stdint.h>
27 #ifdef _WIN32
28 #include <direct.h>
29 #else
30 #include <unistd.h>
31 #endif
32 
33 #include <retro_common_api.h>
34 
35 #include "query.h"
36 #include "rmsgpack_dom.h"
37 
39 
40 typedef struct libretrodb libretrodb_t;
41 
43 
45 
46 typedef int (*libretrodb_value_provider)(void *ctx, struct rmsgpack_dom_value *out);
47 
49 
51 
52 int libretrodb_open(const char *path, libretrodb_t *db);
53 
54 int libretrodb_create_index(libretrodb_t *db, const char *name,
55  const char *field_name);
56 
57 int libretrodb_find_entry(libretrodb_t *db, const char *index_name,
58  const void *key, struct rmsgpack_dom_value *out);
59 
61 
63 
65 
67 
79  libretrodb_cursor_t *cursor,
81 
91 
99 
100 void *libretrodb_query_compile(libretrodb_t *db, const char *query,
101  size_t buff_len, const char **error);
102 
103 void libretrodb_query_free(void *q);
104 
106  struct rmsgpack_dom_value *out);
107 
109 
110 #endif
libretrodb_cursor_t * libretrodb_cursor_new(void)
Definition: libretrodb.c:592
GLuint const GLchar * name
Definition: glext.h:6671
void libretrodb_free(libretrodb_t *db)
Definition: libretrodb.c:621
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
void libretrodb_cursor_close(libretrodb_cursor_t *cursor)
Definition: libretrodb.c:410
GLsizei const GLchar ** path
Definition: glext.h:7901
Definition: libretrodb.c:55
void * libretrodb_query_compile(libretrodb_t *db, const char *query, size_t buff_len, const char **error)
Definition: query.c:922
int libretrodb_create_index(libretrodb_t *db, const char *name, const char *field_name)
Definition: libretrodb.c:485
void libretrodb_query_free(void *q)
Definition: query.c:904
int libretrodb_cursor_open(libretrodb_t *db, libretrodb_cursor_t *cursor, libretrodb_query_t *query)
Definition: libretrodb.c:438
struct passwd out
Definition: missing_libc_functions.c:51
Definition: file_stream.c:53
int libretrodb_cursor_reset(libretrodb_cursor_t *cursor)
Definition: libretrodb.c:365
typedefRETRO_BEGIN_DECLS struct libretrodb_query libretrodb_query_t
Definition: query.h:33
static int value_provider(void *ctx, struct rmsgpack_dom_value *out)
Definition: lua_converter.c:44
AVFormatContext * ctx
Definition: record_ffmpeg.c:247
int libretrodb_open(const char *path, libretrodb_t *db)
Definition: libretrodb.c:217
static l_noret error(LoadState *S, const char *why)
Definition: lundump.c:39
Definition: libretrodb.c:82
GLdouble GLdouble GLdouble GLdouble q
Definition: glext.h:6414
Definition: libretrodb.c:64
int libretrodb_cursor_read_item(libretrodb_cursor_t *cursor, struct rmsgpack_dom_value *out)
Definition: libretrodb.c:373
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
Definition: rmsgpack_dom.h:45
typedefRETRO_BEGIN_DECLS struct libretrodb libretrodb_t
Definition: libretrodb.h:40
void libretrodb_close(libretrodb_t *db)
Definition: libretrodb.c:207
Definition: query.c:81
libretrodb_t * libretrodb_new(void)
Definition: libretrodb.c:611
int(* libretrodb_value_provider)(void *ctx, struct rmsgpack_dom_value *out)
Definition: libretrodb.h:46
int libretrodb_find_entry(libretrodb_t *db, const char *index_name, const void *key, struct rmsgpack_dom_value *out)
Definition: libretrodb.c:316
int libretrodb_create(RFILE *fd, libretrodb_value_provider value_provider, void *ctx)
Definition: libretrodb.c:138
void libretrodb_cursor_free(libretrodb_cursor_t *dbc)
Definition: libretrodb.c:603