| 1 | /* | ||
| 2 | * *********************************************** | ||
| 3 | * | ||
| 4 | * !!!! DO NOT EDIT !!!! | ||
| 5 | * | ||
| 6 | * This file was auto-generated by Build.PL. | ||
| 7 | * | ||
| 8 | * *********************************************** | ||
| 9 | * | ||
| 10 | * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| 11 | * contributor license agreements. See the NOTICE file distributed with | ||
| 12 | * this work for additional information regarding copyright ownership. | ||
| 13 | * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| 14 | * (the "License"); you may not use this file except in compliance with | ||
| 15 | * the License. You may obtain a copy of the License at | ||
| 16 | * | ||
| 17 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 18 | * | ||
| 19 | * Unless required by applicable law or agreed to in writing, software | ||
| 20 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 22 | * See the License for the specific language governing permissions and | ||
| 23 | * limitations under the License. | ||
| 24 | */ | ||
| 25 | |||
| 26 | |||
| 27 | #ifndef H_LUCY_SIMPLE | ||
| 28 | #define H_LUCY_SIMPLE 1 | ||
| 29 | |||
| 30 | |||
| 31 | #ifdef __cplusplus | ||
| 32 | extern "C" { | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #include "lucy_parcel.h" | ||
| 36 | |||
| 37 | /* Include the header for this class's parent. | ||
| 38 | */ | ||
| 39 | |||
| 40 | #include "Clownfish/Obj.h" | ||
| 41 | |||
| 42 | /* Define the struct layout for instances of this class. | ||
| 43 | */ | ||
| 44 | |||
| 45 | #ifdef C_LUCY_SIMPLE | ||
| 46 | extern uint32_t lucy_Simple_IVARS_OFFSET; | ||
| 47 | typedef struct lucy_SimpleIVARS lucy_SimpleIVARS; | ||
| 48 | static CFISH_INLINE lucy_SimpleIVARS* | ||
| 49 | lucy_Simple_IVARS(lucy_Simple *self) { | ||
| 50 | char *ptr = (char*)self + lucy_Simple_IVARS_OFFSET; | ||
| 51 | return (lucy_SimpleIVARS*)ptr; | ||
| 52 | } | ||
| 53 | #ifdef LUCY_USE_SHORT_NAMES | ||
| 54 | #define SimpleIVARS lucy_SimpleIVARS | ||
| 55 | #define Simple_IVARS lucy_Simple_IVARS | ||
| 56 | #endif | ||
| 57 | |||
| 58 | struct lucy_SimpleIVARS { | ||
| 59 | cfish_Obj* index; | ||
| 60 | cfish_String* language; | ||
| 61 | lucy_Schema* schema; | ||
| 62 | lucy_FieldType* type; | ||
| 63 | lucy_Indexer* indexer; | ||
| 64 | lucy_IndexSearcher* searcher; | ||
| 65 | lucy_Hits* hits; | ||
| 66 | }; | ||
| 67 | |||
| 68 | #endif /* C_LUCY_SIMPLE */ | ||
| 69 | |||
| 70 | /* Declare this class's inert variables. | ||
| 71 | */ | ||
| 72 | |||
| 73 | |||
| 74 | |||
| 75 | /* Declare both this class's inert functions and the C functions which | ||
| 76 | * implement this class's dynamic methods. | ||
| 77 | */ | ||
| 78 | |||
| 79 | LUCY_VISIBLE lucy_Simple* | ||
| 80 | lucy_Simple_new(cfish_Obj* path, cfish_String* language); | ||
| 81 | |||
| 82 | LUCY_VISIBLE lucy_Simple* | ||
| 83 | lucy_Simple_init(lucy_Simple* self, cfish_Obj* path, cfish_String* language); | ||
| 84 | |||
| 85 | void | ||
| 86 | LUCY_Simple_Add_Doc_IMP(lucy_Simple* self, lucy_Doc* doc); | ||
| 87 | |||
| 88 | uint32_t | ||
| 89 | LUCY_Simple_Search_IMP(lucy_Simple* self, cfish_String* query, uint32_t offset, uint32_t num_wanted, lucy_SortSpec* sort_spec); | ||
| 90 | |||
| 91 | lucy_HitDoc* | ||
| 92 | LUCY_Simple_Next_IMP(lucy_Simple* self); | ||
| 93 | |||
| 94 | lucy_Indexer* | ||
| 95 | LUCY_Simple_Get_Indexer_IMP(lucy_Simple* self); | ||
| 96 | |||
| 97 | lucy_Hits* | ||
| 98 | LUCY_Simple_Get_Hits_IMP(lucy_Simple* self); | ||
| 99 | |||
| 100 | void | ||
| 101 | LUCY_Simple_Finish_Indexing_IMP(lucy_Simple* self); | ||
| 102 | |||
| 103 | void | ||
| 104 | LUCY_Simple_Destroy_IMP(lucy_Simple* self); | ||
| 105 | |||
| 106 | |||
| 107 | |||
| 108 | /* Define typedefs for each dynamic method, allowing us to cast generic | ||
| 109 | * pointers to the appropriate function pointer type more cleanly. | ||
| 110 | */ | ||
| 111 | |||
| 112 | typedef void* | ||
| 113 | (*LUCY_Simple_To_Host_t)(lucy_Simple* self, void* vcache); | ||
| 114 | |||
| 115 | typedef cfish_Obj* | ||
| 116 | (*LUCY_Simple_Clone_t)(lucy_Simple* self); | ||
| 117 | |||
| 118 | typedef bool | ||
| 119 | (*LUCY_Simple_Equals_t)(lucy_Simple* self, cfish_Obj* other); | ||
| 120 | |||
| 121 | typedef int32_t | ||
| 122 | (*LUCY_Simple_Compare_To_t)(lucy_Simple* self, cfish_Obj* other); | ||
| 123 | |||
| 124 | typedef void | ||
| 125 | (*LUCY_Simple_Destroy_t)(lucy_Simple* self); | ||
| 126 | |||
| 127 | typedef cfish_String* | ||
| 128 | (*LUCY_Simple_To_String_t)(lucy_Simple* self); | ||
| 129 | |||
| 130 | typedef void | ||
| 131 | (*LUCY_Simple_Add_Doc_t)(lucy_Simple* self, lucy_Doc* doc); | ||
| 132 | |||
| 133 | typedef uint32_t | ||
| 134 | (*LUCY_Simple_Search_t)(lucy_Simple* self, cfish_String* query, uint32_t offset, uint32_t num_wanted, lucy_SortSpec* sort_spec); | ||
| 135 | |||
| 136 | typedef lucy_HitDoc* | ||
| 137 | (*LUCY_Simple_Next_t)(lucy_Simple* self); | ||
| 138 | |||
| 139 | typedef lucy_Indexer* | ||
| 140 | (*LUCY_Simple_Get_Indexer_t)(lucy_Simple* self); | ||
| 141 | |||
| 142 | typedef lucy_Hits* | ||
| 143 | (*LUCY_Simple_Get_Hits_t)(lucy_Simple* self); | ||
| 144 | |||
| 145 | typedef void | ||
| 146 | (*LUCY_Simple_Finish_Indexing_t)(lucy_Simple* self); | ||
| 147 | |||
| 148 | |||
| 149 | |||
| 150 | /* Define type-safe wrappers for inert functions of Obj. | ||
| 151 | */ | ||
| 152 | |||
| 153 | static CFISH_INLINE cfish_Class* | ||
| 154 | lucy_Simple_get_class(lucy_Simple *self) { | ||
| 155 | return cfish_Obj_get_class((cfish_Obj*)self); | ||
| 156 | } | ||
| 157 | |||
| 158 | static CFISH_INLINE cfish_String* | ||
| 159 | lucy_Simple_get_class_name(lucy_Simple *self) { | ||
| 160 | return cfish_Obj_get_class_name((cfish_Obj*)self); | ||
| 161 | } | ||
| 162 | |||
| 163 | static CFISH_INLINE bool | ||
| 164 | lucy_Simple_is_a(lucy_Simple *self, cfish_Class *ancestor) { | ||
| 165 | return cfish_Obj_is_a((cfish_Obj*)self, ancestor); | ||
| 166 | } | ||
| 167 | |||
| 168 | |||
| 169 | /* Define the inline functions which implement this class's virtual methods. | ||
| 170 | */ | ||
| 171 | |||
| 172 | extern LUCY_VISIBLE uint32_t LUCY_Simple_To_Host_OFFSET; | ||
| 173 | static CFISH_INLINE void* | ||
| 174 | LUCY_Simple_To_Host(lucy_Simple* self, void* vcache) { | ||
| 175 | const LUCY_Simple_To_Host_t method = (LUCY_Simple_To_Host_t)cfish_obj_method(self, LUCY_Simple_To_Host_OFFSET); | ||
| 176 | return method(self, vcache); | ||
| 177 | } | ||
| 178 | |||
| 179 | extern LUCY_VISIBLE uint32_t LUCY_Simple_Clone_OFFSET; | ||
| 180 | static CFISH_INLINE cfish_Obj* | ||
| 181 | LUCY_Simple_Clone(lucy_Simple* self) { | ||
| 182 | const LUCY_Simple_Clone_t method = (LUCY_Simple_Clone_t)cfish_obj_method(self, LUCY_Simple_Clone_OFFSET); | ||
| 183 | return method(self); | ||
| 184 | } | ||
| 185 | |||
| 186 | extern LUCY_VISIBLE uint32_t LUCY_Simple_Equals_OFFSET; | ||
| 187 | static CFISH_INLINE bool | ||
| 188 | LUCY_Simple_Equals(lucy_Simple* self, cfish_Obj* other) { | ||
| 189 | const LUCY_Simple_Equals_t method = (LUCY_Simple_Equals_t)cfish_obj_method(self, LUCY_Simple_Equals_OFFSET); | ||
| 190 | return method(self, other); | ||
| 191 | } | ||
| 192 | |||
| 193 | extern LUCY_VISIBLE uint32_t LUCY_Simple_Compare_To_OFFSET; | ||
| 194 | static CFISH_INLINE int32_t | ||
| 195 | LUCY_Simple_Compare_To(lucy_Simple* self, cfish_Obj* other) { | ||
| 196 | const LUCY_Simple_Compare_To_t method = (LUCY_Simple_Compare_To_t)cfish_obj_method(self, LUCY_Simple_Compare_To_OFFSET); | ||
| 197 | return method(self, other); | ||
| 198 | } | ||
| 199 | |||
| 200 | extern LUCY_VISIBLE uint32_t LUCY_Simple_Destroy_OFFSET; | ||
| 201 | static CFISH_INLINE void | ||
| 202 | LUCY_Simple_Destroy(lucy_Simple* self) { | ||
| 203 | const LUCY_Simple_Destroy_t method = (LUCY_Simple_Destroy_t)cfish_obj_method(self, LUCY_Simple_Destroy_OFFSET); | ||
| 204 | method(self); | ||
| 205 | } | ||
| 206 | |||
| 207 | extern LUCY_VISIBLE uint32_t LUCY_Simple_To_String_OFFSET; | ||
| 208 | static CFISH_INLINE cfish_String* | ||
| 209 | LUCY_Simple_To_String(lucy_Simple* self) { | ||
| 210 | const LUCY_Simple_To_String_t method = (LUCY_Simple_To_String_t)cfish_obj_method(self, LUCY_Simple_To_String_OFFSET); | ||
| 211 | return method(self); | ||
| 212 | } | ||
| 213 | |||
| 214 | extern LUCY_VISIBLE uint32_t LUCY_Simple_Add_Doc_OFFSET; | ||
| 215 | static CFISH_INLINE void | ||
| 216 | 9 | LUCY_Simple_Add_Doc(lucy_Simple* self, lucy_Doc* doc) { | |
| 217 | 9 | const LUCY_Simple_Add_Doc_t method = (LUCY_Simple_Add_Doc_t)cfish_obj_method(self, LUCY_Simple_Add_Doc_OFFSET); | |
| 218 | 9 | method(self, doc); | |
| 219 | 9 | } | |
| 220 | |||
| 221 | extern LUCY_VISIBLE uint32_t LUCY_Simple_Search_OFFSET; | ||
| 222 | static CFISH_INLINE uint32_t | ||
| 223 | LUCY_Simple_Search(lucy_Simple* self, cfish_String* query, uint32_t offset, uint32_t num_wanted, lucy_SortSpec* sort_spec) { | ||
| 224 | const LUCY_Simple_Search_t method = (LUCY_Simple_Search_t)cfish_obj_method(self, LUCY_Simple_Search_OFFSET); | ||
| 225 | return method(self, query, offset, num_wanted, sort_spec); | ||
| 226 | } | ||
| 227 | |||
| 228 | extern LUCY_VISIBLE uint32_t LUCY_Simple_Next_OFFSET; | ||
| 229 | static CFISH_INLINE lucy_HitDoc* | ||
| 230 | LUCY_Simple_Next(lucy_Simple* self) { | ||
| 231 | const LUCY_Simple_Next_t method = (LUCY_Simple_Next_t)cfish_obj_method(self, LUCY_Simple_Next_OFFSET); | ||
| 232 | return method(self); | ||
| 233 | } | ||
| 234 | |||
| 235 | extern LUCY_VISIBLE uint32_t LUCY_Simple_Get_Indexer_OFFSET; | ||
| 236 | static CFISH_INLINE lucy_Indexer* | ||
| 237 | 9 | LUCY_Simple_Get_Indexer(lucy_Simple* self) { | |
| 238 | 9 | const LUCY_Simple_Get_Indexer_t method = (LUCY_Simple_Get_Indexer_t)cfish_obj_method(self, LUCY_Simple_Get_Indexer_OFFSET); | |
| 239 | 9 | return method(self); | |
| 240 | } | ||
| 241 | |||
| 242 | extern LUCY_VISIBLE uint32_t LUCY_Simple_Get_Hits_OFFSET; | ||
| 243 | static CFISH_INLINE lucy_Hits* | ||
| 244 | LUCY_Simple_Get_Hits(lucy_Simple* self) { | ||
| 245 | const LUCY_Simple_Get_Hits_t method = (LUCY_Simple_Get_Hits_t)cfish_obj_method(self, LUCY_Simple_Get_Hits_OFFSET); | ||
| 246 | return method(self); | ||
| 247 | } | ||
| 248 | |||
| 249 | extern LUCY_VISIBLE uint32_t LUCY_Simple_Finish_Indexing_OFFSET; | ||
| 250 | static CFISH_INLINE void | ||
| 251 | LUCY_Simple_Finish_Indexing(lucy_Simple* self) { | ||
| 252 | const LUCY_Simple_Finish_Indexing_t method = (LUCY_Simple_Finish_Indexing_t)cfish_obj_method(self, LUCY_Simple_Finish_Indexing_OFFSET); | ||
| 253 | method(self); | ||
| 254 | } | ||
| 255 | |||
| 256 | |||
| 257 | |||
| 258 | /* Declare callbacks for wrapping host overrides. | ||
| 259 | */ | ||
| 260 | |||
| 261 | #ifdef CFISH_NO_DYNAMIC_OVERRIDES | ||
| 262 | #define Lucy_Simple_Add_Doc_OVERRIDE NULL | ||
| 263 | #define Lucy_Simple_Search_OVERRIDE NULL | ||
| 264 | #define Lucy_Simple_Next_OVERRIDE NULL | ||
| 265 | #define Lucy_Simple_Get_Indexer_OVERRIDE NULL | ||
| 266 | #define Lucy_Simple_Get_Hits_OVERRIDE NULL | ||
| 267 | #define Lucy_Simple_Finish_Indexing_OVERRIDE NULL | ||
| 268 | #else | ||
| 269 | void | ||
| 270 | Lucy_Simple_Add_Doc_OVERRIDE(lucy_Simple* self, lucy_Doc* doc); | ||
| 271 | uint32_t | ||
| 272 | Lucy_Simple_Search_OVERRIDE(lucy_Simple* self, cfish_String* query, uint32_t offset, uint32_t num_wanted, lucy_SortSpec* sort_spec); | ||
| 273 | lucy_HitDoc* | ||
| 274 | Lucy_Simple_Next_OVERRIDE(lucy_Simple* self); | ||
| 275 | lucy_Indexer* | ||
| 276 | Lucy_Simple_Get_Indexer_OVERRIDE(lucy_Simple* self); | ||
| 277 | lucy_Hits* | ||
| 278 | Lucy_Simple_Get_Hits_OVERRIDE(lucy_Simple* self); | ||
| 279 | void | ||
| 280 | Lucy_Simple_Finish_Indexing_OVERRIDE(lucy_Simple* self); | ||
| 281 | #endif | ||
| 282 | |||
| 283 | |||
| 284 | /* Define "short names" for this class's symbols. | ||
| 285 | */ | ||
| 286 | |||
| 287 | #ifdef LUCY_USE_SHORT_NAMES | ||
| 288 | #define Simple lucy_Simple | ||
| 289 | #define SIMPLE LUCY_SIMPLE | ||
| 290 | #define Simple_new lucy_Simple_new | ||
| 291 | #define Simple_init lucy_Simple_init | ||
| 292 | #define Simple_get_class lucy_Simple_get_class | ||
| 293 | #define Simple_get_class_name lucy_Simple_get_class_name | ||
| 294 | #define Simple_is_a lucy_Simple_is_a | ||
| 295 | #define Simple_Add_Doc_IMP LUCY_Simple_Add_Doc_IMP | ||
| 296 | #define Simple_Search_IMP LUCY_Simple_Search_IMP | ||
| 297 | #define Simple_Next_IMP LUCY_Simple_Next_IMP | ||
| 298 | #define Simple_Get_Indexer_IMP LUCY_Simple_Get_Indexer_IMP | ||
| 299 | #define Simple_Get_Hits_IMP LUCY_Simple_Get_Hits_IMP | ||
| 300 | #define Simple_Finish_Indexing_IMP LUCY_Simple_Finish_Indexing_IMP | ||
| 301 | #define Simple_Destroy_IMP LUCY_Simple_Destroy_IMP | ||
| 302 | #define Simple_To_Host LUCY_Simple_To_Host | ||
| 303 | #define Simple_To_Host_t LUCY_Simple_To_Host_t | ||
| 304 | #define Simple_Clone LUCY_Simple_Clone | ||
| 305 | #define Simple_Clone_t LUCY_Simple_Clone_t | ||
| 306 | #define Simple_Equals LUCY_Simple_Equals | ||
| 307 | #define Simple_Equals_t LUCY_Simple_Equals_t | ||
| 308 | #define Simple_Compare_To LUCY_Simple_Compare_To | ||
| 309 | #define Simple_Compare_To_t LUCY_Simple_Compare_To_t | ||
| 310 | #define Simple_Destroy LUCY_Simple_Destroy | ||
| 311 | #define Simple_Destroy_t LUCY_Simple_Destroy_t | ||
| 312 | #define Simple_To_String LUCY_Simple_To_String | ||
| 313 | #define Simple_To_String_t LUCY_Simple_To_String_t | ||
| 314 | #define Simple_Add_Doc LUCY_Simple_Add_Doc | ||
| 315 | #define Simple_Add_Doc_t LUCY_Simple_Add_Doc_t | ||
| 316 | #define Simple_Search LUCY_Simple_Search | ||
| 317 | #define Simple_Search_t LUCY_Simple_Search_t | ||
| 318 | #define Simple_Next LUCY_Simple_Next | ||
| 319 | #define Simple_Next_t LUCY_Simple_Next_t | ||
| 320 | #define Simple_Get_Indexer LUCY_Simple_Get_Indexer | ||
| 321 | #define Simple_Get_Indexer_t LUCY_Simple_Get_Indexer_t | ||
| 322 | #define Simple_Get_Hits LUCY_Simple_Get_Hits | ||
| 323 | #define Simple_Get_Hits_t LUCY_Simple_Get_Hits_t | ||
| 324 | #define Simple_Finish_Indexing LUCY_Simple_Finish_Indexing | ||
| 325 | #define Simple_Finish_Indexing_t LUCY_Simple_Finish_Indexing_t | ||
| 326 | #endif /* LUCY_USE_SHORT_NAMES */ | ||
| 327 | |||
| 328 | |||
| 329 | |||
| 330 | |||
| 331 | |||
| 332 | #ifdef __cplusplus | ||
| 333 | } | ||
| 334 | #endif | ||
| 335 | |||
| 336 | #endif /* H_LUCY_SIMPLE */ | ||
| 337 | |||
| 338 | |||
| 339 | |||
| 340 |