/* Stubby - Generate stubs for dynamic-link libraries.
 * Copyright 1999 Tom Rothamel
 *
 * Stubby is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version. It is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details. 
 * 
 * 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
 * 
 * This program generates another computer program. I do not assert a      
 * copyright on the generated program that is the normal output of this    
 * program. This is _not_, however, an authorization for you to modify     
 * this program to cause it to output more of itself than necessary for    
 * its proper operation in order to circumvent my copyright.               
 */

#ifndef STUBBY_H
#define STUBBY_H

#include <stdio.h>
#include "pte.h"

	
extern int yylineno;

#define error(fmt, args...) \
	fprintf(stderr, "stubby error: %s %d: " fmt "\n", infile, \
	yylineno , ## args)
	
#define warn(fmt, args...) \
	fprintf(stderr, "stubby warning: %s %d: " fmt "\n", infile, \
	yylineno , ## args)
	
#define debug(fmt, args...) \
	fprintf(stderr, "stubby debug: %s %d: " fmt "\n", infile, \
	yylineno , ## args)


/* codegen.c */
extern FILE *of;

void finish_library();
void load(char *);
void library(char *, char *);
void definition(PTE *);

/* clexer.l */

extern FILE *yyin;
void include(char *);

/* cparser.y */

extern int yydebug;
int yyparse();

/* stubby.c */

extern char *infile;
extern char *libdir;
extern char *dl_type;

/* type.c */ 

void init_typehash();
void add_type(char *);
int istype(char *);

#endif
