/*
 * phc -- the open source PHP compiler
 * See license/README.license for licensing information
 * 
 * Error handling 
 */

#ifndef PHC_ERROR
#define PHC_ERROR

#include <stdarg.h>
#include <phc/lib/String.h>

void error(int code, String* filename, int line, ...);
void warning(int code, String* filename, int line, ...);

// Errors and warnings use the same codes and messages.

// Messages for these errors are defined in error.cpp
// Note that the numbers are important becaues they refer to indices in
// the error message array defined in error.cpp
#define ERR_BISON 						1
#define ERR_EXPECT_VAR 					2
#define ERR_FOREACH_KEY_REF				3
#define ERR_ABSTRACT_VARS				4
#define ERR_FINAL_VARS					5
#define ERR_XML_PARSE					6
#define ERR_NO_XML_SUPPORT				7
#define ERR_PLUGIN_NOT_FOUND			8 
#define ERR_PLUGIN_INVALID				9
#define ERR_FILE_NOT_FOUND				10	
#define ERR_INTERNAL					255

#define WARNING_INCLUDE_FAILED			1
#define WARNING_INCLUDE_RETURN			2
#define WARNING_XML						3
#define WARNING_UNKNOWN_ATTRIBUTE		4

#endif
