From 24f1ca07030c1246280dea98bb0975cfec8d5ea4 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 29 Nov 2014 14:36:26 -0800 Subject: New parser and framework. --- src/misc/extra/extraUtilFile.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/misc/extra/extraUtilFile.c') diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index ee9168f6..6b4453a5 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -247,6 +247,25 @@ char * Extra_FilePathWithoutName( char * FileName ) ABC_FREE( FileName ); return NULL; } +char * Extra_FileDesignName( char * pFileName ) +{ + char * pBeg, * pEnd, * pStore, * pCur; + // find the first dot + for ( pEnd = pFileName; *pEnd; pEnd++ ) + if ( *pEnd == '.' ) + break; + // find the first char + for ( pBeg = pEnd - 1; pBeg >= pFileName; pBeg-- ) + if ( !((*pBeg >= 'a' && *pBeg <= 'z') || (*pBeg >= 'A' && *pBeg <= 'Z') || (*pBeg >= '0' && *pBeg <= '9') || *pBeg == '_') ) + break; + pBeg++; + // fill up storage + pStore = ABC_ALLOC( char, pEnd - pBeg + 1 ); + for ( pCur = pStore; pBeg < pEnd; pBeg++, pCur++ ) + *pCur = *pBeg; + *pCur = 0; + return pStore; +} /**Function************************************************************* -- cgit v1.2.3