Groonga 3.0.9 Source Code Document
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
groonga
lib
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
{
31
grn_db_obj
obj
;
32
grn_io
*
io
;
33
struct
grn_dat_header
*
header
;
34
uint32_t
file_id
;
35
grn_encoding
encoding
;
36
void
*
trie
;
37
void
*
old_trie
;
38
grn_obj
*
tokenizer
;
39
grn_obj
*
normalizer
;
40
grn_critical_section
lock
;
41
};
42
43
struct
grn_dat_header
{
44
uint32_t
flags
;
45
grn_encoding
encoding
;
46
grn_id
tokenizer
;
47
uint32_t
file_id
;
48
grn_id
normalizer
;
49
uint32_t
reserved
[235];
50
};
51
52
struct
_grn_dat_cursor
{
53
grn_db_obj
obj
;
54
grn_dat
*
dat
;
55
void
*
cursor
;
56
const
void
*
key
;
57
grn_id
curr_rec
;
58
};
59
60
typedef
struct
_grn_dat_scan_hit
grn_dat_scan_hit
;
61
62
struct
_grn_dat_scan_hit
{
63
grn_id
id
;
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);
71
GRN_API
grn_id
grn_dat_lcp_search
(
grn_ctx
*ctx,
grn_dat
*dat,
72
const
void
*key,
unsigned
int
key_size);
73
74
GRN_API
grn_id
grn_dat_curr_id
(
grn_ctx
*ctx,
grn_dat
*dat);
75
76
/*
77
Currently, grn_dat_truncate() is available if the grn_dat object is
78
associated with a file.
79
*/
80
GRN_API
grn_rc
grn_dat_truncate
(
grn_ctx
*ctx,
grn_dat
*dat);
81
82
GRN_API
const
char
*
_grn_dat_key
(
grn_ctx
*ctx,
grn_dat
*dat,
grn_id
id
,
83
uint32_t *key_size);
84
GRN_API
grn_id
grn_dat_next
(
grn_ctx
*ctx,
grn_dat
*dat,
grn_id
id
);
85
GRN_API
grn_id
grn_dat_at
(
grn_ctx
*ctx,
grn_dat
*dat,
grn_id
id
);
86
87
GRN_API
grn_rc
grn_dat_clear_status_flags
(
grn_ctx
*ctx,
grn_dat
*dat);
88
89
/*
90
Currently, grn_dat_repair() is available if the grn_dat object is associated
91
with a file.
92
*/
93
GRN_API
grn_rc
grn_dat_repair
(
grn_ctx
*ctx,
grn_dat
*dat);
94
95
#ifdef __cplusplus
96
}
97
#endif
98
99
#endif
/* GRN_DAT_H */
Generated on Sun Nov 10 2013 09:49:02 for Groonga 3.0.9 Source Code Document by
1.8.1.2