/* Error message utilities V1.00 27/8/04
   Copyright 2008 Jeffrey Lee
   This file is part of WOUM.
   WOUM 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 3 of the License, or
   (at your option) any later version.
   WOUM 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 WOUM.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _ERROR_H
#define _ERROR_H

extern void (*warning_func)(char *msg); /* Optional function to send warning messages to */

#define warning(Args...) _warning(__FILE__,__LINE__,Args) /* fprintf(stderr,Args) warning message + send to warning_func below if possible */
#define error(Args...) _error(__FILE__,__LINE__,Args) /* fprintf(stderr,Args) error message & quit */

extern void _warning(char *file,int line,char *fmt,...);
extern void _error(char *file,int line,char *fmt,...) __attribute__ ((noreturn));

#endif
