| 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_STORE_INSTREAM | ||
| 28 | #define H_LUCY_STORE_INSTREAM 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_INSTREAM | ||
| 46 | extern uint32_t lucy_InStream_IVARS_OFFSET; | ||
| 47 | typedef struct lucy_InStreamIVARS lucy_InStreamIVARS; | ||
| 48 | static CFISH_INLINE lucy_InStreamIVARS* | ||
| 49 | lucy_InStream_IVARS(lucy_InStream *self) { | ||
| 50 | char *ptr = (char*)self + lucy_InStream_IVARS_OFFSET; | ||
| 51 | return (lucy_InStreamIVARS*)ptr; | ||
| 52 | } | ||
| 53 | #ifdef LUCY_USE_SHORT_NAMES | ||
| 54 | #define InStreamIVARS lucy_InStreamIVARS | ||
| 55 | #define InStream_IVARS lucy_InStream_IVARS | ||
| 56 | #endif | ||
| 57 | |||
| 58 | struct lucy_InStreamIVARS { | ||
| 59 | int64_t offset; | ||
| 60 | int64_t len; | ||
| 61 | const char* buf; | ||
| 62 | const char* limit; | ||
| 63 | cfish_String* filename; | ||
| 64 | lucy_FileHandle* file_handle; | ||
| 65 | lucy_FileWindow* window; | ||
| 66 | }; | ||
| 67 | |||
| 68 | #endif /* C_LUCY_INSTREAM */ | ||
| 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_InStream* | ||
| 80 | lucy_InStream_open(cfish_Obj* file); | ||
| 81 | |||
| 82 | LUCY_VISIBLE lucy_InStream* | ||
| 83 | lucy_InStream_do_open(lucy_InStream* self, cfish_Obj* file); | ||
| 84 | |||
| 85 | lucy_InStream* | ||
| 86 | LUCY_InStream_Reopen_IMP(lucy_InStream* self, cfish_String* filename, int64_t offset, int64_t len); | ||
| 87 | |||
| 88 | lucy_InStream* | ||
| 89 | LUCY_InStream_Clone_IMP(lucy_InStream* self); | ||
| 90 | |||
| 91 | void | ||
| 92 | LUCY_InStream_Close_IMP(lucy_InStream* self); | ||
| 93 | |||
| 94 | void | ||
| 95 | LUCY_InStream_Destroy_IMP(lucy_InStream* self); | ||
| 96 | |||
| 97 | void | ||
| 98 | LUCY_InStream_Seek_IMP(lucy_InStream* self, int64_t target); | ||
| 99 | |||
| 100 | int64_t | ||
| 101 | LUCY_InStream_Tell_IMP(lucy_InStream* self); | ||
| 102 | |||
| 103 | int64_t | ||
| 104 | LUCY_InStream_Length_IMP(lucy_InStream* self); | ||
| 105 | |||
| 106 | void | ||
| 107 | LUCY_InStream_Refill_IMP(lucy_InStream* self); | ||
| 108 | |||
| 109 | void | ||
| 110 | LUCY_InStream_Fill_IMP(lucy_InStream* self, int64_t amount); | ||
| 111 | |||
| 112 | const char* | ||
| 113 | LUCY_InStream_Buf_IMP(lucy_InStream* self, size_t request); | ||
| 114 | |||
| 115 | void | ||
| 116 | LUCY_InStream_Advance_Buf_IMP(lucy_InStream* self, const char* buf); | ||
| 117 | |||
| 118 | void | ||
| 119 | LUCY_InStream_Read_Bytes_IMP(lucy_InStream* self, char* buf, size_t len); | ||
| 120 | |||
| 121 | int8_t | ||
| 122 | LUCY_InStream_Read_I8_IMP(lucy_InStream* self); | ||
| 123 | |||
| 124 | uint8_t | ||
| 125 | LUCY_InStream_Read_U8_IMP(lucy_InStream* self); | ||
| 126 | |||
| 127 | int32_t | ||
| 128 | LUCY_InStream_Read_I32_IMP(lucy_InStream* self); | ||
| 129 | |||
| 130 | uint32_t | ||
| 131 | LUCY_InStream_Read_U32_IMP(lucy_InStream* self); | ||
| 132 | |||
| 133 | int64_t | ||
| 134 | LUCY_InStream_Read_I64_IMP(lucy_InStream* self); | ||
| 135 | |||
| 136 | uint64_t | ||
| 137 | LUCY_InStream_Read_U64_IMP(lucy_InStream* self); | ||
| 138 | |||
| 139 | float | ||
| 140 | LUCY_InStream_Read_F32_IMP(lucy_InStream* self); | ||
| 141 | |||
| 142 | double | ||
| 143 | LUCY_InStream_Read_F64_IMP(lucy_InStream* self); | ||
| 144 | |||
| 145 | int32_t | ||
| 146 | LUCY_InStream_Read_CI32_IMP(lucy_InStream* self); | ||
| 147 | |||
| 148 | uint32_t | ||
| 149 | LUCY_InStream_Read_CU32_IMP(lucy_InStream* self); | ||
| 150 | |||
| 151 | int64_t | ||
| 152 | LUCY_InStream_Read_CI64_IMP(lucy_InStream* self); | ||
| 153 | |||
| 154 | uint64_t | ||
| 155 | LUCY_InStream_Read_CU64_IMP(lucy_InStream* self); | ||
| 156 | |||
| 157 | int | ||
| 158 | LUCY_InStream_Read_Raw_C64_IMP(lucy_InStream* self, char* buf); | ||
| 159 | |||
| 160 | cfish_String* | ||
| 161 | LUCY_InStream_Get_Filename_IMP(lucy_InStream* self); | ||
| 162 | |||
| 163 | lucy_FileWindow* | ||
| 164 | LUCY_InStream_Get_Window_IMP(lucy_InStream* self); | ||
| 165 | |||
| 166 | lucy_FileHandle* | ||
| 167 | LUCY_InStream_Get_Handle_IMP(lucy_InStream* self); | ||
| 168 | |||
| 169 | int64_t | ||
| 170 | LUCY_InStream_Bytes_In_Buf_IMP(lucy_InStream* self); | ||
| 171 | |||
| 172 | |||
| 173 | |||
| 174 | /* Define typedefs for each dynamic method, allowing us to cast generic | ||
| 175 | * pointers to the appropriate function pointer type more cleanly. | ||
| 176 | */ | ||
| 177 | |||
| 178 | typedef void* | ||
| 179 | (*LUCY_InStream_To_Host_t)(lucy_InStream* self, void* vcache); | ||
| 180 | |||
| 181 | typedef lucy_InStream* | ||
| 182 | (*LUCY_InStream_Clone_t)(lucy_InStream* self); | ||
| 183 | |||
| 184 | typedef bool | ||
| 185 | (*LUCY_InStream_Equals_t)(lucy_InStream* self, cfish_Obj* other); | ||
| 186 | |||
| 187 | typedef int32_t | ||
| 188 | (*LUCY_InStream_Compare_To_t)(lucy_InStream* self, cfish_Obj* other); | ||
| 189 | |||
| 190 | typedef void | ||
| 191 | (*LUCY_InStream_Destroy_t)(lucy_InStream* self); | ||
| 192 | |||
| 193 | typedef cfish_String* | ||
| 194 | (*LUCY_InStream_To_String_t)(lucy_InStream* self); | ||
| 195 | |||
| 196 | typedef lucy_InStream* | ||
| 197 | (*LUCY_InStream_Reopen_t)(lucy_InStream* self, cfish_String* filename, int64_t offset, int64_t len); | ||
| 198 | |||
| 199 | typedef void | ||
| 200 | (*LUCY_InStream_Close_t)(lucy_InStream* self); | ||
| 201 | |||
| 202 | typedef void | ||
| 203 | (*LUCY_InStream_Seek_t)(lucy_InStream* self, int64_t target); | ||
| 204 | |||
| 205 | typedef int64_t | ||
| 206 | (*LUCY_InStream_Tell_t)(lucy_InStream* self); | ||
| 207 | |||
| 208 | typedef int64_t | ||
| 209 | (*LUCY_InStream_Length_t)(lucy_InStream* self); | ||
| 210 | |||
| 211 | typedef void | ||
| 212 | (*LUCY_InStream_Refill_t)(lucy_InStream* self); | ||
| 213 | |||
| 214 | typedef void | ||
| 215 | (*LUCY_InStream_Fill_t)(lucy_InStream* self, int64_t amount); | ||
| 216 | |||
| 217 | typedef const char* | ||
| 218 | (*LUCY_InStream_Buf_t)(lucy_InStream* self, size_t request); | ||
| 219 | |||
| 220 | typedef void | ||
| 221 | (*LUCY_InStream_Advance_Buf_t)(lucy_InStream* self, const char* buf); | ||
| 222 | |||
| 223 | typedef void | ||
| 224 | (*LUCY_InStream_Read_Bytes_t)(lucy_InStream* self, char* buf, size_t len); | ||
| 225 | |||
| 226 | typedef int8_t | ||
| 227 | (*LUCY_InStream_Read_I8_t)(lucy_InStream* self); | ||
| 228 | |||
| 229 | typedef uint8_t | ||
| 230 | (*LUCY_InStream_Read_U8_t)(lucy_InStream* self); | ||
| 231 | |||
| 232 | typedef int32_t | ||
| 233 | (*LUCY_InStream_Read_I32_t)(lucy_InStream* self); | ||
| 234 | |||
| 235 | typedef uint32_t | ||
| 236 | (*LUCY_InStream_Read_U32_t)(lucy_InStream* self); | ||
| 237 | |||
| 238 | typedef int64_t | ||
| 239 | (*LUCY_InStream_Read_I64_t)(lucy_InStream* self); | ||
| 240 | |||
| 241 | typedef uint64_t | ||
| 242 | (*LUCY_InStream_Read_U64_t)(lucy_InStream* self); | ||
| 243 | |||
| 244 | typedef float | ||
| 245 | (*LUCY_InStream_Read_F32_t)(lucy_InStream* self); | ||
| 246 | |||
| 247 | typedef double | ||
| 248 | (*LUCY_InStream_Read_F64_t)(lucy_InStream* self); | ||
| 249 | |||
| 250 | typedef int32_t | ||
| 251 | (*LUCY_InStream_Read_CI32_t)(lucy_InStream* self); | ||
| 252 | |||
| 253 | typedef uint32_t | ||
| 254 | (*LUCY_InStream_Read_CU32_t)(lucy_InStream* self); | ||
| 255 | |||
| 256 | typedef int64_t | ||
| 257 | (*LUCY_InStream_Read_CI64_t)(lucy_InStream* self); | ||
| 258 | |||
| 259 | typedef uint64_t | ||
| 260 | (*LUCY_InStream_Read_CU64_t)(lucy_InStream* self); | ||
| 261 | |||
| 262 | typedef int | ||
| 263 | (*LUCY_InStream_Read_Raw_C64_t)(lucy_InStream* self, char* buf); | ||
| 264 | |||
| 265 | typedef cfish_String* | ||
| 266 | (*LUCY_InStream_Get_Filename_t)(lucy_InStream* self); | ||
| 267 | |||
| 268 | typedef lucy_FileWindow* | ||
| 269 | (*LUCY_InStream_Get_Window_t)(lucy_InStream* self); | ||
| 270 | |||
| 271 | typedef lucy_FileHandle* | ||
| 272 | (*LUCY_InStream_Get_Handle_t)(lucy_InStream* self); | ||
| 273 | |||
| 274 | typedef int64_t | ||
| 275 | (*LUCY_InStream_Bytes_In_Buf_t)(lucy_InStream* self); | ||
| 276 | |||
| 277 | |||
| 278 | |||
| 279 | /* Define type-safe wrappers for inert functions of Obj. | ||
| 280 | */ | ||
| 281 | |||
| 282 | static CFISH_INLINE cfish_Class* | ||
| 283 | lucy_InStream_get_class(lucy_InStream *self) { | ||
| 284 | return cfish_Obj_get_class((cfish_Obj*)self); | ||
| 285 | } | ||
| 286 | |||
| 287 | static CFISH_INLINE cfish_String* | ||
| 288 | lucy_InStream_get_class_name(lucy_InStream *self) { | ||
| 289 | return cfish_Obj_get_class_name((cfish_Obj*)self); | ||
| 290 | } | ||
| 291 | |||
| 292 | static CFISH_INLINE bool | ||
| 293 | lucy_InStream_is_a(lucy_InStream *self, cfish_Class *ancestor) { | ||
| 294 | return cfish_Obj_is_a((cfish_Obj*)self, ancestor); | ||
| 295 | } | ||
| 296 | |||
| 297 | |||
| 298 | /* Define the inline functions which implement this class's virtual methods. | ||
| 299 | */ | ||
| 300 | |||
| 301 | extern LUCY_VISIBLE uint32_t LUCY_InStream_To_Host_OFFSET; | ||
| 302 | static CFISH_INLINE void* | ||
| 303 | LUCY_InStream_To_Host(lucy_InStream* self, void* vcache) { | ||
| 304 | const LUCY_InStream_To_Host_t method = (LUCY_InStream_To_Host_t)cfish_obj_method(self, LUCY_InStream_To_Host_OFFSET); | ||
| 305 | return method(self, vcache); | ||
| 306 | } | ||
| 307 | |||
| 308 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Clone_OFFSET; | ||
| 309 | static CFISH_INLINE lucy_InStream* | ||
| 310 | LUCY_InStream_Clone(lucy_InStream* self) { | ||
| 311 | const LUCY_InStream_Clone_t method = (LUCY_InStream_Clone_t)cfish_obj_method(self, LUCY_InStream_Clone_OFFSET); | ||
| 312 | return method(self); | ||
| 313 | } | ||
| 314 | |||
| 315 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Equals_OFFSET; | ||
| 316 | static CFISH_INLINE bool | ||
| 317 | LUCY_InStream_Equals(lucy_InStream* self, cfish_Obj* other) { | ||
| 318 | const LUCY_InStream_Equals_t method = (LUCY_InStream_Equals_t)cfish_obj_method(self, LUCY_InStream_Equals_OFFSET); | ||
| 319 | return method(self, other); | ||
| 320 | } | ||
| 321 | |||
| 322 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Compare_To_OFFSET; | ||
| 323 | static CFISH_INLINE int32_t | ||
| 324 | LUCY_InStream_Compare_To(lucy_InStream* self, cfish_Obj* other) { | ||
| 325 | const LUCY_InStream_Compare_To_t method = (LUCY_InStream_Compare_To_t)cfish_obj_method(self, LUCY_InStream_Compare_To_OFFSET); | ||
| 326 | return method(self, other); | ||
| 327 | } | ||
| 328 | |||
| 329 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Destroy_OFFSET; | ||
| 330 | static CFISH_INLINE void | ||
| 331 | LUCY_InStream_Destroy(lucy_InStream* self) { | ||
| 332 | const LUCY_InStream_Destroy_t method = (LUCY_InStream_Destroy_t)cfish_obj_method(self, LUCY_InStream_Destroy_OFFSET); | ||
| 333 | method(self); | ||
| 334 | } | ||
| 335 | |||
| 336 | extern LUCY_VISIBLE uint32_t LUCY_InStream_To_String_OFFSET; | ||
| 337 | static CFISH_INLINE cfish_String* | ||
| 338 | LUCY_InStream_To_String(lucy_InStream* self) { | ||
| 339 | const LUCY_InStream_To_String_t method = (LUCY_InStream_To_String_t)cfish_obj_method(self, LUCY_InStream_To_String_OFFSET); | ||
| 340 | return method(self); | ||
| 341 | } | ||
| 342 | |||
| 343 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Reopen_OFFSET; | ||
| 344 | static CFISH_INLINE lucy_InStream* | ||
| 345 | LUCY_InStream_Reopen(lucy_InStream* self, cfish_String* filename, int64_t offset, int64_t len) { | ||
| 346 | const LUCY_InStream_Reopen_t method = (LUCY_InStream_Reopen_t)cfish_obj_method(self, LUCY_InStream_Reopen_OFFSET); | ||
| 347 | return method(self, filename, offset, len); | ||
| 348 | } | ||
| 349 | |||
| 350 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Close_OFFSET; | ||
| 351 | static CFISH_INLINE void | ||
| 352 | LUCY_InStream_Close(lucy_InStream* self) { | ||
| 353 | const LUCY_InStream_Close_t method = (LUCY_InStream_Close_t)cfish_obj_method(self, LUCY_InStream_Close_OFFSET); | ||
| 354 | method(self); | ||
| 355 | } | ||
| 356 | |||
| 357 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Seek_OFFSET; | ||
| 358 | static CFISH_INLINE void | ||
| 359 | LUCY_InStream_Seek(lucy_InStream* self, int64_t target) { | ||
| 360 | #ifdef CFP_LUCY | ||
| 361 | LUCY_InStream_Seek_IMP(self, target); | ||
| 362 | #else | ||
| 363 | const LUCY_InStream_Seek_t method = (LUCY_InStream_Seek_t)cfish_obj_method(self, LUCY_InStream_Seek_OFFSET); | ||
| 364 | method(self, target); | ||
| 365 | #endif | ||
| 366 | } | ||
| 367 | |||
| 368 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Tell_OFFSET; | ||
| 369 | static CFISH_INLINE int64_t | ||
| 370 | LUCY_InStream_Tell(lucy_InStream* self) { | ||
| 371 | #ifdef CFP_LUCY | ||
| 372 | return LUCY_InStream_Tell_IMP(self); | ||
| 373 | #else | ||
| 374 | const LUCY_InStream_Tell_t method = (LUCY_InStream_Tell_t)cfish_obj_method(self, LUCY_InStream_Tell_OFFSET); | ||
| 375 | return method(self); | ||
| 376 | #endif | ||
| 377 | } | ||
| 378 | |||
| 379 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Length_OFFSET; | ||
| 380 | static CFISH_INLINE int64_t | ||
| 381 | LUCY_InStream_Length(lucy_InStream* self) { | ||
| 382 | #ifdef CFP_LUCY | ||
| 383 | return LUCY_InStream_Length_IMP(self); | ||
| 384 | #else | ||
| 385 | const LUCY_InStream_Length_t method = (LUCY_InStream_Length_t)cfish_obj_method(self, LUCY_InStream_Length_OFFSET); | ||
| 386 | return method(self); | ||
| 387 | #endif | ||
| 388 | } | ||
| 389 | |||
| 390 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Refill_OFFSET; | ||
| 391 | static CFISH_INLINE void | ||
| 392 | LUCY_InStream_Refill(lucy_InStream* self) { | ||
| 393 | const LUCY_InStream_Refill_t method = (LUCY_InStream_Refill_t)cfish_obj_method(self, LUCY_InStream_Refill_OFFSET); | ||
| 394 | method(self); | ||
| 395 | } | ||
| 396 | |||
| 397 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Fill_OFFSET; | ||
| 398 | static CFISH_INLINE void | ||
| 399 | LUCY_InStream_Fill(lucy_InStream* self, int64_t amount) { | ||
| 400 | const LUCY_InStream_Fill_t method = (LUCY_InStream_Fill_t)cfish_obj_method(self, LUCY_InStream_Fill_OFFSET); | ||
| 401 | method(self, amount); | ||
| 402 | } | ||
| 403 | |||
| 404 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Buf_OFFSET; | ||
| 405 | static CFISH_INLINE const char* | ||
| 406 | LUCY_InStream_Buf(lucy_InStream* self, size_t request) { | ||
| 407 | #ifdef CFP_LUCY | ||
| 408 | return LUCY_InStream_Buf_IMP(self, request); | ||
| 409 | #else | ||
| 410 | const LUCY_InStream_Buf_t method = (LUCY_InStream_Buf_t)cfish_obj_method(self, LUCY_InStream_Buf_OFFSET); | ||
| 411 | return method(self, request); | ||
| 412 | #endif | ||
| 413 | } | ||
| 414 | |||
| 415 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Advance_Buf_OFFSET; | ||
| 416 | static CFISH_INLINE void | ||
| 417 | LUCY_InStream_Advance_Buf(lucy_InStream* self, const char* buf) { | ||
| 418 | #ifdef CFP_LUCY | ||
| 419 | LUCY_InStream_Advance_Buf_IMP(self, buf); | ||
| 420 | #else | ||
| 421 | const LUCY_InStream_Advance_Buf_t method = (LUCY_InStream_Advance_Buf_t)cfish_obj_method(self, LUCY_InStream_Advance_Buf_OFFSET); | ||
| 422 | method(self, buf); | ||
| 423 | #endif | ||
| 424 | } | ||
| 425 | |||
| 426 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_Bytes_OFFSET; | ||
| 427 | static CFISH_INLINE void | ||
| 428 | 124 | LUCY_InStream_Read_Bytes(lucy_InStream* self, char* buf, size_t len) { | |
| 429 | #ifdef CFP_LUCY | ||
| 430 | 124 | LUCY_InStream_Read_Bytes_IMP(self, buf, len); | |
| 431 | #else | ||
| 432 | const LUCY_InStream_Read_Bytes_t method = (LUCY_InStream_Read_Bytes_t)cfish_obj_method(self, LUCY_InStream_Read_Bytes_OFFSET); | ||
| 433 | method(self, buf, len); | ||
| 434 | #endif | ||
| 435 | 122 | } | |
| 436 | |||
| 437 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_I8_OFFSET; | ||
| 438 | static CFISH_INLINE int8_t | ||
| 439 | LUCY_InStream_Read_I8(lucy_InStream* self) { | ||
| 440 | #ifdef CFP_LUCY | ||
| 441 | return LUCY_InStream_Read_I8_IMP(self); | ||
| 442 | #else | ||
| 443 | const LUCY_InStream_Read_I8_t method = (LUCY_InStream_Read_I8_t)cfish_obj_method(self, LUCY_InStream_Read_I8_OFFSET); | ||
| 444 | return method(self); | ||
| 445 | #endif | ||
| 446 | } | ||
| 447 | |||
| 448 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_U8_OFFSET; | ||
| 449 | static CFISH_INLINE uint8_t | ||
| 450 | LUCY_InStream_Read_U8(lucy_InStream* self) { | ||
| 451 | #ifdef CFP_LUCY | ||
| 452 | return LUCY_InStream_Read_U8_IMP(self); | ||
| 453 | #else | ||
| 454 | const LUCY_InStream_Read_U8_t method = (LUCY_InStream_Read_U8_t)cfish_obj_method(self, LUCY_InStream_Read_U8_OFFSET); | ||
| 455 | return method(self); | ||
| 456 | #endif | ||
| 457 | } | ||
| 458 | |||
| 459 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_I32_OFFSET; | ||
| 460 | static CFISH_INLINE int32_t | ||
| 461 | LUCY_InStream_Read_I32(lucy_InStream* self) { | ||
| 462 | #ifdef CFP_LUCY | ||
| 463 | return LUCY_InStream_Read_I32_IMP(self); | ||
| 464 | #else | ||
| 465 | const LUCY_InStream_Read_I32_t method = (LUCY_InStream_Read_I32_t)cfish_obj_method(self, LUCY_InStream_Read_I32_OFFSET); | ||
| 466 | return method(self); | ||
| 467 | #endif | ||
| 468 | } | ||
| 469 | |||
| 470 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_U32_OFFSET; | ||
| 471 | static CFISH_INLINE uint32_t | ||
| 472 | LUCY_InStream_Read_U32(lucy_InStream* self) { | ||
| 473 | #ifdef CFP_LUCY | ||
| 474 | return LUCY_InStream_Read_U32_IMP(self); | ||
| 475 | #else | ||
| 476 | const LUCY_InStream_Read_U32_t method = (LUCY_InStream_Read_U32_t)cfish_obj_method(self, LUCY_InStream_Read_U32_OFFSET); | ||
| 477 | return method(self); | ||
| 478 | #endif | ||
| 479 | } | ||
| 480 | |||
| 481 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_I64_OFFSET; | ||
| 482 | static CFISH_INLINE int64_t | ||
| 483 | LUCY_InStream_Read_I64(lucy_InStream* self) { | ||
| 484 | #ifdef CFP_LUCY | ||
| 485 | return LUCY_InStream_Read_I64_IMP(self); | ||
| 486 | #else | ||
| 487 | const LUCY_InStream_Read_I64_t method = (LUCY_InStream_Read_I64_t)cfish_obj_method(self, LUCY_InStream_Read_I64_OFFSET); | ||
| 488 | return method(self); | ||
| 489 | #endif | ||
| 490 | } | ||
| 491 | |||
| 492 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_U64_OFFSET; | ||
| 493 | static CFISH_INLINE uint64_t | ||
| 494 | LUCY_InStream_Read_U64(lucy_InStream* self) { | ||
| 495 | #ifdef CFP_LUCY | ||
| 496 | return LUCY_InStream_Read_U64_IMP(self); | ||
| 497 | #else | ||
| 498 | const LUCY_InStream_Read_U64_t method = (LUCY_InStream_Read_U64_t)cfish_obj_method(self, LUCY_InStream_Read_U64_OFFSET); | ||
| 499 | return method(self); | ||
| 500 | #endif | ||
| 501 | } | ||
| 502 | |||
| 503 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_F32_OFFSET; | ||
| 504 | static CFISH_INLINE float | ||
| 505 | LUCY_InStream_Read_F32(lucy_InStream* self) { | ||
| 506 | #ifdef CFP_LUCY | ||
| 507 | return LUCY_InStream_Read_F32_IMP(self); | ||
| 508 | #else | ||
| 509 | const LUCY_InStream_Read_F32_t method = (LUCY_InStream_Read_F32_t)cfish_obj_method(self, LUCY_InStream_Read_F32_OFFSET); | ||
| 510 | return method(self); | ||
| 511 | #endif | ||
| 512 | } | ||
| 513 | |||
| 514 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_F64_OFFSET; | ||
| 515 | static CFISH_INLINE double | ||
| 516 | LUCY_InStream_Read_F64(lucy_InStream* self) { | ||
| 517 | #ifdef CFP_LUCY | ||
| 518 | return LUCY_InStream_Read_F64_IMP(self); | ||
| 519 | #else | ||
| 520 | const LUCY_InStream_Read_F64_t method = (LUCY_InStream_Read_F64_t)cfish_obj_method(self, LUCY_InStream_Read_F64_OFFSET); | ||
| 521 | return method(self); | ||
| 522 | #endif | ||
| 523 | } | ||
| 524 | |||
| 525 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_CI32_OFFSET; | ||
| 526 | static CFISH_INLINE int32_t | ||
| 527 | LUCY_InStream_Read_CI32(lucy_InStream* self) { | ||
| 528 | const LUCY_InStream_Read_CI32_t method = (LUCY_InStream_Read_CI32_t)cfish_obj_method(self, LUCY_InStream_Read_CI32_OFFSET); | ||
| 529 | return method(self); | ||
| 530 | } | ||
| 531 | |||
| 532 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_CU32_OFFSET; | ||
| 533 | static CFISH_INLINE uint32_t | ||
| 534 | 8 | LUCY_InStream_Read_CU32(lucy_InStream* self) { | |
| 535 | 8 | const LUCY_InStream_Read_CU32_t method = (LUCY_InStream_Read_CU32_t)cfish_obj_method(self, LUCY_InStream_Read_CU32_OFFSET); | |
| 536 | 8 | return method(self); | |
| 537 | } | ||
| 538 | |||
| 539 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_CI64_OFFSET; | ||
| 540 | static CFISH_INLINE int64_t | ||
| 541 | LUCY_InStream_Read_CI64(lucy_InStream* self) { | ||
| 542 | #ifdef CFP_LUCY | ||
| 543 | return LUCY_InStream_Read_CI64_IMP(self); | ||
| 544 | #else | ||
| 545 | const LUCY_InStream_Read_CI64_t method = (LUCY_InStream_Read_CI64_t)cfish_obj_method(self, LUCY_InStream_Read_CI64_OFFSET); | ||
| 546 | return method(self); | ||
| 547 | #endif | ||
| 548 | } | ||
| 549 | |||
| 550 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_CU64_OFFSET; | ||
| 551 | static CFISH_INLINE uint64_t | ||
| 552 | LUCY_InStream_Read_CU64(lucy_InStream* self) { | ||
| 553 | #ifdef CFP_LUCY | ||
| 554 | return LUCY_InStream_Read_CU64_IMP(self); | ||
| 555 | #else | ||
| 556 | const LUCY_InStream_Read_CU64_t method = (LUCY_InStream_Read_CU64_t)cfish_obj_method(self, LUCY_InStream_Read_CU64_OFFSET); | ||
| 557 | return method(self); | ||
| 558 | #endif | ||
| 559 | } | ||
| 560 | |||
| 561 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Read_Raw_C64_OFFSET; | ||
| 562 | static CFISH_INLINE int | ||
| 563 | 1 | LUCY_InStream_Read_Raw_C64(lucy_InStream* self, char* buf) { | |
| 564 | #ifdef CFP_LUCY | ||
| 565 | 1 | return LUCY_InStream_Read_Raw_C64_IMP(self, buf); | |
| 566 | #else | ||
| 567 | const LUCY_InStream_Read_Raw_C64_t method = (LUCY_InStream_Read_Raw_C64_t)cfish_obj_method(self, LUCY_InStream_Read_Raw_C64_OFFSET); | ||
| 568 | return method(self, buf); | ||
| 569 | #endif | ||
| 570 | } | ||
| 571 | |||
| 572 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Get_Filename_OFFSET; | ||
| 573 | static CFISH_INLINE cfish_String* | ||
| 574 | LUCY_InStream_Get_Filename(lucy_InStream* self) { | ||
| 575 | const LUCY_InStream_Get_Filename_t method = (LUCY_InStream_Get_Filename_t)cfish_obj_method(self, LUCY_InStream_Get_Filename_OFFSET); | ||
| 576 | return method(self); | ||
| 577 | } | ||
| 578 | |||
| 579 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Get_Window_OFFSET; | ||
| 580 | static CFISH_INLINE lucy_FileWindow* | ||
| 581 | LUCY_InStream_Get_Window(lucy_InStream* self) { | ||
| 582 | const LUCY_InStream_Get_Window_t method = (LUCY_InStream_Get_Window_t)cfish_obj_method(self, LUCY_InStream_Get_Window_OFFSET); | ||
| 583 | return method(self); | ||
| 584 | } | ||
| 585 | |||
| 586 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Get_Handle_OFFSET; | ||
| 587 | static CFISH_INLINE lucy_FileHandle* | ||
| 588 | LUCY_InStream_Get_Handle(lucy_InStream* self) { | ||
| 589 | const LUCY_InStream_Get_Handle_t method = (LUCY_InStream_Get_Handle_t)cfish_obj_method(self, LUCY_InStream_Get_Handle_OFFSET); | ||
| 590 | return method(self); | ||
| 591 | } | ||
| 592 | |||
| 593 | extern LUCY_VISIBLE uint32_t LUCY_InStream_Bytes_In_Buf_OFFSET; | ||
| 594 | static CFISH_INLINE int64_t | ||
| 595 | LUCY_InStream_Bytes_In_Buf(lucy_InStream* self) { | ||
| 596 | const LUCY_InStream_Bytes_In_Buf_t method = (LUCY_InStream_Bytes_In_Buf_t)cfish_obj_method(self, LUCY_InStream_Bytes_In_Buf_OFFSET); | ||
| 597 | return method(self); | ||
| 598 | } | ||
| 599 | |||
| 600 | |||
| 601 | |||
| 602 | /* Declare callbacks for wrapping host overrides. | ||
| 603 | */ | ||
| 604 | |||
| 605 | #ifdef CFISH_NO_DYNAMIC_OVERRIDES | ||
| 606 | #define Lucy_InStream_Reopen_OVERRIDE NULL | ||
| 607 | #define Lucy_InStream_Close_OVERRIDE NULL | ||
| 608 | #define Lucy_InStream_Refill_OVERRIDE NULL | ||
| 609 | #define Lucy_InStream_Fill_OVERRIDE NULL | ||
| 610 | #define Lucy_InStream_Read_CI32_OVERRIDE NULL | ||
| 611 | #define Lucy_InStream_Read_CU32_OVERRIDE NULL | ||
| 612 | #define Lucy_InStream_Get_Filename_OVERRIDE NULL | ||
| 613 | #define Lucy_InStream_Get_Window_OVERRIDE NULL | ||
| 614 | #define Lucy_InStream_Get_Handle_OVERRIDE NULL | ||
| 615 | #define Lucy_InStream_Bytes_In_Buf_OVERRIDE NULL | ||
| 616 | #else | ||
| 617 | lucy_InStream* | ||
| 618 | Lucy_InStream_Reopen_OVERRIDE(lucy_InStream* self, cfish_String* filename, int64_t offset, int64_t len); | ||
| 619 | void | ||
| 620 | Lucy_InStream_Close_OVERRIDE(lucy_InStream* self); | ||
| 621 | void | ||
| 622 | Lucy_InStream_Refill_OVERRIDE(lucy_InStream* self); | ||
| 623 | void | ||
| 624 | Lucy_InStream_Fill_OVERRIDE(lucy_InStream* self, int64_t amount); | ||
| 625 | int32_t | ||
| 626 | Lucy_InStream_Read_CI32_OVERRIDE(lucy_InStream* self); | ||
| 627 | uint32_t | ||
| 628 | Lucy_InStream_Read_CU32_OVERRIDE(lucy_InStream* self); | ||
| 629 | cfish_String* | ||
| 630 | Lucy_InStream_Get_Filename_OVERRIDE(lucy_InStream* self); | ||
| 631 | lucy_FileWindow* | ||
| 632 | Lucy_InStream_Get_Window_OVERRIDE(lucy_InStream* self); | ||
| 633 | lucy_FileHandle* | ||
| 634 | Lucy_InStream_Get_Handle_OVERRIDE(lucy_InStream* self); | ||
| 635 | int64_t | ||
| 636 | Lucy_InStream_Bytes_In_Buf_OVERRIDE(lucy_InStream* self); | ||
| 637 | #endif | ||
| 638 | |||
| 639 | |||
| 640 | /* Define "short names" for this class's symbols. | ||
| 641 | */ | ||
| 642 | |||
| 643 | #ifdef LUCY_USE_SHORT_NAMES | ||
| 644 | #define InStream lucy_InStream | ||
| 645 | #define INSTREAM LUCY_INSTREAM | ||
| 646 | #define InStream_open lucy_InStream_open | ||
| 647 | #define InStream_do_open lucy_InStream_do_open | ||
| 648 | #define InStream_get_class lucy_InStream_get_class | ||
| 649 | #define InStream_get_class_name lucy_InStream_get_class_name | ||
| 650 | #define InStream_is_a lucy_InStream_is_a | ||
| 651 | #define InStream_Reopen_IMP LUCY_InStream_Reopen_IMP | ||
| 652 | #define InStream_Clone_IMP LUCY_InStream_Clone_IMP | ||
| 653 | #define InStream_Close_IMP LUCY_InStream_Close_IMP | ||
| 654 | #define InStream_Destroy_IMP LUCY_InStream_Destroy_IMP | ||
| 655 | #define InStream_Seek_IMP LUCY_InStream_Seek_IMP | ||
| 656 | #define InStream_Tell_IMP LUCY_InStream_Tell_IMP | ||
| 657 | #define InStream_Length_IMP LUCY_InStream_Length_IMP | ||
| 658 | #define InStream_Refill_IMP LUCY_InStream_Refill_IMP | ||
| 659 | #define InStream_Fill_IMP LUCY_InStream_Fill_IMP | ||
| 660 | #define InStream_Buf_IMP LUCY_InStream_Buf_IMP | ||
| 661 | #define InStream_Advance_Buf_IMP LUCY_InStream_Advance_Buf_IMP | ||
| 662 | #define InStream_Read_Bytes_IMP LUCY_InStream_Read_Bytes_IMP | ||
| 663 | #define InStream_Read_I8_IMP LUCY_InStream_Read_I8_IMP | ||
| 664 | #define InStream_Read_U8_IMP LUCY_InStream_Read_U8_IMP | ||
| 665 | #define InStream_Read_I32_IMP LUCY_InStream_Read_I32_IMP | ||
| 666 | #define InStream_Read_U32_IMP LUCY_InStream_Read_U32_IMP | ||
| 667 | #define InStream_Read_I64_IMP LUCY_InStream_Read_I64_IMP | ||
| 668 | #define InStream_Read_U64_IMP LUCY_InStream_Read_U64_IMP | ||
| 669 | #define InStream_Read_F32_IMP LUCY_InStream_Read_F32_IMP | ||
| 670 | #define InStream_Read_F64_IMP LUCY_InStream_Read_F64_IMP | ||
| 671 | #define InStream_Read_CI32_IMP LUCY_InStream_Read_CI32_IMP | ||
| 672 | #define InStream_Read_CU32_IMP LUCY_InStream_Read_CU32_IMP | ||
| 673 | #define InStream_Read_CI64_IMP LUCY_InStream_Read_CI64_IMP | ||
| 674 | #define InStream_Read_CU64_IMP LUCY_InStream_Read_CU64_IMP | ||
| 675 | #define InStream_Read_Raw_C64_IMP LUCY_InStream_Read_Raw_C64_IMP | ||
| 676 | #define InStream_Get_Filename_IMP LUCY_InStream_Get_Filename_IMP | ||
| 677 | #define InStream_Get_Window_IMP LUCY_InStream_Get_Window_IMP | ||
| 678 | #define InStream_Get_Handle_IMP LUCY_InStream_Get_Handle_IMP | ||
| 679 | #define InStream_Bytes_In_Buf_IMP LUCY_InStream_Bytes_In_Buf_IMP | ||
| 680 | #define InStream_To_Host LUCY_InStream_To_Host | ||
| 681 | #define InStream_To_Host_t LUCY_InStream_To_Host_t | ||
| 682 | #define InStream_Clone LUCY_InStream_Clone | ||
| 683 | #define InStream_Clone_t LUCY_InStream_Clone_t | ||
| 684 | #define InStream_Equals LUCY_InStream_Equals | ||
| 685 | #define InStream_Equals_t LUCY_InStream_Equals_t | ||
| 686 | #define InStream_Compare_To LUCY_InStream_Compare_To | ||
| 687 | #define InStream_Compare_To_t LUCY_InStream_Compare_To_t | ||
| 688 | #define InStream_Destroy LUCY_InStream_Destroy | ||
| 689 | #define InStream_Destroy_t LUCY_InStream_Destroy_t | ||
| 690 | #define InStream_To_String LUCY_InStream_To_String | ||
| 691 | #define InStream_To_String_t LUCY_InStream_To_String_t | ||
| 692 | #define InStream_Reopen LUCY_InStream_Reopen | ||
| 693 | #define InStream_Reopen_t LUCY_InStream_Reopen_t | ||
| 694 | #define InStream_Close LUCY_InStream_Close | ||
| 695 | #define InStream_Close_t LUCY_InStream_Close_t | ||
| 696 | #define InStream_Seek LUCY_InStream_Seek | ||
| 697 | #define InStream_Seek_t LUCY_InStream_Seek_t | ||
| 698 | #define InStream_Tell LUCY_InStream_Tell | ||
| 699 | #define InStream_Tell_t LUCY_InStream_Tell_t | ||
| 700 | #define InStream_Length LUCY_InStream_Length | ||
| 701 | #define InStream_Length_t LUCY_InStream_Length_t | ||
| 702 | #define InStream_Refill LUCY_InStream_Refill | ||
| 703 | #define InStream_Refill_t LUCY_InStream_Refill_t | ||
| 704 | #define InStream_Fill LUCY_InStream_Fill | ||
| 705 | #define InStream_Fill_t LUCY_InStream_Fill_t | ||
| 706 | #define InStream_Buf LUCY_InStream_Buf | ||
| 707 | #define InStream_Buf_t LUCY_InStream_Buf_t | ||
| 708 | #define InStream_Advance_Buf LUCY_InStream_Advance_Buf | ||
| 709 | #define InStream_Advance_Buf_t LUCY_InStream_Advance_Buf_t | ||
| 710 | #define InStream_Read_Bytes LUCY_InStream_Read_Bytes | ||
| 711 | #define InStream_Read_Bytes_t LUCY_InStream_Read_Bytes_t | ||
| 712 | #define InStream_Read_I8 LUCY_InStream_Read_I8 | ||
| 713 | #define InStream_Read_I8_t LUCY_InStream_Read_I8_t | ||
| 714 | #define InStream_Read_U8 LUCY_InStream_Read_U8 | ||
| 715 | #define InStream_Read_U8_t LUCY_InStream_Read_U8_t | ||
| 716 | #define InStream_Read_I32 LUCY_InStream_Read_I32 | ||
| 717 | #define InStream_Read_I32_t LUCY_InStream_Read_I32_t | ||
| 718 | #define InStream_Read_U32 LUCY_InStream_Read_U32 | ||
| 719 | #define InStream_Read_U32_t LUCY_InStream_Read_U32_t | ||
| 720 | #define InStream_Read_I64 LUCY_InStream_Read_I64 | ||
| 721 | #define InStream_Read_I64_t LUCY_InStream_Read_I64_t | ||
| 722 | #define InStream_Read_U64 LUCY_InStream_Read_U64 | ||
| 723 | #define InStream_Read_U64_t LUCY_InStream_Read_U64_t | ||
| 724 | #define InStream_Read_F32 LUCY_InStream_Read_F32 | ||
| 725 | #define InStream_Read_F32_t LUCY_InStream_Read_F32_t | ||
| 726 | #define InStream_Read_F64 LUCY_InStream_Read_F64 | ||
| 727 | #define InStream_Read_F64_t LUCY_InStream_Read_F64_t | ||
| 728 | #define InStream_Read_CI32 LUCY_InStream_Read_CI32 | ||
| 729 | #define InStream_Read_CI32_t LUCY_InStream_Read_CI32_t | ||
| 730 | #define InStream_Read_CU32 LUCY_InStream_Read_CU32 | ||
| 731 | #define InStream_Read_CU32_t LUCY_InStream_Read_CU32_t | ||
| 732 | #define InStream_Read_CI64 LUCY_InStream_Read_CI64 | ||
| 733 | #define InStream_Read_CI64_t LUCY_InStream_Read_CI64_t | ||
| 734 | #define InStream_Read_CU64 LUCY_InStream_Read_CU64 | ||
| 735 | #define InStream_Read_CU64_t LUCY_InStream_Read_CU64_t | ||
| 736 | #define InStream_Read_Raw_C64 LUCY_InStream_Read_Raw_C64 | ||
| 737 | #define InStream_Read_Raw_C64_t LUCY_InStream_Read_Raw_C64_t | ||
| 738 | #define InStream_Get_Filename LUCY_InStream_Get_Filename | ||
| 739 | #define InStream_Get_Filename_t LUCY_InStream_Get_Filename_t | ||
| 740 | #define InStream_Get_Window LUCY_InStream_Get_Window | ||
| 741 | #define InStream_Get_Window_t LUCY_InStream_Get_Window_t | ||
| 742 | #define InStream_Get_Handle LUCY_InStream_Get_Handle | ||
| 743 | #define InStream_Get_Handle_t LUCY_InStream_Get_Handle_t | ||
| 744 | #define InStream_Bytes_In_Buf LUCY_InStream_Bytes_In_Buf | ||
| 745 | #define InStream_Bytes_In_Buf_t LUCY_InStream_Bytes_In_Buf_t | ||
| 746 | #endif /* LUCY_USE_SHORT_NAMES */ | ||
| 747 | |||
| 748 | |||
| 749 | |||
| 750 | |||
| 751 | |||
| 752 | #ifdef __cplusplus | ||
| 753 | } | ||
| 754 | #endif | ||
| 755 | |||
| 756 | #endif /* H_LUCY_STORE_INSTREAM */ | ||
| 757 | |||
| 758 | |||
| 759 | |||
| 760 |