/*
 * $Id: jexc.h,v 1.3 2000/09/05 15:08:56 m-hirano Exp $
 * $RWC_Release: Omni-1.6 $
 * $RWC_Copyright:
 *  Omni Compiler Software Version 1.5-1.6
 *  Copyright (C) 2002 PC Cluster Consortium
 *  
 *  This software is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License version
 *  2.1 published by the Free Software Foundation.
 *  
 *  Omni Compiler Software Version 1.0-1.4
 *  Copyright (C) 1999, 2000, 2001.
 *   Tsukuba Research Center, Real World Computing Partnership, Japan.
 *  
 *  Please check the Copyright and License information in the files named
 *  COPYRIGHT and LICENSE under the top  directory of the Omni Compiler
 *  Software release kit.
 *  
 *  
 *  $
 */

#include "exc_platform.h"
#include "class_file.h"

#define MAX_STRING_CONSTANT 4096
#define JEXC_TEMP_FILE_NAME "jexc.out.c"

#define ROUND(x,y)	(((x)+(y)-1)/(y))*(y)
#define MAX(x,y)	((x)>(y)? (x):(y))
#define MIN(x,y)	((x)<(y)? (x):(y))

extern int debug_flag;
extern int dump_flag;
extern int nerrors;

extern class_file *class_files;
extern class_file *class_root,*class_tail;

extern int string_count;
extern int method_count;
extern int class_count;

extern char *main_class_name;

void jexc_init(void);
void input_class_file(char *file);
void jexc_translate(char *outfile);
class_file *find_class(char *name);
field_info *find_field(class_file *cfp,char *name, char *desc);
method_info *find_method(class_file *cfp,char *name, char *desc);

int data_type_size(DATA_TYPE type);
int data_type_align(DATA_TYPE type);

void output_methods(class_file *cfp,FILE *fp);

void error EXC_VARARGS(char *, fmt);
void fatal EXC_VARARGS(char *, fmt);

void init_opcode_table(void);
void init_sys_class(void);
void dump_class_file(FILE *fp, class_file *cfp);

int get_desc_narg(char *desc);

char *xmalloc(int size);
