00001 /****************************************************************************/ 00002 /* */ 00003 /* This file is part of QSopt_ex. */ 00004 /* */ 00005 /* (c) Copyright 2006 by David Applegate, William Cook, Sanjeeb Dash, */ 00006 /* and Daniel Espinoza */ 00007 /* */ 00008 /* Sanjeeb Dash ownership of copyright in QSopt_ex is derived from his */ 00009 /* copyright in QSopt. */ 00010 /* */ 00011 /* This code may be used under the terms of the GNU General Public License */ 00012 /* (Version 2.1 or later) as published by the Free Software Foundation. */ 00013 /* */ 00014 /* Alternatively, use is granted for research purposes only. */ 00015 /* */ 00016 /* It is your choice of which of these two licenses you are operating */ 00017 /* under. */ 00018 /* */ 00019 /* We make no guarantees about the correctness or usefulness of this code. */ 00020 /* */ 00021 /****************************************************************************/ 00022 00023 /* RCSINFO $Id: exception.c,v 1.2 2003/11/05 16:47:22 meven Exp $ */ 00024 #include "except.h" 00025 #include <stdio.h> 00026 #include <string.h> 00027 #ifdef USEDMALLOC 00028 #include "dmalloc.h" 00029 #endif 00030 00031 00032 void ILL_report ( 00033 const char *msg, 00034 const char *fct, 00035 const char *file, 00036 unsigned int line, 00037 int with_src_info) 00038 { 00039 if (msg != NULL) 00040 { 00041 fprintf (stderr, "FAILURE: %s", msg); 00042 if (msg[strlen (msg) - 1] != '\n') 00043 { 00044 fprintf (stderr, "\n"); 00045 } 00046 if (with_src_info == 1) 00047 { 00048 fprintf (stderr, "\t"); 00049 if (fct != NULL) 00050 { 00051 fprintf (stderr, "in function %s ", fct); 00052 } 00053 fprintf (stderr, "in file %s line %d", file, line); 00054 } 00055 fprintf (stderr, ".\n"); 00056 } 00057 } 00058 00059 /* by default we turn off verbose messages of singular basis */ 00060 int __QS_SB_VERB = 1000;
1.4.7