/* This function releases all memory occupied by a memvar variable and * assigns NIL value - it releases variables created in current * procedure only. * The scope of released variables are specified using passed name's mask */ static void hb_memvarReleaseWithMask( const char * szMask, HB_BOOL bInclude ) { HB_STACK_TLS_PRELOAD HB_SIZE nBase, nCount; PHB_DYNS pDynVar; PHB_ITEM pMemvar; HB_TRACE( HB_TR_DEBUG, ( "hb_memvarReleaseWithMask(%s, %d)", szMask, ( int ) bInclude ) ); nCount = hb_stackGetPrivateStack()->count; nBase = hb_stackBaseItem()->item.asSymbol.stackstate->nPrivateBase; while( nCount-- > nBase ) { pDynVar = hb_stackGetPrivateStack()->stack[ nCount ].pDynSym; /* reset current value to NIL - the overriden variables will be * visible after exit from current procedure */ pMemvar = hb_dynsymGetMemvar( pDynVar ); if( pMemvar ) { HB_BOOL fMatch = hb_strMatchCaseWildExact( pDynVar->pSymbol->szName, szMask ); if( bInclude ? fMatch : ! fMatch ) hb_itemClear( pMemvar ); } } }
BOOL hb_strMatchFile( const char * szString, const char * szPattern ) { #if defined( HB_OS_UNIX ) # if defined( __WATCOMC__ ) return hb_strMatchWildExact( szString, szPattern ); # else return fnmatch( szPattern, szString, FNM_PERIOD | FNM_PATHNAME ) == 0; # endif #else return hb_strMatchCaseWildExact( szString, szPattern ); #endif }
HB_BOOL hb_strMatchFile( const char * szString, const char * szPattern ) { #if defined( HB_OS_UNIX ) # if defined( HB_NO_FNMATCH ) return hb_strMatchWildExact( szString, szPattern ); # else return fnmatch( szPattern, szString, FNM_PERIOD | FNM_PATHNAME ) == 0; # endif #elif defined( HB_OS_DOS ) || defined( HB_OS_WIN ) || defined( HB_OS_OS2 ) PHB_CODEPAGE cdp = hb_vmCDP(); if( cdp && HB_CDP_ISCHARIDX( cdp ) ) return hb_strMatchWildCDP( szString, szPattern, HB_TRUE, HB_TRUE, HB_TRUE, cdp ); else return hb_strMatchWildRaw( szString, szPattern, HB_TRUE, HB_TRUE, HB_TRUE ); #else return hb_strMatchCaseWildExact( szString, szPattern ); #endif }