* SUPPORT_FMOD: Removed.
[cacao.git] / src / vm / linker.h
index 784af09b4880131cbe276ec77c6b040803ebdbf3..3bb58acfc38ceb12d4abf85783a7923af33a4226 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: linker.h 2101 2005-03-28 21:59:45Z twisti $
+   $Id: linker.h 3266 2005-09-21 20:20:48Z twisti $
 */
 
 
 /* forward typedefs ***********************************************************/
 
 typedef struct _vftbl vftbl_t;
+typedef struct arraydescriptor arraydescriptor;
+typedef struct primitivetypeinfo primitivetypeinfo;
 
 
 #include "vm/class.h"
+#include "vm/references.h"
 
 
 /* virtual function table ******************************************************
@@ -115,10 +118,54 @@ struct _vftbl {
 };
 
 
+/* arraydescriptor *************************************************************
+
+   For every array class an arraydescriptor is allocated which
+   describes the array class. The arraydescriptor is referenced from
+   the vftbl of the array class.
+
+*******************************************************************************/
+
+struct arraydescriptor {
+       vftbl_t *componentvftbl; /* vftbl of the component type, NULL for primit. */
+       vftbl_t *elementvftbl;   /* vftbl of the element type, NULL for primitive */
+       s2       arraytype;      /* ARRAYTYPE_* constant                          */
+       s2       dimension;      /* dimension of the array (always >= 1)          */
+       s4       dataoffset;     /* offset of the array data from object pointer  */
+       s4       componentsize;  /* size of a component in bytes                  */
+       s2       elementtype;    /* ARRAYTYPE_* constant                          */
+};
+
+
+/* primitivetypeinfo **********************************************************/
+
+struct primitivetypeinfo {
+       classinfo *class_wrap;               /* class for wrapping primitive type */
+       classinfo *class_primitive;          /* primitive class                   */
+       char      *wrapname;                 /* name of class for wrapping        */
+       char       typesig;                  /* one character type signature      */
+       char      *name;                     /* name of primitive class           */
+       char      *arrayname;                /* name of primitive array class     */
+       classinfo *arrayclass;               /* primitive array class             */
+       vftbl_t   *arrayvftbl;               /* vftbl of primitive array class    */
+};
+
+
+/* global variables ***********************************************************/
+
+/* This array can be indexed by the PRIMITIVETYPE_ and ARRAYTYPE_ constants   */
+/* (except ARRAYTYPE_OBJECT).                                                 */
+
+extern primitivetypeinfo primitivetype_table[PRIMITIVETYPE_COUNT];
+
+
 /* function prototypes ********************************************************/
 
-void linker_init(void);
-classinfo *class_link(classinfo *c);
+/* initialize the linker subsystem */
+bool linker_init(void);
+
+/* link a class */
+classinfo *link_class(classinfo *c);
 
 #endif /* _LINKER_H */