Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 {
38  uint32_t key_size;
39  uint32_t value_size;
43  uint32_t cache_size;
44 };
45 
46 #define GRN_PAT_NDELINFOS 0x100
47 
48 typedef struct {
51  uint32_t stat;
52  uint32_t shared;
54 
56  uint32_t flags;
58  uint32_t key_size;
59  uint32_t value_size;
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;
69  uint32_t reserved[1004];
72 };
73 
76  uint16_t check;
77 };
78 
80 
86  unsigned int size;
87  unsigned int sp;
89  unsigned int rest;
92 };
93 
95 
96 /* private */
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);
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);
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 */