cpl/cpl_path.cpp
const char *CPLGetFilename( const char *pszFullFilename )

{
    int iFileStart = CPLFindFilenameStart( pszFullFilename );
    char       *pszStaticResult = CPLGetStaticResult();

    strncpy( pszStaticResult, pszFullFilename + iFileStart, 
             CPL_PATH_BUF_SIZE );
    pszStaticResult[CPL_PATH_BUF_SIZE - 1] = '\0';

    return pszStaticResult;
}
/**
 * Extract non-directory portion of filename.
 *
 * Returns a string containing the bare filename portion of the passed
 * filename.  If there is no filename (passed value ends in trailing directory
 * separator) an empty string is returned.
 *
 * <pre>
 * CPLGetFilename( "abc/def.xyz" ) == "def.xyz"
 * CPLGetFilename( "/abc/def/" ) == ""
 * CPLGetFilename( "abc/def" ) == "def"
 * </pre>
 *
 * @param pszFullFilename the full filename potentially including a path.
 *
 *  @return just the non-directory portion of the path in an internal string
 * which must not be freed.  The string
 * may be destroyed by the next CPL filename handling call.
 */
Extract non-directory portion of filename.
Returns a string containing the bare filename portion of the passed
filename.  If there is no filename (passed value ends in trailing directory
separator) an empty string is returned.



@param pszFullFilename the full filename potentially including a path.

@return just the non-directory portion of the path in an internal string
which must not be freed.  The string
may be destroyed by the next CPL filename handling call.
Extract non - directory portion of filename . Returns a string containing the bare filename portion of the passed filename . If there is no filename ( passed value ends in trailing directory separator ) an empty string is returned . @param pszFullFilename the full filename potentially including a path . @return just the non - directory portion of the path in an internal string which must not be freed . The string may be destroyed by the next CPL filename handling call .
const char *CPLGetFilename( const char *pszFullFilename )
{
    int iFileStart = CPLFindFilenameStart( pszFullFilename );
    char       *pszStaticResult = CPLGetStaticResult();
    strncpy( pszStaticResult, pszFullFilename + iFileStart, 
             CPL_PATH_BUF_SIZE );
    pszStaticResult[CPL_PATH_BUF_SIZE - 1] = '\0';
    return pszStaticResult;
}
const char * CPLGetFilename ( const char * pszFullFilename ) { int iFileStart = CPLFindFilenameStart ( pszFullFilename ) ; char * pszStaticResult = CPLGetStaticResult ( ) ; strncpy ( pszStaticResult , pszFullFilename + iFileStart , CPL_PATH_BUF_SIZE ) ; pszStaticResult [ CPL_PATH_BUF_SIZE - 1 ] = ' \0 ' ; return pszStaticResult ; }
Extract non-directory portion of filename.
Extract non - directory portion of filename .