OSDN Git Service

Add - before rms to be more portable.
[pf3gnuchains/gcc-fork.git] / gcc / java / jcf.h
index bcf69b7..eaeb905 100644 (file)
@@ -1,6 +1,6 @@
 /* Utility macros to read Java(TM) .class files and byte codes.
 
-   Copyright (C) 1996, 97-98, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -38,11 +38,11 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 #endif
 #endif /* !DEFUN */
 
-#ifndef PROTO
+#ifndef PARAMS
 #if defined (__STDC__)
-#define PROTO(paramlist)    paramlist
+#define PARAMS (paramlist)    paramlist
 #else
-#define PROTO(paramlist)    ()
+#define PARAMS (paramlist)    ()
 #endif
 #endif
 
@@ -53,8 +53,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 #define JCF_u2 unsigned short
 #endif
 
-#define ALLOC (void*)malloc
-#define REALLOC (void*)realloc
+#define ALLOC xmalloc
+#define REALLOC xrealloc
 #ifndef FREE
 #define FREE(PTR) free(PTR)
 #endif
@@ -68,7 +68,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 #define JCF_SOURCE 3
 
 struct JCF;
-typedef int (*jcf_filbuf_t) PROTO ((struct JCF*, int needed));
+typedef int (*jcf_filbuf_t) PARAMS ((struct JCF*, int needed));
 
 typedef struct CPool {
   /* Available number of elements in the constants array, before it
@@ -92,13 +92,11 @@ typedef struct JCF {
   unsigned char *read_end;
   int seen_in_zip;
   int java_source;
-  int  outofsynch;             /* Found a class file out of synch
-                                  with the matching source file. */
   long zip_offset;    
   jcf_filbuf_t filbuf;
   void *read_state;
-  char *filename;
-  char *classname;
+  const char *filename;
+  const char *classname;
   void *zipd;                  /* Directory entry where it was found */
   JCF_u2 access_flags, this_class, super_class;
   CPool cpool;
@@ -133,7 +131,7 @@ typedef struct JCF {
 #define JPOOL_UTF_DATA(JCF, INDEX) \
   ((JCF)->buffer+JPOOL_UINT(JCF, INDEX)+2)
 #endif
-#define JPOOL_INT(JCF, INDEX) ((jint) JPOOL_UINT (JCF, INDEX))
+#define JPOOL_INT(JCF, INDEX) (WORD_TO_INT(JPOOL_UINT (JCF, INDEX)))
 #define JPOOL_FLOAT(JCF, INDEX) WORD_TO_FLOAT (JPOOL_UINT (JCF, INDEX))
 
 #define CPOOL_INDEX_IN_RANGE(CPOOL, INDEX) \
@@ -146,8 +144,8 @@ typedef struct JCF {
 #define JCF_FINISH(JCF) { \
   CPOOL_FINISH(&(JCF)->cpool); \
   if ((JCF)->buffer) FREE ((JCF)->buffer); \
-  if ((JCF)->filename) FREE ((JCF)->filename); \
-  if ((JCF)->classname) FREE ((JCF)->classname); }
+  if ((JCF)->filename) FREE ((char *) (JCF)->filename); \
+  if ((JCF)->classname) FREE ((char *) (JCF)->classname); }
   
 #define CPOOL_INIT(CPOOL) \
   ((CPOOL)->capacity = 0, (CPOOL)->count = 0, (CPOOL)->tags = 0, (CPOOL)->data = 0)
@@ -208,6 +206,8 @@ typedef struct JCF {
 #define ACC_INTERFACE 0x0200
 #define ACC_ABSTRACT 0x0400
 
+#define ACC_VISIBILITY (ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED)
+
 #define CONSTANT_Class 7
 #define CONSTANT_Fieldref 9
 #define CONSTANT_Methodref 10
@@ -223,11 +223,10 @@ typedef struct JCF {
 
 #define DEFAULT_CLASS_PATH "."
 
-extern const char *find_class PROTO ((const char *, int, JCF*, int));
-extern const char *find_classfile PROTO ((char *, JCF*, const char *));
-extern int jcf_filbuf_from_stdio PROTO ((JCF *jcf, int count));
-extern void jcf_out_of_synch PROTO((JCF *));
-extern int jcf_unexpected_eof PROTO ((JCF*, int)) ATTRIBUTE_NORETURN;
+extern const char *find_class PARAMS ((const char *, int, JCF*, int));
+extern const char *find_classfile PARAMS ((char *, JCF*, const char *));
+extern int jcf_filbuf_from_stdio PARAMS ((JCF *jcf, int count));
+extern int jcf_unexpected_eof PARAMS ((JCF*, int)) ATTRIBUTE_NORETURN;
 
 /* Extract a character from a Java-style Utf8 string.
  * PTR points to the current character.
@@ -258,25 +257,26 @@ extern int quiet_flag;
 #endif
 
 /* Declarations for dependency code.  */
-extern void jcf_dependency_reset PROTO ((void));
-extern void jcf_dependency_set_target PROTO ((const char *));
-extern void jcf_dependency_add_target PROTO ((const char *));
-extern void jcf_dependency_set_dep_file PROTO ((const char *));
-extern void jcf_dependency_add_file PROTO ((const char *, int));
-extern void jcf_dependency_write PROTO ((void));
-extern void jcf_dependency_init PROTO ((int));
+extern void jcf_dependency_reset PARAMS ((void));
+extern void jcf_dependency_set_target PARAMS ((const char *));
+extern void jcf_dependency_add_target PARAMS ((const char *));
+extern void jcf_dependency_set_dep_file PARAMS ((const char *));
+extern void jcf_dependency_add_file PARAMS ((const char *, int));
+extern void jcf_dependency_write PARAMS ((void));
+extern void jcf_dependency_init PARAMS ((int));
+extern void jcf_dependency_print_dummies PARAMS ((void));
 
 /* Declarations for path handling code.  */
-extern void jcf_path_init PROTO ((void));
-extern void jcf_path_classpath_arg PROTO ((const char *));
-extern void jcf_path_CLASSPATH_arg PROTO ((const char *));
-extern void jcf_path_include_arg PROTO ((const char *));
-extern void jcf_path_seal PROTO ((void));
-extern void *jcf_path_start PROTO ((void));
-extern void *jcf_path_next PROTO ((void *));
-extern char *jcf_path_name PROTO ((void *));
-extern int jcf_path_is_zipfile PROTO ((void *));
-extern int jcf_path_is_system PROTO ((void *));
-extern int jcf_path_max_len PROTO ((void));
+extern void jcf_path_init PARAMS ((void));
+extern void jcf_path_classpath_arg PARAMS ((const char *));
+extern void jcf_path_CLASSPATH_arg PARAMS ((const char *));
+extern void jcf_path_include_arg PARAMS ((const char *));
+extern void jcf_path_seal PARAMS ((void));
+extern void *jcf_path_start PARAMS ((void));
+extern void *jcf_path_next PARAMS ((void *));
+extern char *jcf_path_name PARAMS ((void *));
+extern int jcf_path_is_zipfile PARAMS ((void *));
+extern int jcf_path_is_system PARAMS ((void *));
+extern int jcf_path_max_len PARAMS ((void));
 
 #endif