00001 /************************************************************************** 00002 *** 00003 *** Copyright (c) 1995-2000 Regents of the University of California, 00004 *** Andrew E. Caldwell, Andrew B. Kahng and Igor L. Markov 00005 *** Copyright (c) 2000-2004 Regents of the University of Michigan, 00006 *** Saurabh N. Adya, Jarrod A. Roy and Igor L. Markov 00007 *** 00008 *** Contact author(s): abk@cs.ucsd.edu, imarkov@umich.edu 00009 *** Original Affiliation: UCLA, Computer Science Department, 00010 *** Los Angeles, CA 90095-1596 USA 00011 *** 00012 *** Permission is hereby granted, free of charge, to any person obtaining 00013 *** a copy of this software and associated documentation files (the 00014 *** "Software"), to deal in the Software without restriction, including 00015 *** without limitation 00016 *** the rights to use, copy, modify, merge, publish, distribute, sublicense, 00017 *** and/or sell copies of the Software, and to permit persons to whom the 00018 *** Software is furnished to do so, subject to the following conditions: 00019 *** 00020 *** The above copyright notice and this permission notice shall be included 00021 *** in all copies or substantial portions of the Software. 00022 *** 00023 *** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00024 *** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 00025 *** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00026 *** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 00027 *** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 00028 *** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 00029 *** THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00030 *** 00031 *** 00032 ***************************************************************************/ 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 // June 18, 1997 Igor Markov VLSI CAD UCLA ABKGROUP 00044 00045 // 970718 ilm added a hack to output only a significant 00046 // part of filenames in error messages 00047 // 970924 ilm added #include "pathDelim.h" and deleted equivalent functionlty 00048 00049 #ifdef _MSC_VER 00050 #pragma warning(disable:4786) 00051 #endif 00052 00053 #include <stdio.h> 00054 #include "abkassert.h" 00055 #include "abkstring.h" 00056 #include "pathDelims.h" 00057 00058 00059 void abkassert_stop_here() {} 00060 void abkguess_stop_here() {} 00061 void abkfatal_stop_here() {} 00062 void abkwarn_stop_here() {} 00063 00064 const char* SgnPartOfFileName(const char * fileName) 00065 { 00066 const char *sp=fileName; 00067 const char *leftDelim=strchr(fileName,pathDelim); 00068 const char *rightDelim=strrchr(fileName,pathDelim); 00069 while(leftDelim!=rightDelim) 00070 { 00071 sp=++leftDelim; 00072 leftDelim=strchr(sp,pathDelim); 00073 } 00074 return sp; 00075 // static_cast<void>(pathDelimWindows); 00076 // static_cast<void>(pathDelimUnix); 00077 } 00078 00079 char* BaseFileName(char *fileName) 00080 { 00081 char *leftDelim=strrchr(fileName,pathDelim); 00082 if (leftDelim) leftDelim++; 00083 else leftDelim=fileName; 00084 char *rightDelim=strrchr(leftDelim,'.'); 00085 if (rightDelim) *rightDelim='\0'; 00086 return leftDelim; 00087 }