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
pat.h
Go to the documentation of this file.
1
/* -*- c-basic-offset: 2 -*- */
2
/* Copyright(C) 2009 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_PAT_H
18
#define GRN_PAT_H
19
20
#ifndef GROONGA_IN_H
21
#include "
groonga_in.h
"
22
#endif
/* GROONGA_IN_H */
23
24
#include "
db.h
"
25
#include "
hash.h
"
26
27
#ifdef __cplusplus
28
extern
"C"
{
29
#endif
30
31
#define GRN_PAT_MAX_KEY_SIZE GRN_TABLE_MAX_KEY_SIZE
32
33
struct
_grn_pat
{
34
grn_db_obj
obj
;
35
grn_io
*
io
;
36
struct
grn_pat_header
*
header
;
37
grn_encoding
encoding
;
38
uint32_t
key_size
;
39
uint32_t
value_size
;
40
grn_obj
*
tokenizer
;
41
grn_obj
*
normalizer
;
42
grn_id
*
cache
;
43
uint32_t
cache_size
;
44
};
45
46
#define GRN_PAT_NDELINFOS 0x100
47
48
typedef
struct
{
49
grn_id
d
;
50
grn_id
ld
;
51
uint32_t
stat
;
52
uint32_t
shared
;
53
}
grn_pat_delinfo
;
54
55
struct
grn_pat_header
{
56
uint32_t
flags
;
57
grn_encoding
encoding
;
58
uint32_t
key_size
;
59
uint32_t
value_size
;
60
grn_id
tokenizer
;
61
uint32_t
n_entries
;
62
uint32_t
curr_rec
;
63
int32_t
curr_key
;
64
int32_t
curr_del
;
65
int32_t
curr_del2
;
66
int32_t
curr_del3
;
67
uint32_t
n_garbages
;
68
grn_id
normalizer
;
69
uint32_t
reserved
[1004];
70
grn_pat_delinfo
delinfos
[
GRN_PAT_NDELINFOS
];
71
grn_id
garbages
[
GRN_PAT_MAX_KEY_SIZE
+ 1];
72
};
73
74
struct
_grn_pat_cursor_entry
{
75
grn_id
id
;
76
uint16_t
check
;
77
};
78
79
typedef
struct
_grn_pat_cursor_entry
grn_pat_cursor_entry
;
80
81
struct
_grn_pat_cursor
{
82
grn_db_obj
obj
;
83
grn_id
curr_rec
;
84
grn_pat
*
pat
;
85
grn_ctx
*
ctx
;
86
unsigned
int
size
;
87
unsigned
int
sp
;
88
grn_id
tail
;
89
unsigned
int
rest
;
90
grn_pat_cursor_entry
*
ss
;
91
uint8_t
curr_key
[
GRN_TABLE_MAX_KEY_SIZE
];
92
};
93
94
GRN_API
grn_id
grn_pat_curr_id
(
grn_ctx
*ctx,
grn_pat
*pat);
95
96
/* private */
97
GRN_API
grn_rc
grn_pat_truncate
(
grn_ctx
*ctx,
grn_pat
*pat);
98
const
char
*
_grn_pat_key
(
grn_ctx
*ctx,
grn_pat
*pat,
grn_id
id
, uint32_t *key_size);
99
grn_id
grn_pat_next
(
grn_ctx
*ctx,
grn_pat
*pat,
grn_id
id
);
100
const
char
*
grn_pat_get_value_
(
grn_ctx
*ctx,
grn_pat
*pat,
grn_id
id
, uint32_t *size);
101
GRN_API
grn_id
grn_pat_at
(
grn_ctx
*ctx,
grn_pat
*pat,
grn_id
id
);
102
void
grn_pat_check
(
grn_ctx
*ctx,
grn_pat
*pat);
103
void
grn_pat_inspect_nodes
(
grn_ctx
*ctx,
grn_pat
*pat,
grn_obj
*buf);
104
void
grn_pat_cursor_inspect
(
grn_ctx
*ctx,
grn_pat_cursor
*c,
grn_obj
*buf);
105
106
grn_rc
grn_pat_cache_enable
(
grn_ctx
*ctx,
grn_pat
*pat, uint32_t cache_size);
107
void
grn_pat_cache_disable
(
grn_ctx
*ctx,
grn_pat
*pat);
108
109
#ifdef __cplusplus
110
}
111
#endif
112
113
#endif
/* GRN_PAT_H */
Generated on Sun Nov 10 2013 09:49:03 for Groonga 3.0.9 Source Code Document by
1.8.1.2