upscaledb  2.2.1
upscaledb_uqi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2017 Christoph Rupp (chris@crupp.de).
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * See the file COPYING for License information.
17  */
18 
28 #ifndef UPS_UPSCALEDB_UQI_H
29 #define UPS_UPSCALEDB_UQI_H
30 
31 #include <ups/upscaledb.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
40 struct uqi_result_t;
41 typedef struct uqi_result_t uqi_result_t;
42 
48 
54 
60 
66 
72 
81 
90 
100 
109 uqi_result_initialize(uqi_result_t *result, int key_type, int record_type);
110 
125  const void *key_data, uint32_t key_size,
126  const void *record_data, uint32_t record_size);
127 
132 uqi_result_move(uqi_result_t *destination, uqi_result_t *source);
133 
134 
147 typedef void *(*uqi_plugin_init_function)(int flags, int key_type,
148  uint32_t key_size, int record_type, uint32_t record_size,
149  const char *reserved);
150 
152 #define UQI_STREAM_KEY 1
153 
155 #define UQI_STREAM_RECORD 2
156 
158 typedef void (*uqi_plugin_cleanup_function)(void *state);
159 
161 typedef void (*uqi_plugin_aggregate_single_function)(void *state,
162  const void *key_data, uint32_t key_size,
163  const void *record_data, uint32_t record_size);
164 
166 typedef void (*uqi_plugin_aggregate_many_function)(void *state,
167  const void *key_data_list, const void *record_data_list,
168  size_t list_length);
169 
174 typedef int (*uqi_plugin_predicate_function)(void *state,
175  const void *key_data, uint32_t key_size,
176  const void *record_data, uint32_t record_size);
177 
179 typedef void (*uqi_plugin_result_function)(void *state, uqi_result_t *result);
180 
182 #define UQI_PLUGIN_PREDICATE 1
183 
185 #define UQI_PLUGIN_AGGREGATE 2
186 
188 #define UQI_PLUGIN_REQUIRE_BOTH_STREAMS 1
189 
219 typedef struct {
221  const char *name;
222 
228 
236 
239 
242 
245 
251 
257 
263 
266 
267 } uqi_plugin_t;
268 
269 
283 uqi_register_plugin(uqi_plugin_t *descriptor);
284 
300 uqi_select(ups_env_t *env, const char *query, uqi_result_t **result);
301 
356 uqi_select_range(ups_env_t *env, const char *query, ups_cursor_t *begin,
357  const ups_cursor_t *end, uqi_result_t **result);
358 
363 #ifdef __cplusplus
364 } // extern "C"
365 #endif
366 
367 #endif /* UPS_UPSCALEDB_UQI_H */
UPS_EXPORT uint32_t UPS_CALLCONV uqi_result_get_record_type(uqi_result_t *result)
void *(* uqi_plugin_init_function)(int flags, int key_type, uint32_t key_size, int record_type, uint32_t record_size, const char *reserved)
uqi_plugin_aggregate_many_function agg_many
uint32_t flags
uqi_plugin_predicate_function pred
uint32_t type
UPS_EXPORT void UPS_CALLCONV uqi_result_get_key(uqi_result_t *result, uint32_t row, ups_key_t *key)
void(* uqi_plugin_cleanup_function)(void *state)
UPS_EXPORT void UPS_CALLCONV uqi_result_add_row(uqi_result_t *result, const void *key_data, uint32_t key_size, const void *record_data, uint32_t record_size)
int(* uqi_plugin_predicate_function)(void *state, const void *key_data, uint32_t key_size, const void *record_data, uint32_t record_size)
UPS_EXPORT void *UPS_CALLCONV uqi_result_get_record_data(uqi_result_t *result, uint32_t *size)
UPS_EXPORT ups_status_t UPS_CALLCONV uqi_select(ups_env_t *env, const char *query, uqi_result_t **result)
uqi_plugin_cleanup_function cleanup
unsigned int uint32_t
Definition: msstdint.h:85
UPS_EXPORT void UPS_CALLCONV uqi_result_get_record(uqi_result_t *result, uint32_t row, ups_record_t *record)
UPS_EXPORT void UPS_CALLCONV uqi_result_close(uqi_result_t *result)
Include file for upscaledb embedded database.
uqi_plugin_aggregate_single_function agg_single
uqi_plugin_init_function init
void(* uqi_plugin_aggregate_many_function)(void *state, const void *key_data_list, const void *record_data_list, size_t list_length)
struct ups_cursor_t ups_cursor_t
Definition: upscaledb.h:177
UPS_EXPORT uint32_t UPS_CALLCONV uqi_result_get_row_count(uqi_result_t *result)
#define UPS_CALLCONV
Definition: types.h:98
uqi_plugin_result_function results
void(* uqi_plugin_aggregate_single_function)(void *state, const void *key_data, uint32_t key_size, const void *record_data, uint32_t record_size)
UPS_EXPORT void UPS_CALLCONV uqi_result_move(uqi_result_t *destination, uqi_result_t *source)
UPS_EXPORT uint32_t UPS_CALLCONV uqi_result_get_key_type(uqi_result_t *result)
UPS_EXPORT ups_status_t UPS_CALLCONV uqi_select_range(ups_env_t *env, const char *query, ups_cursor_t *begin, const ups_cursor_t *end, uqi_result_t **result)
UPS_EXPORT void *UPS_CALLCONV uqi_result_get_key_data(uqi_result_t *result, uint32_t *size)
struct uqi_result_t uqi_result_t
Definition: upscaledb_uqi.h:41
UPS_EXPORT ups_status_t UPS_CALLCONV uqi_register_plugin(uqi_plugin_t *descriptor)
void(* uqi_plugin_result_function)(void *state, uqi_result_t *result)
#define UPS_EXPORT
Definition: types.h:90
const char * name
int ups_status_t
Definition: types.h:139
UPS_EXPORT void UPS_CALLCONV uqi_result_initialize(uqi_result_t *result, int key_type, int record_type)
uint32_t plugin_version
struct ups_env_t ups_env_t
Definition: upscaledb.h:165