Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
dat.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 2 -*- */
2 /* Copyright(C) 2011 Brazil
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License version 2.1 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Lesser General Public License for more details.
12 
13  You should have received a copy of the GNU Lesser General Public
14  License along with this library; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 #ifndef GRN_DAT_H
18 #define GRN_DAT_H
19 
20 #ifndef GROONGA_IN_H
21 # include "groonga_in.h"
22 #endif /* GROONGA_IN_H */
23 
24 #include "db.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct _grn_dat {
34  uint32_t file_id;
36  void *trie;
37  void *old_trie;
40  grn_critical_section lock;
41 };
42 
44  uint32_t flags;
47  uint32_t file_id;
49  uint32_t reserved[235];
50 };
51 
55  void *cursor;
56  const void *key;
58 };
59 
61 
64  unsigned int offset;
65  unsigned int length;
66 };
67 
68 GRN_API int grn_dat_scan(grn_ctx *ctx, grn_dat *dat, const char *str,
69  unsigned int str_size, grn_dat_scan_hit *scan_hits,
70  unsigned int max_num_scan_hits, const char **str_rest);
72  const void *key, unsigned int key_size);
73 
75 
76 /*
77  Currently, grn_dat_truncate() is available if the grn_dat object is
78  associated with a file.
79  */
81 
82 GRN_API const char *_grn_dat_key(grn_ctx *ctx, grn_dat *dat, grn_id id,
83  uint32_t *key_size);
86 
88 
89 /*
90  Currently, grn_dat_repair() is available if the grn_dat object is associated
91  with a file.
92  */
94 
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 #endif /* GRN_DAT_H */