X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=include%2Fctsupport.h;h=58274ee3039a9e37c7157a73f3dbcb7a70eef987;hb=e4c1f7f8eb87558c3abf3bf1d20732361f425351;hp=f1800919f5e05df620af48d1a20352d2fc98ce5d;hpb=2d39e823ba389fc68e5317c422b55be006094252;p=ctsim.git 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);