| 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_RAMFILE | ||
| 28 | #define H_LUCY_STORE_RAMFILE 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_RAMFILE | ||
| 46 | extern uint32_t lucy_RAMFile_IVARS_OFFSET; | ||
| 47 | typedef struct lucy_RAMFileIVARS lucy_RAMFileIVARS; | ||
| 48 | static CFISH_INLINE lucy_RAMFileIVARS* | ||
| 49 | lucy_RAMFile_IVARS(lucy_RAMFile *self) { | ||
| 50 | char *ptr = (char*)self + lucy_RAMFile_IVARS_OFFSET; | ||
| 51 | return (lucy_RAMFileIVARS*)ptr; | ||
| 52 | } | ||
| 53 | #ifdef LUCY_USE_SHORT_NAMES | ||
| 54 | #define RAMFileIVARS lucy_RAMFileIVARS | ||
| 55 | #define RAMFile_IVARS lucy_RAMFile_IVARS | ||
| 56 | #endif | ||
| 57 | |||
| 58 | struct lucy_RAMFileIVARS { | ||
| 59 | bool read_only; | ||
| 60 | cfish_ByteBuf* contents; | ||
| 61 | }; | ||
| 62 | |||
| 63 | #endif /* C_LUCY_RAMFILE */ | ||
| 64 | |||
| 65 | /* Declare this class's inert variables. | ||
| 66 | */ | ||
| 67 | |||
| 68 | |||
| 69 | |||
| 70 | /* Declare both this class's inert functions and the C functions which | ||
| 71 | * implement this class's dynamic methods. | ||
| 72 | */ | ||
| 73 | |||
| 74 | LUCY_VISIBLE lucy_RAMFile* | ||
| 75 | lucy_RAMFile_new(cfish_ByteBuf* contents, bool read_only); | ||
| 76 | |||
| 77 | LUCY_VISIBLE lucy_RAMFile* | ||
| 78 | lucy_RAMFile_init(lucy_RAMFile* self, cfish_ByteBuf* contents, bool read_only); | ||
| 79 | |||
| 80 | cfish_ByteBuf* | ||
| 81 | LUCY_RAMFile_Get_Contents_IMP(lucy_RAMFile* self); | ||
| 82 | |||
| 83 | bool | ||
| 84 | LUCY_RAMFile_Read_Only_IMP(lucy_RAMFile* self); | ||
| 85 | |||
| 86 | void | ||
| 87 | LUCY_RAMFile_Set_Read_Only_IMP(lucy_RAMFile* self, bool read_only); | ||
| 88 | |||
| 89 | void | ||
| 90 | LUCY_RAMFile_Destroy_IMP(lucy_RAMFile* self); | ||
| 91 | |||
| 92 | |||
| 93 | |||
| 94 | /* Define typedefs for each dynamic method, allowing us to cast generic | ||
| 95 | * pointers to the appropriate function pointer type more cleanly. | ||
| 96 | */ | ||
| 97 | |||
| 98 | typedef void* | ||
| 99 | (*LUCY_RAMFile_To_Host_t)(lucy_RAMFile* self, void* vcache); | ||
| 100 | |||
| 101 | typedef cfish_Obj* | ||
| 102 | (*LUCY_RAMFile_Clone_t)(lucy_RAMFile* self); | ||
| 103 | |||
| 104 | typedef bool | ||
| 105 | (*LUCY_RAMFile_Equals_t)(lucy_RAMFile* self, cfish_Obj* other); | ||
| 106 | |||
| 107 | typedef int32_t | ||
| 108 | (*LUCY_RAMFile_Compare_To_t)(lucy_RAMFile* self, cfish_Obj* other); | ||
| 109 | |||
| 110 | typedef void | ||
| 111 | (*LUCY_RAMFile_Destroy_t)(lucy_RAMFile* self); | ||
| 112 | |||
| 113 | typedef cfish_String* | ||
| 114 | (*LUCY_RAMFile_To_String_t)(lucy_RAMFile* self); | ||
| 115 | |||
| 116 | typedef cfish_ByteBuf* | ||
| 117 | (*LUCY_RAMFile_Get_Contents_t)(lucy_RAMFile* self); | ||
| 118 | |||
| 119 | typedef bool | ||
| 120 | (*LUCY_RAMFile_Read_Only_t)(lucy_RAMFile* self); | ||
| 121 | |||
| 122 | typedef void | ||
| 123 | (*LUCY_RAMFile_Set_Read_Only_t)(lucy_RAMFile* self, bool read_only); | ||
| 124 | |||
| 125 | |||
| 126 | |||
| 127 | /* Define type-safe wrappers for inert functions of Obj. | ||
| 128 | */ | ||
| 129 | |||
| 130 | static CFISH_INLINE cfish_Class* | ||
| 131 | lucy_RAMFile_get_class(lucy_RAMFile *self) { | ||
| 132 | return cfish_Obj_get_class((cfish_Obj*)self); | ||
| 133 | } | ||
| 134 | |||
| 135 | static CFISH_INLINE cfish_String* | ||
| 136 | lucy_RAMFile_get_class_name(lucy_RAMFile *self) { | ||
| 137 | return cfish_Obj_get_class_name((cfish_Obj*)self); | ||
| 138 | } | ||
| 139 | |||
| 140 | static CFISH_INLINE bool | ||
| 141 | lucy_RAMFile_is_a(lucy_RAMFile *self, cfish_Class *ancestor) { | ||
| 142 | return cfish_Obj_is_a((cfish_Obj*)self, ancestor); | ||
| 143 | } | ||
| 144 | |||
| 145 | |||
| 146 | /* Define the inline functions which implement this class's virtual methods. | ||
| 147 | */ | ||
| 148 | |||
| 149 | extern LUCY_VISIBLE uint32_t LUCY_RAMFile_To_Host_OFFSET; | ||
| 150 | static CFISH_INLINE void* | ||
| 151 | LUCY_RAMFile_To_Host(lucy_RAMFile* self, void* vcache) { | ||
| 152 | const LUCY_RAMFile_To_Host_t method = (LUCY_RAMFile_To_Host_t)cfish_obj_method(self, LUCY_RAMFile_To_Host_OFFSET); | ||
| 153 | return method(self, vcache); | ||
| 154 | } | ||
| 155 | |||
| 156 | extern LUCY_VISIBLE uint32_t LUCY_RAMFile_Clone_OFFSET; | ||
| 157 | static CFISH_INLINE cfish_Obj* | ||
| 158 | LUCY_RAMFile_Clone(lucy_RAMFile* self) { | ||
| 159 | const LUCY_RAMFile_Clone_t method = (LUCY_RAMFile_Clone_t)cfish_obj_method(self, LUCY_RAMFile_Clone_OFFSET); | ||
| 160 | return method(self); | ||
| 161 | } | ||
| 162 | |||
| 163 | extern LUCY_VISIBLE uint32_t LUCY_RAMFile_Equals_OFFSET; | ||
| 164 | static CFISH_INLINE bool | ||
| 165 | LUCY_RAMFile_Equals(lucy_RAMFile* self, cfish_Obj* other) { | ||
| 166 | const LUCY_RAMFile_Equals_t method = (LUCY_RAMFile_Equals_t)cfish_obj_method(self, LUCY_RAMFile_Equals_OFFSET); | ||
| 167 | return method(self, other); | ||
| 168 | } | ||
| 169 | |||
| 170 | extern LUCY_VISIBLE uint32_t LUCY_RAMFile_Compare_To_OFFSET; | ||
| 171 | static CFISH_INLINE int32_t | ||
| 172 | LUCY_RAMFile_Compare_To(lucy_RAMFile* self, cfish_Obj* other) { | ||
| 173 | const LUCY_RAMFile_Compare_To_t method = (LUCY_RAMFile_Compare_To_t)cfish_obj_method(self, LUCY_RAMFile_Compare_To_OFFSET); | ||
| 174 | return method(self, other); | ||
| 175 | } | ||
| 176 | |||
| 177 | extern LUCY_VISIBLE uint32_t LUCY_RAMFile_Destroy_OFFSET; | ||
| 178 | static CFISH_INLINE void | ||
| 179 | LUCY_RAMFile_Destroy(lucy_RAMFile* self) { | ||
| 180 | const LUCY_RAMFile_Destroy_t method = (LUCY_RAMFile_Destroy_t)cfish_obj_method(self, LUCY_RAMFile_Destroy_OFFSET); | ||
| 181 | method(self); | ||
| 182 | } | ||
| 183 | |||
| 184 | extern LUCY_VISIBLE uint32_t LUCY_RAMFile_To_String_OFFSET; | ||
| 185 | static CFISH_INLINE cfish_String* | ||
| 186 | LUCY_RAMFile_To_String(lucy_RAMFile* self) { | ||
| 187 | const LUCY_RAMFile_To_String_t method = (LUCY_RAMFile_To_String_t)cfish_obj_method(self, LUCY_RAMFile_To_String_OFFSET); | ||
| 188 | return method(self); | ||
| 189 | } | ||
| 190 | |||
| 191 | extern LUCY_VISIBLE uint32_t LUCY_RAMFile_Get_Contents_OFFSET; | ||
| 192 | static CFISH_INLINE cfish_ByteBuf* | ||
| 193 | 69 | LUCY_RAMFile_Get_Contents(lucy_RAMFile* self) { | |
| 194 | 69 | const LUCY_RAMFile_Get_Contents_t method = (LUCY_RAMFile_Get_Contents_t)cfish_obj_method(self, LUCY_RAMFile_Get_Contents_OFFSET); | |
| 195 | 69 | return method(self); | |
| 196 | } | ||
| 197 | |||
| 198 | extern LUCY_VISIBLE uint32_t LUCY_RAMFile_Read_Only_OFFSET; | ||
| 199 | static CFISH_INLINE bool | ||
| 200 | LUCY_RAMFile_Read_Only(lucy_RAMFile* self) { | ||
| 201 | const LUCY_RAMFile_Read_Only_t method = (LUCY_RAMFile_Read_Only_t)cfish_obj_method(self, LUCY_RAMFile_Read_Only_OFFSET); | ||
| 202 | return method(self); | ||
| 203 | } | ||
| 204 | |||
| 205 | extern LUCY_VISIBLE uint32_t LUCY_RAMFile_Set_Read_Only_OFFSET; | ||
| 206 | static CFISH_INLINE void | ||
| 207 | LUCY_RAMFile_Set_Read_Only(lucy_RAMFile* self, bool read_only) { | ||
| 208 | const LUCY_RAMFile_Set_Read_Only_t method = (LUCY_RAMFile_Set_Read_Only_t)cfish_obj_method(self, LUCY_RAMFile_Set_Read_Only_OFFSET); | ||
| 209 | method(self, read_only); | ||
| 210 | } | ||
| 211 | |||
| 212 | |||
| 213 | |||
| 214 | /* Declare callbacks for wrapping host overrides. | ||
| 215 | */ | ||
| 216 | |||
| 217 | #ifdef CFISH_NO_DYNAMIC_OVERRIDES | ||
| 218 | #define Lucy_RAMFile_Get_Contents_OVERRIDE NULL | ||
| 219 | #define Lucy_RAMFile_Read_Only_OVERRIDE NULL | ||
| 220 | #define Lucy_RAMFile_Set_Read_Only_OVERRIDE NULL | ||
| 221 | #else | ||
| 222 | cfish_ByteBuf* | ||
| 223 | Lucy_RAMFile_Get_Contents_OVERRIDE(lucy_RAMFile* self); | ||
| 224 | bool | ||
| 225 | Lucy_RAMFile_Read_Only_OVERRIDE(lucy_RAMFile* self); | ||
| 226 | void | ||
| 227 | Lucy_RAMFile_Set_Read_Only_OVERRIDE(lucy_RAMFile* self, bool read_only); | ||
| 228 | #endif | ||
| 229 | |||
| 230 | |||
| 231 | /* Define "short names" for this class's symbols. | ||
| 232 | */ | ||
| 233 | |||
| 234 | #ifdef LUCY_USE_SHORT_NAMES | ||
| 235 | #define RAMFile lucy_RAMFile | ||
| 236 | #define RAMFILE LUCY_RAMFILE | ||
| 237 | #define RAMFile_new lucy_RAMFile_new | ||
| 238 | #define RAMFile_init lucy_RAMFile_init | ||
| 239 | #define RAMFile_get_class lucy_RAMFile_get_class | ||
| 240 | #define RAMFile_get_class_name lucy_RAMFile_get_class_name | ||
| 241 | #define RAMFile_is_a lucy_RAMFile_is_a | ||
| 242 | #define RAMFile_Get_Contents_IMP LUCY_RAMFile_Get_Contents_IMP | ||
| 243 | #define RAMFile_Read_Only_IMP LUCY_RAMFile_Read_Only_IMP | ||
| 244 | #define RAMFile_Set_Read_Only_IMP LUCY_RAMFile_Set_Read_Only_IMP | ||
| 245 | #define RAMFile_Destroy_IMP LUCY_RAMFile_Destroy_IMP | ||
| 246 | #define RAMFile_To_Host LUCY_RAMFile_To_Host | ||
| 247 | #define RAMFile_To_Host_t LUCY_RAMFile_To_Host_t | ||
| 248 | #define RAMFile_Clone LUCY_RAMFile_Clone | ||
| 249 | #define RAMFile_Clone_t LUCY_RAMFile_Clone_t | ||
| 250 | #define RAMFile_Equals LUCY_RAMFile_Equals | ||
| 251 | #define RAMFile_Equals_t LUCY_RAMFile_Equals_t | ||
| 252 | #define RAMFile_Compare_To LUCY_RAMFile_Compare_To | ||
| 253 | #define RAMFile_Compare_To_t LUCY_RAMFile_Compare_To_t | ||
| 254 | #define RAMFile_Destroy LUCY_RAMFile_Destroy | ||
| 255 | #define RAMFile_Destroy_t LUCY_RAMFile_Destroy_t | ||
| 256 | #define RAMFile_To_String LUCY_RAMFile_To_String | ||
| 257 | #define RAMFile_To_String_t LUCY_RAMFile_To_String_t | ||
| 258 | #define RAMFile_Get_Contents LUCY_RAMFile_Get_Contents | ||
| 259 | #define RAMFile_Get_Contents_t LUCY_RAMFile_Get_Contents_t | ||
| 260 | #define RAMFile_Read_Only LUCY_RAMFile_Read_Only | ||
| 261 | #define RAMFile_Read_Only_t LUCY_RAMFile_Read_Only_t | ||
| 262 | #define RAMFile_Set_Read_Only LUCY_RAMFile_Set_Read_Only | ||
| 263 | #define RAMFile_Set_Read_Only_t LUCY_RAMFile_Set_Read_Only_t | ||
| 264 | #endif /* LUCY_USE_SHORT_NAMES */ | ||
| 265 | |||
| 266 | |||
| 267 | |||
| 268 | |||
| 269 | |||
| 270 | #ifdef __cplusplus | ||
| 271 | } | ||
| 272 | #endif | ||
| 273 | |||
| 274 | #endif /* H_LUCY_STORE_RAMFILE */ | ||
| 275 | |||
| 276 | |||
| 277 | |||
| 278 |