/* * $Id$ * * Code (c)2006 Bruno Cornec * * Main file of mr_err : a very small and simple * library for error management * * Provided under the GPLv2 */ #include #include #include "mr_msg.h" /* This should be a pointer to func setup by the main function */ /* Highly incomplete function for the moment */ static void mr_cleanup(void) { /* We have to free all allocated memory */ /* We have to remove all temporary files */ /* We have to unmount what has been mounted */ /* We have to properly end newt */ /* We have to remind people of log files */ } /* * Function that frees memory if necessary */ void mr_exit(int errorcode, const char *message) { mr_cleanup(); fprintf(stderr,"%s\n",message); exit(errorcode); } void mr_log_exit(int errorcode, const char *message) { mr_msg(0,message); mr_exit(errorcode, message); }