| 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_ANALYSIS_TOKEN | ||
| 28 | #define H_LUCY_ANALYSIS_TOKEN 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_TOKEN | ||
| 46 | extern uint32_t lucy_Token_IVARS_OFFSET; | ||
| 47 | typedef struct lucy_TokenIVARS lucy_TokenIVARS; | ||
| 48 | static CFISH_INLINE lucy_TokenIVARS* | ||
| 49 | lucy_Token_IVARS(lucy_Token *self) { | ||
| 50 | char *ptr = (char*)self + lucy_Token_IVARS_OFFSET; | ||
| 51 | return (lucy_TokenIVARS*)ptr; | ||
| 52 | } | ||
| 53 | #ifdef LUCY_USE_SHORT_NAMES | ||
| 54 | #define TokenIVARS lucy_TokenIVARS | ||
| 55 | #define Token_IVARS lucy_Token_IVARS | ||
| 56 | #endif | ||
| 57 | |||
| 58 | struct lucy_TokenIVARS { | ||
| 59 | char* text; | ||
| 60 | size_t len; | ||
| 61 | uint32_t start_offset; | ||
| 62 | uint32_t end_offset; | ||
| 63 | float boost; | ||
| 64 | int32_t pos_inc; | ||
| 65 | int32_t pos; | ||
| 66 | }; | ||
| 67 | |||
| 68 | #endif /* C_LUCY_TOKEN */ | ||
| 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_Token* | ||
| 80 | lucy_Token_new(const char* text, size_t len, uint32_t start_offset, uint32_t end_offset, float boost, int32_t pos_inc); | ||
| 81 | |||
| 82 | LUCY_VISIBLE lucy_Token* | ||
| 83 | lucy_Token_init(lucy_Token* self, const char* text, size_t len, uint32_t start_offset, uint32_t end_offset, float boost, int32_t pos_inc); | ||
| 84 | |||
| 85 | LUCY_VISIBLE int | ||
| 86 | lucy_Token_compare(const void* va, const void* vb); | ||
| 87 | |||
| 88 | uint32_t | ||
| 89 | LUCY_Token_Get_Start_Offset_IMP(lucy_Token* self); | ||
| 90 | |||
| 91 | uint32_t | ||
| 92 | LUCY_Token_Get_End_Offset_IMP(lucy_Token* self); | ||
| 93 | |||
| 94 | float | ||
| 95 | LUCY_Token_Get_Boost_IMP(lucy_Token* self); | ||
| 96 | |||
| 97 | int32_t | ||
| 98 | LUCY_Token_Get_Pos_Inc_IMP(lucy_Token* self); | ||
| 99 | |||
| 100 | int32_t | ||
| 101 | LUCY_Token_Get_Pos_IMP(lucy_Token* self); | ||
| 102 | |||
| 103 | char* | ||
| 104 | LUCY_Token_Get_Text_IMP(lucy_Token* self); | ||
| 105 | |||
| 106 | size_t | ||
| 107 | LUCY_Token_Get_Len_IMP(lucy_Token* self); | ||
| 108 | |||
| 109 | void | ||
| 110 | LUCY_Token_Set_Text_IMP(lucy_Token* self, char* text, size_t len); | ||
| 111 | |||
| 112 | void | ||
| 113 | LUCY_Token_Destroy_IMP(lucy_Token* self); | ||
| 114 | |||
| 115 | |||
| 116 | |||
| 117 | /* Define typedefs for each dynamic method, allowing us to cast generic | ||
| 118 | * pointers to the appropriate function pointer type more cleanly. | ||
| 119 | */ | ||
| 120 | |||
| 121 | typedef void* | ||
| 122 | (*LUCY_Token_To_Host_t)(lucy_Token* self, void* vcache); | ||
| 123 | |||
| 124 | typedef cfish_Obj* | ||
| 125 | (*LUCY_Token_Clone_t)(lucy_Token* self); | ||
| 126 | |||
| 127 | typedef bool | ||
| 128 | (*LUCY_Token_Equals_t)(lucy_Token* self, cfish_Obj* other); | ||
| 129 | |||
| 130 | typedef int32_t | ||
| 131 | (*LUCY_Token_Compare_To_t)(lucy_Token* self, cfish_Obj* other); | ||
| 132 | |||
| 133 | typedef void | ||
| 134 | (*LUCY_Token_Destroy_t)(lucy_Token* self); | ||
| 135 | |||
| 136 | typedef cfish_String* | ||
| 137 | (*LUCY_Token_To_String_t)(lucy_Token* self); | ||
| 138 | |||
| 139 | typedef uint32_t | ||
| 140 | (*LUCY_Token_Get_Start_Offset_t)(lucy_Token* self); | ||
| 141 | |||
| 142 | typedef uint32_t | ||
| 143 | (*LUCY_Token_Get_End_Offset_t)(lucy_Token* self); | ||
| 144 | |||
| 145 | typedef float | ||
| 146 | (*LUCY_Token_Get_Boost_t)(lucy_Token* self); | ||
| 147 | |||
| 148 | typedef int32_t | ||
| 149 | (*LUCY_Token_Get_Pos_Inc_t)(lucy_Token* self); | ||
| 150 | |||
| 151 | typedef int32_t | ||
| 152 | (*LUCY_Token_Get_Pos_t)(lucy_Token* self); | ||
| 153 | |||
| 154 | typedef char* | ||
| 155 | (*LUCY_Token_Get_Text_t)(lucy_Token* self); | ||
| 156 | |||
| 157 | typedef size_t | ||
| 158 | (*LUCY_Token_Get_Len_t)(lucy_Token* self); | ||
| 159 | |||
| 160 | typedef void | ||
| 161 | (*LUCY_Token_Set_Text_t)(lucy_Token* self, char* text, size_t len); | ||
| 162 | |||
| 163 | |||
| 164 | |||
| 165 | /* Define type-safe wrappers for inert functions of Obj. | ||
| 166 | */ | ||
| 167 | |||
| 168 | static CFISH_INLINE cfish_Class* | ||
| 169 | lucy_Token_get_class(lucy_Token *self) { | ||
| 170 | return cfish_Obj_get_class((cfish_Obj*)self); | ||
| 171 | } | ||
| 172 | |||
| 173 | static CFISH_INLINE cfish_String* | ||
| 174 | lucy_Token_get_class_name(lucy_Token *self) { | ||
| 175 | return cfish_Obj_get_class_name((cfish_Obj*)self); | ||
| 176 | } | ||
| 177 | |||
| 178 | static CFISH_INLINE bool | ||
| 179 | lucy_Token_is_a(lucy_Token *self, cfish_Class *ancestor) { | ||
| 180 | return cfish_Obj_is_a((cfish_Obj*)self, ancestor); | ||
| 181 | } | ||
| 182 | |||
| 183 | |||
| 184 | /* Define the inline functions which implement this class's virtual methods. | ||
| 185 | */ | ||
| 186 | |||
| 187 | extern LUCY_VISIBLE uint32_t LUCY_Token_To_Host_OFFSET; | ||
| 188 | static CFISH_INLINE void* | ||
| 189 | LUCY_Token_To_Host(lucy_Token* self, void* vcache) { | ||
| 190 | const LUCY_Token_To_Host_t method = (LUCY_Token_To_Host_t)cfish_obj_method(self, LUCY_Token_To_Host_OFFSET); | ||
| 191 | return method(self, vcache); | ||
| 192 | } | ||
| 193 | |||
| 194 | extern LUCY_VISIBLE uint32_t LUCY_Token_Clone_OFFSET; | ||
| 195 | static CFISH_INLINE cfish_Obj* | ||
| 196 | LUCY_Token_Clone(lucy_Token* self) { | ||
| 197 | const LUCY_Token_Clone_t method = (LUCY_Token_Clone_t)cfish_obj_method(self, LUCY_Token_Clone_OFFSET); | ||
| 198 | return method(self); | ||
| 199 | } | ||
| 200 | |||
| 201 | extern LUCY_VISIBLE uint32_t LUCY_Token_Equals_OFFSET; | ||
| 202 | static CFISH_INLINE bool | ||
| 203 | LUCY_Token_Equals(lucy_Token* self, cfish_Obj* other) { | ||
| 204 | const LUCY_Token_Equals_t method = (LUCY_Token_Equals_t)cfish_obj_method(self, LUCY_Token_Equals_OFFSET); | ||
| 205 | return method(self, other); | ||
| 206 | } | ||
| 207 | |||
| 208 | extern LUCY_VISIBLE uint32_t LUCY_Token_Compare_To_OFFSET; | ||
| 209 | static CFISH_INLINE int32_t | ||
| 210 | LUCY_Token_Compare_To(lucy_Token* self, cfish_Obj* other) { | ||
| 211 | const LUCY_Token_Compare_To_t method = (LUCY_Token_Compare_To_t)cfish_obj_method(self, LUCY_Token_Compare_To_OFFSET); | ||
| 212 | return method(self, other); | ||
| 213 | } | ||
| 214 | |||
| 215 | extern LUCY_VISIBLE uint32_t LUCY_Token_Destroy_OFFSET; | ||
| 216 | static CFISH_INLINE void | ||
| 217 | LUCY_Token_Destroy(lucy_Token* self) { | ||
| 218 | const LUCY_Token_Destroy_t method = (LUCY_Token_Destroy_t)cfish_obj_method(self, LUCY_Token_Destroy_OFFSET); | ||
| 219 | method(self); | ||
| 220 | } | ||
| 221 | |||
| 222 | extern LUCY_VISIBLE uint32_t LUCY_Token_To_String_OFFSET; | ||
| 223 | static CFISH_INLINE cfish_String* | ||
| 224 | LUCY_Token_To_String(lucy_Token* self) { | ||
| 225 | const LUCY_Token_To_String_t method = (LUCY_Token_To_String_t)cfish_obj_method(self, LUCY_Token_To_String_OFFSET); | ||
| 226 | return method(self); | ||
| 227 | } | ||
| 228 | |||
| 229 | extern LUCY_VISIBLE uint32_t LUCY_Token_Get_Start_Offset_OFFSET; | ||
| 230 | static CFISH_INLINE uint32_t | ||
| 231 | LUCY_Token_Get_Start_Offset(lucy_Token* self) { | ||
| 232 | const LUCY_Token_Get_Start_Offset_t method = (LUCY_Token_Get_Start_Offset_t)cfish_obj_method(self, LUCY_Token_Get_Start_Offset_OFFSET); | ||
| 233 | return method(self); | ||
| 234 | } | ||
| 235 | |||
| 236 | extern LUCY_VISIBLE uint32_t LUCY_Token_Get_End_Offset_OFFSET; | ||
| 237 | static CFISH_INLINE uint32_t | ||
| 238 | LUCY_Token_Get_End_Offset(lucy_Token* self) { | ||
| 239 | const LUCY_Token_Get_End_Offset_t method = (LUCY_Token_Get_End_Offset_t)cfish_obj_method(self, LUCY_Token_Get_End_Offset_OFFSET); | ||
| 240 | return method(self); | ||
| 241 | } | ||
| 242 | |||
| 243 | extern LUCY_VISIBLE uint32_t LUCY_Token_Get_Boost_OFFSET; | ||
| 244 | static CFISH_INLINE float | ||
| 245 | LUCY_Token_Get_Boost(lucy_Token* self) { | ||
| 246 | const LUCY_Token_Get_Boost_t method = (LUCY_Token_Get_Boost_t)cfish_obj_method(self, LUCY_Token_Get_Boost_OFFSET); | ||
| 247 | return method(self); | ||
| 248 | } | ||
| 249 | |||
| 250 | extern LUCY_VISIBLE uint32_t LUCY_Token_Get_Pos_Inc_OFFSET; | ||
| 251 | static CFISH_INLINE int32_t | ||
| 252 | LUCY_Token_Get_Pos_Inc(lucy_Token* self) { | ||
| 253 | const LUCY_Token_Get_Pos_Inc_t method = (LUCY_Token_Get_Pos_Inc_t)cfish_obj_method(self, LUCY_Token_Get_Pos_Inc_OFFSET); | ||
| 254 | return method(self); | ||
| 255 | } | ||
| 256 | |||
| 257 | extern LUCY_VISIBLE uint32_t LUCY_Token_Get_Pos_OFFSET; | ||
| 258 | static CFISH_INLINE int32_t | ||
| 259 | LUCY_Token_Get_Pos(lucy_Token* self) { | ||
| 260 | const LUCY_Token_Get_Pos_t method = (LUCY_Token_Get_Pos_t)cfish_obj_method(self, LUCY_Token_Get_Pos_OFFSET); | ||
| 261 | return method(self); | ||
| 262 | } | ||
| 263 | |||
| 264 | extern LUCY_VISIBLE uint32_t LUCY_Token_Get_Text_OFFSET; | ||
| 265 | static CFISH_INLINE char* | ||
| 266 | 64 | LUCY_Token_Get_Text(lucy_Token* self) { | |
| 267 | 64 | const LUCY_Token_Get_Text_t method = (LUCY_Token_Get_Text_t)cfish_obj_method(self, LUCY_Token_Get_Text_OFFSET); | |
| 268 | 64 | return method(self); | |
| 269 | } | ||
| 270 | |||
| 271 | extern LUCY_VISIBLE uint32_t LUCY_Token_Get_Len_OFFSET; | ||
| 272 | static CFISH_INLINE size_t | ||
| 273 | 64 | LUCY_Token_Get_Len(lucy_Token* self) { | |
| 274 | 64 | const LUCY_Token_Get_Len_t method = (LUCY_Token_Get_Len_t)cfish_obj_method(self, LUCY_Token_Get_Len_OFFSET); | |
| 275 | 64 | return method(self); | |
| 276 | } | ||
| 277 | |||
| 278 | extern LUCY_VISIBLE uint32_t LUCY_Token_Set_Text_OFFSET; | ||
| 279 | static CFISH_INLINE void | ||
| 280 | 0 | LUCY_Token_Set_Text(lucy_Token* self, char* text, size_t len) { | |
| 281 | 0 | const LUCY_Token_Set_Text_t method = (LUCY_Token_Set_Text_t)cfish_obj_method(self, LUCY_Token_Set_Text_OFFSET); | |
| 282 | 0 | method(self, text, len); | |
| 283 | 0 | } | |
| 284 | |||
| 285 | |||
| 286 | |||
| 287 | /* Declare callbacks for wrapping host overrides. | ||
| 288 | */ | ||
| 289 | |||
| 290 | #ifdef CFISH_NO_DYNAMIC_OVERRIDES | ||
| 291 | #define Lucy_Token_Get_Start_Offset_OVERRIDE NULL | ||
| 292 | #define Lucy_Token_Get_End_Offset_OVERRIDE NULL | ||
| 293 | #define Lucy_Token_Get_Boost_OVERRIDE NULL | ||
| 294 | #define Lucy_Token_Get_Pos_Inc_OVERRIDE NULL | ||
| 295 | #define Lucy_Token_Get_Pos_OVERRIDE NULL | ||
| 296 | #define Lucy_Token_Get_Text_OVERRIDE NULL | ||
| 297 | #define Lucy_Token_Get_Len_OVERRIDE NULL | ||
| 298 | #define Lucy_Token_Set_Text_OVERRIDE NULL | ||
| 299 | #else | ||
| 300 | uint32_t | ||
| 301 | Lucy_Token_Get_Start_Offset_OVERRIDE(lucy_Token* self); | ||
| 302 | uint32_t | ||
| 303 | Lucy_Token_Get_End_Offset_OVERRIDE(lucy_Token* self); | ||
| 304 | float | ||
| 305 | Lucy_Token_Get_Boost_OVERRIDE(lucy_Token* self); | ||
| 306 | int32_t | ||
| 307 | Lucy_Token_Get_Pos_Inc_OVERRIDE(lucy_Token* self); | ||
| 308 | int32_t | ||
| 309 | Lucy_Token_Get_Pos_OVERRIDE(lucy_Token* self); | ||
| 310 | char* | ||
| 311 | Lucy_Token_Get_Text_OVERRIDE(lucy_Token* self); | ||
| 312 | size_t | ||
| 313 | Lucy_Token_Get_Len_OVERRIDE(lucy_Token* self); | ||
| 314 | void | ||
| 315 | Lucy_Token_Set_Text_OVERRIDE(lucy_Token* self, char* text, size_t len); | ||
| 316 | #endif | ||
| 317 | |||
| 318 | |||
| 319 | /* Define "short names" for this class's symbols. | ||
| 320 | */ | ||
| 321 | |||
| 322 | #ifdef LUCY_USE_SHORT_NAMES | ||
| 323 | #define Token lucy_Token | ||
| 324 | #define TOKEN LUCY_TOKEN | ||
| 325 | #define Token_new lucy_Token_new | ||
| 326 | #define Token_init lucy_Token_init | ||
| 327 | #define Token_compare lucy_Token_compare | ||
| 328 | #define Token_get_class lucy_Token_get_class | ||
| 329 | #define Token_get_class_name lucy_Token_get_class_name | ||
| 330 | #define Token_is_a lucy_Token_is_a | ||
| 331 | #define Token_Get_Start_Offset_IMP LUCY_Token_Get_Start_Offset_IMP | ||
| 332 | #define Token_Get_End_Offset_IMP LUCY_Token_Get_End_Offset_IMP | ||
| 333 | #define Token_Get_Boost_IMP LUCY_Token_Get_Boost_IMP | ||
| 334 | #define Token_Get_Pos_Inc_IMP LUCY_Token_Get_Pos_Inc_IMP | ||
| 335 | #define Token_Get_Pos_IMP LUCY_Token_Get_Pos_IMP | ||
| 336 | #define Token_Get_Text_IMP LUCY_Token_Get_Text_IMP | ||
| 337 | #define Token_Get_Len_IMP LUCY_Token_Get_Len_IMP | ||
| 338 | #define Token_Set_Text_IMP LUCY_Token_Set_Text_IMP | ||
| 339 | #define Token_Destroy_IMP LUCY_Token_Destroy_IMP | ||
| 340 | #define Token_To_Host LUCY_Token_To_Host | ||
| 341 | #define Token_To_Host_t LUCY_Token_To_Host_t | ||
| 342 | #define Token_Clone LUCY_Token_Clone | ||
| 343 | #define Token_Clone_t LUCY_Token_Clone_t | ||
| 344 | #define Token_Equals LUCY_Token_Equals | ||
| 345 | #define Token_Equals_t LUCY_Token_Equals_t | ||
| 346 | #define Token_Compare_To LUCY_Token_Compare_To | ||
| 347 | #define Token_Compare_To_t LUCY_Token_Compare_To_t | ||
| 348 | #define Token_Destroy LUCY_Token_Destroy | ||
| 349 | #define Token_Destroy_t LUCY_Token_Destroy_t | ||
| 350 | #define Token_To_String LUCY_Token_To_String | ||
| 351 | #define Token_To_String_t LUCY_Token_To_String_t | ||
| 352 | #define Token_Get_Start_Offset LUCY_Token_Get_Start_Offset | ||
| 353 | #define Token_Get_Start_Offset_t LUCY_Token_Get_Start_Offset_t | ||
| 354 | #define Token_Get_End_Offset LUCY_Token_Get_End_Offset | ||
| 355 | #define Token_Get_End_Offset_t LUCY_Token_Get_End_Offset_t | ||
| 356 | #define Token_Get_Boost LUCY_Token_Get_Boost | ||
| 357 | #define Token_Get_Boost_t LUCY_Token_Get_Boost_t | ||
| 358 | #define Token_Get_Pos_Inc LUCY_Token_Get_Pos_Inc | ||
| 359 | #define Token_Get_Pos_Inc_t LUCY_Token_Get_Pos_Inc_t | ||
| 360 | #define Token_Get_Pos LUCY_Token_Get_Pos | ||
| 361 | #define Token_Get_Pos_t LUCY_Token_Get_Pos_t | ||
| 362 | #define Token_Get_Text LUCY_Token_Get_Text | ||
| 363 | #define Token_Get_Text_t LUCY_Token_Get_Text_t | ||
| 364 | #define Token_Get_Len LUCY_Token_Get_Len | ||
| 365 | #define Token_Get_Len_t LUCY_Token_Get_Len_t | ||
| 366 | #define Token_Set_Text LUCY_Token_Set_Text | ||
| 367 | #define Token_Set_Text_t LUCY_Token_Set_Text_t | ||
| 368 | #endif /* LUCY_USE_SHORT_NAMES */ | ||
| 369 | |||
| 370 | |||
| 371 | |||
| 372 | |||
| 373 | |||
| 374 | #ifdef __cplusplus | ||
| 375 | } | ||
| 376 | #endif | ||
| 377 | |||
| 378 | #endif /* H_LUCY_ANALYSIS_TOKEN */ | ||
| 379 | |||
| 380 | |||
| 381 | |||
| 382 |