* Updated header: Added 2006. Changed address of FSF. Changed email
[cacao.git] / src / vm / suck.h
index c0ae3f0922599bfe83fa7197e102f3f9b50a1b89..41feb42a254059e491d556c12ecea80de7feb011 100644 (file)
@@ -1,9 +1,9 @@
 /* src/vm/suck.h - functions to read LE ordered types from a buffer
 
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-   Institut f. Computersprachen - TU Wien
+   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
+   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
+   J. Wenninger, Institut f. Computersprachen - TU Wien
 
    This file is part of CACAO.
 
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
 
-   Contact: cacao@complang.tuwien.ac.at
+   Contact: cacao@cacaojvm.org
 
    Authors: Christian Thalinger
 
    Changes:
 
-   $Id: suck.h 3936 2005-12-10 23:58:29Z twisti $
+   $Id: suck.h 4357 2006-01-22 23:33:38Z twisti $
 
 */
 
@@ -61,8 +61,8 @@ struct list_classpath_entry {
        s4                 type;
        char              *path;
        s4                 pathlen;
-#if defined(USE_ZLIB) 
-       hashtable         *classes;
+#if defined(ENABLE_ZLIB)
+       hashtable         *htclasses;
 #endif
        listnode           linkage;
 };
@@ -70,14 +70,16 @@ struct list_classpath_entry {
 
 /* macros to read LE and BE types from a buffer ********************************
 
-   BE macros are for class file loading.
+   BE macros are for Java class file loading.
    LE macros are for ZIP file loading.
 
 *******************************************************************************/
 
-#if WORDS_BIGENDIAN == 0
+/* LE macros (for ZIP files ) *************************************************/
 
-/* we can optimize the LE access on little endian machines */
+#if defined(__I386__) || defined(__X86_64__)
+
+/* we can optimize the LE access on little endian machines without alignment */
 
 #define SUCK_LE_U1(p)    *((u1 *) (p))
 #define SUCK_LE_U2(p)    *((u2 *) (p))
@@ -87,32 +89,7 @@ struct list_classpath_entry {
 #define SUCK_LE_U8(p)    *((u8 *) (p))
 #endif
 
-#define SUCK_BE_U1(p) \
-      ((u1) (p)[0])
-
-#define SUCK_BE_U2(p) \
-    ((((u2) (p)[0]) << 8) + \
-      ((u2) (p)[1]))
-
-#define SUCK_BE_U4(p) \
-    ((((u4) (p)[0]) << 24) + \
-     (((u4) (p)[1]) << 16) + \
-     (((u4) (p)[2]) << 8) + \
-      ((u4) (p)[3]))
-
-#if U8_AVAILABLE == 1
-#define SUCK_BE_U8(p) \
-    ((((u8) (p)[0]) << 56) + \
-     (((u8) (p)[1]) << 48) + \
-     (((u8) (p)[2]) << 40) + \
-     (((u8) (p)[3]) << 32) + \
-     (((u8) (p)[4]) << 24) + \
-     (((u8) (p)[5]) << 16) + \
-     (((u8) (p)[6]) << 8) + \
-      ((u8) (p)[7]))
-#endif
-
-#else /* WORDS_BIGENDIAN == 0 */
+#else /* defined(__I386__) || defined(__X86_64__) */
 
 #define SUCK_LE_U1(p) \
       ((u1) (p)[0])
@@ -139,11 +116,10 @@ struct list_classpath_entry {
       ((u8) (p)[0]))
 #endif
 
-/* we can optimize the BE access on big endian machines */
+#endif /* defined(__I386__) || defined(__X86_64__) */
 
-#if defined(__MIPS__)
 
-/* MIPS needs aligned access */
+/* BE macros (for Java class files ) ******************************************/
 
 #define SUCK_BE_U1(p) \
       ((u1) (p)[0])
@@ -170,20 +146,6 @@ struct list_classpath_entry {
       ((u8) (p)[7]))
 #endif
 
-#else /* defined(__MIPS__) */
-
-#define SUCK_BE_U1(p)    *((u1 *) (p))
-#define SUCK_BE_U2(p)    *((u2 *) (p))
-#define SUCK_BE_U4(p)    *((u4 *) (p))
-
-#if U8_AVAILABLE == 1
-#define SUCK_BE_U8(p)    *((u8 *) (p))
-#endif
-
-#endif /* defined(__MIPS__) */
-
-#endif /* WORDS_BIGENDIAN == 0 */
-
 
 /* signed suck defines ********************************************************/
 
@@ -195,6 +157,9 @@ struct list_classpath_entry {
 
 /* export variables ***********************************************************/
 
+extern char *bootclasspath;
+extern char *classpath;
+
 extern list *list_classpath_entries;
 
 
@@ -203,6 +168,7 @@ extern list *list_classpath_entries;
 bool suck_init(void);
 
 void suck_add(char *classpath);
+void suck_add_from_property(char *key);
 
 bool suck_check_classbuffer_size(classbuffer *cb, s4 len);