T-EMU  2
The Terma Emulator
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Objsys.h
Go to the documentation of this file.
1 //===-- temu-c/Objsys.h - T-EMU Object System -------------------*- C++ -*-===//
2 //
3 // T-EMU: The Terma Emulator
4 // (c) Terma 2015
5 // Authors: Mattias Holm <maho (at) terma.com>
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef TEMU_OBJSYS_C_H
10 #define TEMU_OBJSYS_C_H
11 
12 #include <assert.h>
13 #include <stdint.h>
14 #include <stdlib.h>
15 #include <stddef.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #ifdef __cplusplus
22 # define TEMU_PLUGIN_INIT extern "C" void temu_pluginInit(void)
23 #else
24 # define TEMU_PLUGIN_INIT void temu_pluginInit(void)
25 #endif
26 
27 #if defined(__has_attribute)
28 # if __has_attribute(annotate)
29 # define TEMU_NO_WRAP __attribute__((annotate("temu-no-wrap")))
30 # endif
31 #endif
32 
33 #if !defined(TEMU_NO_WRAP)
34 # define TEMU_NO_WRAP
35 #endif
36 
37 typedef void temu_Class;
38 typedef void temu_MetaIface;
39 
40 typedef struct {
41  temu_Class *Class;
42 } temu_Object;
43 
44 
45 // Generic interface
46 typedef struct temu_IfaceRef {
47  void *Obj;
48  void *Iface;
50 
51 // In some cases, the number of objects we know about is unknown, so
52 // we need a dynamic array (e.g. std::vector in C++), but we cannot
53 // expose std::vector in a known format to LLVM, so we do this simple
54 // system with a dynamic interface array.
55 typedef struct temu_IfaceRefArray {
56  uint32_t Size;
57  uint32_t Reserved;
60 
68 
75 void temu_ifaceRefArrayPush2(temu_IfaceRefArray *Arr, void *Obj, void *Iface);
82 
88 unsigned temu_ifaceRefArraySize(temu_IfaceRefArray *Arr); // Return size
89 
91 
92 
93 // Used to declare typed interfaces, also declares an array of such
94 // and inline wrappers for the iface array functions
95 #define TEMU_IFACE_REFERENCE_TYPE(N) \
96  typedef struct { \
97  void *Obj; \
98  N ## Iface *Iface; \
99  } N ## IfaceRef; \
100  typedef struct { \
101  uint32_t Size; \
102  uint32_t Reserved; \
103  N ## IfaceRef *Ifaces; \
104  } N ## IfaceRefArray; \
105  static inline N ## IfaceRefArray \
106  N ## IfaceRefArrayAlloc(unsigned Reserve) \
107  { \
108  temu_IfaceRefArray Arr = temu_ifaceRefArrayAlloc(Reserve); \
109  N ## IfaceRefArray Res; \
110  Res.Size = Arr.Size; \
111  Res.Reserved = Arr.Reserved; \
112  Res.Ifaces = (N##IfaceRef*)Arr.Ifaces; \
113  return Res; \
114  } \
115  static inline void \
116  N ## IfaceRefArrayDispose(N ## IfaceRefArray *Arr) \
117  { \
118  temu_ifaceRefArrayDispose((temu_IfaceRefArray*)Arr); \
119  } \
120  static inline void \
121  N ## IfaceRefArrayPush2(N ## IfaceRefArray *Arr, void *Obj, void *Iface) \
122  { \
123  temu_ifaceRefArrayPush2((temu_IfaceRefArray*)Arr, Obj, Iface); \
124  } \
125  static inline void \
126  N ## IfaceRefArrayPush(N ## IfaceRefArray *Arr, N ## IfaceRef Iface) \
127  { \
128  temu_IfaceRef Iface2; \
129  Iface2.Obj = Iface.Obj; \
130  Iface2.Iface = (void*)Iface.Iface; \
131  \
132  temu_ifaceRefArrayPush((temu_IfaceRefArray*)Arr, Iface2); \
133  } \
134  static inline unsigned \
135  N ## IfaceRefArraySize(temu_IfaceRefArray *Arr) \
136  { \
137  return Arr->Size; \
138  }
139 
140 
141 #define TEMU_DYN_ARRAY_TYPE(T, P) \
142  typedef struct { \
143  uint32_t Size; \
144  uint32_t Reserved; \
145  T *Values; \
146  } temu_ ## P ## Array; \
147  static inline temu_ ## P ## Array \
148  temu_ ## P ## ArrayAlloc(unsigned Reserve) \
149  { \
150  temu_ ## P ## Array Arr; \
151  Arr.Size = 0; \
152  Arr.Reserved = Reserve; \
153  Arr.Values = (T*)calloc(Reserve, sizeof(T)); \
154  assert(Arr.Values); \
155  return Arr; \
156  } \
157  static inline void \
158  temu_ ## P ## ArrayPush(temu_ ## P ## Array *Arr, T Val) \
159  { \
160  if (Arr->Reserved >= Arr->Size) { \
161  T *NewValues = (T*)realloc(Arr->Values, Arr->Reserved * 2); \
162  if (NewValues) { \
163  Arr->Values = NewValues; \
164  } else { \
165  abort(); \
166  } \
167  } \
168  Arr->Values[Arr->Size ++] = Val; \
169  } \
170  static inline unsigned \
171  temu_ ## P ## ArraySize(temu_ ## P ## Array *Arr) \
172  { \
173  return Arr->Size; \
174  }
175 
176 TEMU_DYN_ARRAY_TYPE(int8_t, i8)
177 TEMU_DYN_ARRAY_TYPE(int16_t, i16)
178 TEMU_DYN_ARRAY_TYPE(int32_t, i32)
179 TEMU_DYN_ARRAY_TYPE(int64_t, i64)
180 
181 TEMU_DYN_ARRAY_TYPE(uint8_t, u8)
182 TEMU_DYN_ARRAY_TYPE(uint16_t, u16)
183 TEMU_DYN_ARRAY_TYPE(uint32_t, u32)
184 TEMU_DYN_ARRAY_TYPE(uint64_t, u64)
185 
186 typedef enum temu_Type {
187  teTY_Invalid, // Invalid value 0
188 
189  // C pointer sized integers
192 
193  // Standard C floating point types
196 
197  // Standard C fixed width integer types
198  teTY_U8, //5
199  teTY_U16, //6
200  teTY_U32, //7
201  teTY_U64, //8
206 
207  // Object pointer, must be saved as an object reference
209 
210  // Internal pointer, points somewhere in the object itself
211  // (e.g. bank resolution arrays) This can be saved as an offset...
213 
214  // Interface references (object and interface pointer pair)
216  teTY_IfaceRefArray, // Dynamic object/interface array
217 
218  teTY_String, // C-string, useful for serialisation
219 } temu_Type;
220 
221 
228 typedef struct temu_Propref {
230  void *Ptr;
231 } temu_Propref;
232 
240 typedef struct temu_Propval {
242  union {
243  intptr_t IntPtr;
244  uintptr_t UIntPtr;
245 
246  float f;
247  double d;
248 
249  uint8_t u8;
250  uint16_t u16;
251  uint32_t u32;
252  uint64_t u64;
253 
254  int8_t i8;
255  int16_t i16;
256  int32_t i32;
257  int64_t i64;
258 
259  void *Obj;
262  const char *String;
263  };
264 } temu_Propval;
265 
266 
267 #ifdef PROP_ASSERTS_ENABLED
268 #define PROP_ASSERT(p, t) assert(p.Typ == t && "invalid property type")
269 #else
270 #define PROP_ASSERT(p, t)
271 #endif
272 
273 // Ugly, but we want to be compatible with C++ and C99, meaning:
274 // cannot use designated initializers (C99, not C++)
275 // cannot use constructors (C++, not C99)
276 
277 #define PROP_VAL_INITIALIZER(typ, suffix, typetag, valtag) \
278  static inline temu_Propval \
279  temu_makeProp ## suffix (typ val) \
280  { \
281  temu_Propval pv; \
282  pv.Typ = typetag; \
283  pv.valtag = val; \
284  return pv; \
285  } \
286  static inline typ \
287  temu_propValue ## suffix (temu_Propval pv) \
288  { \
289  PROP_ASSERT(pv.Typ, typetag); \
290  typ val = pv.valtag; \
291  return val; \
292  }
293 
294 PROP_VAL_INITIALIZER(intptr_t, IntPtr, teTY_Intptr, IntPtr)
295 PROP_VAL_INITIALIZER(uintptr_t, UIntPtr, teTY_Uintptr, UIntPtr)
296 
297 PROP_VAL_INITIALIZER(float, Float, teTY_Float, f)
298 PROP_VAL_INITIALIZER(double, Double, teTY_Double, d)
299 
300 PROP_VAL_INITIALIZER(uint8_t, U8, teTY_U8, u8)
301 PROP_VAL_INITIALIZER(uint16_t, U16, teTY_U16, u16)
302 PROP_VAL_INITIALIZER(uint32_t, U32, teTY_U32, u32)
303 PROP_VAL_INITIALIZER(uint64_t, U64, teTY_U64, u64)
304 
305 PROP_VAL_INITIALIZER(int8_t, I8, teTY_I8, i8)
306 PROP_VAL_INITIALIZER(int16_t, I16, teTY_I16, i16)
307 PROP_VAL_INITIALIZER(int32_t, I32, teTY_I32, i32)
308 PROP_VAL_INITIALIZER(int64_t, I64, teTY_I64, i64)
309 
310 PROP_VAL_INITIALIZER(void*, Obj, teTY_Obj, Obj)
312 
319 typedef void (*temu_PropWriter)(void *Obj, temu_Propval Pv, int Idx);
320 
327 typedef temu_Propval (*temu_PropReader)(void *Obj, int Idx);
328 
329 
335 temu_Propref temu_getPropref(const void *Obj, const char *PropName);
336 int temu_getPropLength(const void *Obj, const char *PropName);
337 int temu_getPropDynLength(const void *Obj, const char *PropName);
338 
340 int temu_isReal(temu_Propval Pv);
343 
344 int64_t temu_asInteger(temu_Propval Pv);
345 uint64_t temu_asUnsigned(temu_Propval Pv);
346 double temu_asDouble(temu_Propval Pv);
347 
348 /*
349  Get and read value are different
350 
351  Get value has no side effects, while read value may have side effects.
352  */
354 temu_getValue(void *Obj, const char *PropName, int Idx) TEMU_NO_WRAP;
355 
356 // Python CTYPES does not like the anonymous union in propval.
357 uint8_t temu_getValueU8(void *Obj, const char *PropName, int Idx);
358 uint16_t temu_getValueU16(void *Obj, const char *PropName, int Idx);
359 uint32_t temu_getValueU32(void *Obj, const char *PropName, int Idx);
360 uint64_t temu_getValueU64(void *Obj, const char *PropName, int Idx);
361 
362 int8_t temu_getValueI8(void *Obj, const char *PropName, int Idx);
363 int16_t temu_getValueI16(void *Obj, const char *PropName, int Idx);
364 int32_t temu_getValueI32(void *Obj, const char *PropName, int Idx);
365 int64_t temu_getValueI64(void *Obj, const char *PropName, int Idx);
366 
378 temu_readValue(void *Obj, const char *PropName, int Idx) TEMU_NO_WRAP;
379 
380 uint8_t temu_readValueU8(void *Obj, const char *PropName, int Idx);
381 uint16_t temu_readValueU16(void *Obj, const char *PropName, int Idx);
382 uint32_t temu_readValueU32(void *Obj, const char *PropName, int Idx);
383 uint64_t temu_readValueU64(void *Obj, const char *PropName, int Idx);
384 
385 int8_t temu_readValueI8(void *Obj, const char *PropName, int Idx);
386 int16_t temu_readValueI16(void *Obj, const char *PropName, int Idx);
387 int32_t temu_readValueI32(void *Obj, const char *PropName, int Idx);
388 int64_t temu_readValueI64(void *Obj, const char *PropName, int Idx);
389 
398 void temu_setValue(void *Obj, const char *PropName, temu_Propval Val, int Idx)
399  TEMU_NO_WRAP;
400 
401 void temu_setValueU8(void *Obj, const char *PropName, uint8_t Val, int Idx);
402 void temu_setValueU16(void *Obj, const char *PropName, uint16_t Val, int Idx);
403 void temu_setValueU32(void *Obj, const char *PropName, uint32_t Val, int Idx);
404 void temu_setValueU64(void *Obj, const char *PropName, uint64_t Val, int Idx);
405 
406 void temu_setValueI8(void *Obj, const char *PropName, int8_t Val, int Idx);
407 void temu_setValueI16(void *Obj, const char *PropName, int16_t Val, int Idx);
408 void temu_setValueI32(void *Obj, const char *PropName, int32_t Val, int Idx);
409 void temu_setValueI64(void *Obj, const char *PropName, int64_t Val, int Idx);
410 
419 void temu_writeValue(void *Obj, const char *PropName, temu_Propval Val, int Idx)
420  TEMU_NO_WRAP;
421 
422 void temu_writeValueU8(void *Obj, const char *PropName, uint8_t Val, int Idx);
423 void temu_writeValueU16(void *Obj, const char *PropName, uint16_t Val, int Idx);
424 void temu_writeValueU32(void *Obj, const char *PropName, uint32_t Val, int Idx);
425 void temu_writeValueU64(void *Obj, const char *PropName, uint64_t Val, int Idx);
426 
427 void temu_writeValueI8(void *Obj, const char *PropName, int8_t Val, int Idx);
428 void temu_writeValueI16(void *Obj, const char *PropName, int16_t Val, int Idx);
429 void temu_writeValueI32(void *Obj, const char *PropName, int32_t Val, int Idx);
430 void temu_writeValueI64(void *Obj, const char *PropName, int64_t Val, int Idx);
431 
432 
433 
434 temu_Propval temu_getNamedObjectProp(const char *Obj, const char *PropName,
435  int Idx) TEMU_NO_WRAP;
436 
437 temu_Propval temu_readNamedObjectProp(const char *Obj, const char *PropName,
438  int Idx) TEMU_NO_WRAP;
439 
440 void
441 temu_setNamedObjectProp(const char *Obj, const char *PropName,
442  temu_Propval Val, int Idx) TEMU_NO_WRAP;
443 
444 void
445 temu_writeNamedObjectProp(const char *Obj, const char *PropName,
446  temu_Propval Val, int Idx) TEMU_NO_WRAP;
447 
448 
449 
450 typedef struct temu_CreateArg {
451  const char *Key;
454 
455 #define TEMU_NULL_ARG { NULL, {teTY_Invalid} }
456 
457 typedef void* (*temu_ObjectCreateFunc)(const char *Name,
458  int Argc, const temu_CreateArg *Argv);
459 typedef void (*temu_ObjectDisposeFunc)(void*);
460 
473 temu_Class*
474 temu_registerClass(const char *ClsName,
475  temu_ObjectCreateFunc Create,
476  temu_ObjectDisposeFunc Dispose);
477 
478 
488 temu_Class* temu_registerExternalClass(const char *ClsName);
489 
490 #ifdef __cplusplus
491 
509 void
510 temu_addProperty(temu_Class *Cls, const char *PropName,
511  int Offset,
512  temu_Type Typ, int Count,
513  temu_PropWriter Wr = nullptr,
514  temu_PropReader Rd = nullptr,
515  const char *Doc = "");
516 #else
517 void
518 temu_addProperty(temu_Class *Cls, const char *PropName,
519  int Offset,
520  temu_Type Typ, int Count,
521  temu_PropWriter Wr,
522  temu_PropReader Rd,
523  const char *Doc);
524 
525 #endif
526 
527 void
528 temu_requireInterface(temu_Class *Cls, const char *PropName,
529  const char *IfaceType);
530 
531 
542 #ifdef __cplusplus
543 
544 
545 void
546 temu_addInterface(temu_Class *Cls,
547  const char *IfaceName,
548  const char *IfaceType,
549  void *Iface, int Count = 0,
550  const char *Doc = "");
551 
552 void*
553 temu_getInterface(void *Obj,
554  const char *IfaceName, int Idx = 0);
555 
556 #else
557 void
558 temu_addInterface(temu_Class *Cls,
559 
560  const char *IfaceName,
561  const char *IfaceType,
562  void *Iface, int Count,
563  const char *Doc);
564 
565 void*
566 temu_getInterface(void *Obj,
567  const char *IfaceName, int Idx);
568 
569 #endif
570 
571 int temu_setVTable(temu_Class *Cls, void *VTable);
572 void* temu_getVTableForClass(temu_Class *Cls);
573 void* temu_getVTable(void *Obj);
574 
575 int temu_isExternal(void *Obj);
576 int temu_isCpu(void *Obj);
577 int temu_isMachine(void *Obj);
578 void temu_qualifyAsCpu(void *Cls);
579 void temu_qualifyAsMachine(void *Cls);
580 
581 
587 void temu_objsysClear(void);
588 
591 void temu_objsysClearObjects(void);
592 
600 void* temu_addObject(const char *ClsName, const char *ObjName, void *Obj);
601 
602 
616 void* temu_createObject(const char *ClsName, const char *ObjName,
617  const temu_CreateArg *Args);
618 
619 
620 
626 void temu_disposeObject(void *Obj);
627 
631 temu_Class* temu_classForName(const char *ClsName);
632 const char* temu_nameForClass(temu_Class *Cls);
633 
637 temu_Class* temu_classForObject(void *Obj);
638 
642 temu_Class*
643 temu_classForObjectName(const char *Obj);
644 
645 
649 void* temu_objectForName(const char *Name);
650 
654 const char* temu_nameForObject(const void *Obj);
655 
669 int temu_loadPlugin(const char *Path);
670 
674 const char* temu_typeToName(temu_Type Typ);
675 
676 
690 int temu_connect(void *A, const char *PropName, void *B, const char *IfaceName);
691 
703 int temu_serialiseJSON(const char *FileName);
704 
705 
715 int temu_deserialiseJSON(const char *FileName);
716 
717 void temu_serialiseProp(void *Ctxt, const char *Name, temu_Type Typ,
718  int Count, void *Data);
719 
720 void temu_deserialiseProp(void *Ctxt, void *Obj, const char *Name);
721 
722 int temu_checkpointGetLength(void *Ctxt, const char *Name);
723 temu_Propval temu_checkpointGetValue(void *Ctxt, const char *Name, int Idx);
724 
736 int temu_checkSanity(int Report);
737 
738 
752 int temu_generateObjectGraph(const char *Path, int Display);
753 
754 
759 typedef struct {
760  void (*serialise)(void *Obj, const char *BaseName, void *Ctxt); // Optional
761  void (*deserialise)(void *Obj, const char *BaseName, void *Ctxt); // Optional
762 
769  int (*checkSanity)(void *Obj, int Report); // Optional
771 
773 
774 #ifdef __cplusplus
775 }
776 #endif
777 
778 
779 #endif
void temu_writeValue(void *Obj, const char *PropName, temu_Propval Val, int Idx) TEMU_NO_WRAP
void * temu_objectForName(const char *Name)
uintptr_t UIntPtr
Definition: Objsys.h:244
int16_t i16
Definition: Objsys.h:255
temu_Type
Definition: Objsys.h:186
void temu_objsysClearObjects(void)
void temu_serialiseProp(void *Ctxt, const char *Name, temu_Type Typ, int Count, void *Data)
int temu_isMachine(void *Obj)
void(* temu_PropWriter)(void *Obj, temu_Propval Pv, int Idx)
Definition: Objsys.h:319
void temu_deserialiseProp(void *Ctxt, void *Obj, const char *Name)
temu_Class * temu_registerExternalClass(const char *ClsName)
int temu_getPropLength(const void *Obj, const char *PropName)
void temu_writeValueI32(void *Obj, const char *PropName, int32_t Val, int Idx)
double d
Definition: Objsys.h:247
uint64_t temu_getValueU64(void *Obj, const char *PropName, int Idx)
int temu_isDiscrete(temu_Propval Pv)
void temu_qualifyAsMachine(void *Cls)
int8_t temu_getValueI8(void *Obj, const char *PropName, int Idx)
void temu_setValueU32(void *Obj, const char *PropName, uint32_t Val, int Idx)
int temu_isReal(temu_Propval Pv)
void temu_setValueU8(void *Obj, const char *PropName, uint8_t Val, int Idx)
uint16_t u16
Definition: Objsys.h:250
const char * temu_nameForClass(temu_Class *Cls)
uint32_t Size
Definition: Objsys.h:56
int temu_generateObjectGraph(const char *Path, int Display)
void temu_setValueU16(void *Obj, const char *PropName, uint16_t Val, int Idx)
int temu_connect(void *A, const char *PropName, void *B, const char *IfaceName)
int8_t i8
Definition: Objsys.h:254
#define TEMU_DYN_ARRAY_TYPE(T, P)
Definition: Objsys.h:141
temu_Class * temu_classForObjectName(const char *Obj)
uint16_t temu_getValueU16(void *Obj, const char *PropName, int Idx)
intptr_t IntPtr
Definition: Objsys.h:243
int temu_isString(temu_Propval Pv)
int32_t i32
Definition: Objsys.h:256
temu_Class * temu_classForObject(void *Obj)
void temu_writeValueU64(void *Obj, const char *PropName, uint64_t Val, int Idx)
int16_t temu_readValueI16(void *Obj, const char *PropName, int Idx)
void * Ptr
Definition: Objsys.h:230
uint8_t temu_readValueU8(void *Obj, const char *PropName, int Idx)
void temu_addProperty(temu_Class *Cls, const char *PropName, int Offset, temu_Type Typ, int Count, temu_PropWriter Wr, temu_PropReader Rd, const char *Doc)
struct temu_IfaceRef temu_IfaceRef
int temu_getPropDynLength(const void *Obj, const char *PropName)
int8_t temu_readValueI8(void *Obj, const char *PropName, int Idx)
temu_IfaceRef * Ifaces
Definition: Objsys.h:58
int64_t temu_asInteger(temu_Propval Pv)
const char * Key
Definition: Objsys.h:451
struct temu_IfaceRefArray temu_IfaceRefArray
uint32_t u32
Definition: Objsys.h:251
void temu_writeNamedObjectProp(const char *Obj, const char *PropName, temu_Propval Val, int Idx) TEMU_NO_WRAP
void temu_addInterface(temu_Class *Cls, const char *IfaceName, const char *IfaceType, void *Iface, int Count, const char *Doc)
void temu_setValueI8(void *Obj, const char *PropName, int8_t Val, int Idx)
temu_Propval temu_getValue(void *Obj, const char *PropName, int Idx) TEMU_NO_WRAP
uint8_t temu_getValueU8(void *Obj, const char *PropName, int Idx)
void temu_writeValueU16(void *Obj, const char *PropName, uint16_t Val, int Idx)
void temu_Class
Definition: Objsys.h:37
void temu_setNamedObjectProp(const char *Obj, const char *PropName, temu_Propval Val, int Idx) TEMU_NO_WRAP
temu_Propval temu_readNamedObjectProp(const char *Obj, const char *PropName, int Idx) TEMU_NO_WRAP
uint8_t u8
Definition: Objsys.h:249
void * temu_getVTableForClass(temu_Class *Cls)
int temu_isNumber(temu_Propval Pv)
void temu_MetaIface
Definition: Objsys.h:38
uint64_t temu_asUnsigned(temu_Propval Pv)
temu_IfaceRefArray temu_ifaceRefArrayAlloc(unsigned Reserve)
temu_Propval temu_getNamedObjectProp(const char *Obj, const char *PropName, int Idx) TEMU_NO_WRAP
int temu_checkpointGetLength(void *Ctxt, const char *Name)
temu_Type Typ
Definition: Objsys.h:241
int temu_isCpu(void *Obj)
#define TEMU_IFACE_REFERENCE_TYPE(N)
Definition: Objsys.h:95
void * temu_addObject(const char *ClsName, const char *ObjName, void *Obj)
void * temu_createObject(const char *ClsName, const char *ObjName, const temu_CreateArg *Args)
void temu_setValueI64(void *Obj, const char *PropName, int64_t Val, int Idx)
uint32_t Reserved
Definition: Objsys.h:57
void temu_requireInterface(temu_Class *Cls, const char *PropName, const char *IfaceType)
void temu_writeValueI64(void *Obj, const char *PropName, int64_t Val, int Idx)
void temu_ifaceRefArrayDispose(temu_IfaceRefArray *Arr)
void temu_writeValueI8(void *Obj, const char *PropName, int8_t Val, int Idx)
void temu_setValue(void *Obj, const char *PropName, temu_Propval Val, int Idx) TEMU_NO_WRAP
void * Obj
Definition: Objsys.h:259
temu_Propval Val
Definition: Objsys.h:452
const char * temu_typeToName(temu_Type Typ)
void *(* temu_ObjectCreateFunc)(const char *Name, int Argc, const temu_CreateArg *Argv)
Definition: Objsys.h:457
int16_t temu_getValueI16(void *Obj, const char *PropName, int Idx)
temu_Propval temu_readValue(void *Obj, const char *PropName, int Idx) TEMU_NO_WRAP
int32_t temu_getValueI32(void *Obj, const char *PropName, int Idx)
void temu_objsysClear(void)
void * temu_getVTable(void *Obj)
void(* temu_ObjectDisposeFunc)(void *)
Definition: Objsys.h:459
struct temu_Propref temu_Propref
int temu_loadPlugin(const char *Path)
uint32_t temu_readValueU32(void *Obj, const char *PropName, int Idx)
temu_IfaceRef IfaceRef
Definition: Objsys.h:260
double temu_asDouble(temu_Propval Pv)
void temu_ifaceRefArrayPush(temu_IfaceRefArray *Arr, temu_IfaceRef Iface)
uint64_t temu_readValueU64(void *Obj, const char *PropName, int Idx)
const char * temu_nameForObject(const void *Obj)
const char * String
Definition: Objsys.h:262
temu_Propval(* temu_PropReader)(void *Obj, int Idx)
Definition: Objsys.h:327
void temu_disposeObject(void *Obj)
void temu_setValueI16(void *Obj, const char *PropName, int16_t Val, int Idx)
void * Obj
Definition: Objsys.h:47
int temu_checkSanity(int Report)
void temu_ifaceRefArrayPush2(temu_IfaceRefArray *Arr, void *Obj, void *Iface)
int64_t i64
Definition: Objsys.h:257
int64_t temu_getValueI64(void *Obj, const char *PropName, int Idx)
int temu_setVTable(temu_Class *Cls, void *VTable)
temu_Class * temu_classForName(const char *ClsName)
int32_t temu_readValueI32(void *Obj, const char *PropName, int Idx)
void temu_setValueI32(void *Obj, const char *PropName, int32_t Val, int Idx)
#define PROP_VAL_INITIALIZER(typ, suffix, typetag, valtag)
Definition: Objsys.h:277
void temu_writeValueU32(void *Obj, const char *PropName, uint32_t Val, int Idx)
#define TEMU_NO_WRAP
Definition: Objsys.h:34
temu_Class * temu_registerClass(const char *ClsName, temu_ObjectCreateFunc Create, temu_ObjectDisposeFunc Dispose)
uint16_t temu_readValueU16(void *Obj, const char *PropName, int Idx)
temu_Propref temu_getPropref(const void *Obj, const char *PropName)
void * Iface
Definition: Objsys.h:48
int temu_deserialiseJSON(const char *FileName)
int temu_isExternal(void *Obj)
uint64_t u64
Definition: Objsys.h:252
void temu_setValueU64(void *Obj, const char *PropName, uint64_t Val, int Idx)
void temu_qualifyAsCpu(void *Cls)
int64_t temu_readValueI64(void *Obj, const char *PropName, int Idx)
float f
Definition: Objsys.h:246
void temu_writeValueI16(void *Obj, const char *PropName, int16_t Val, int Idx)
temu_IfaceRefArray IfaceRefArray
Definition: Objsys.h:261
temu_Class * Class
Definition: Objsys.h:41
unsigned temu_ifaceRefArraySize(temu_IfaceRefArray *Arr)
void * temu_getInterface(void *Obj, const char *IfaceName, int Idx)
void temu_writeValueU8(void *Obj, const char *PropName, uint8_t Val, int Idx)
struct temu_CreateArg temu_CreateArg
struct temu_Propval temu_Propval
int temu_serialiseJSON(const char *FileName)
uint32_t temu_getValueU32(void *Obj, const char *PropName, int Idx)
temu_Type Typ
Definition: Objsys.h:229
temu_Propval temu_checkpointGetValue(void *Ctxt, const char *Name, int Idx)