X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=include%2Fctsupport.h;h=58274ee3039a9e37c7157a73f3dbcb7a70eef987;hp=f1800919f5e05df620af48d1a20352d2fc98ce5d;hb=3e346e67f7f7a331919a32439b0f54a4d53d3029;hpb=949b7c917af311cd38f911bc5d0af36f524a6086 diff --git a/include/ctsupport.h b/include/ctsupport.h index f180091..58274ee 100644 --- a/include/ctsupport.h +++ b/include/ctsupport.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsupport.h,v 1.4 2000/06/22 10:17:28 kevin Exp $ +** $Id: ctsupport.h,v 1.5 2000/06/28 15:25:34 kevin Exp $ ** ** ** This program is free software; you can redistribute it and/or modify @@ -149,9 +149,13 @@ typedef unsigned char kuint8; #endif -/* filefuncs.cpp */ -bool fileExists (const char* fname); -const char* fileBasename (const char* filename); +inline const char* +fileBasename (const char* const filename) +{ + const char* p = strrchr (filename, '/'); + return (p ? p + 1 : filename); +} + /* strfuncs.cpp */ char* str_skip_head(const char* str, const char* const charlist);