static void hb_gt_std_Tone( PHB_GT pGT, double dFrequency, double dDuration ) { double dCurrentSeconds; PHB_GTSTD pGTSTD; HB_TRACE(HB_TR_DEBUG, ("hb_gt_std_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration)); pGTSTD = HB_GTSTD_GET( pGT ); /* Output an ASCII BEL character to cause a sound */ /* but throttle to max once per second, in case of sound */ /* effects prgs calling lots of short tone sequences in */ /* succession leading to BEL hell on the terminal */ dCurrentSeconds = hb_dateSeconds(); if( dCurrentSeconds < pGTSTD->dToneSeconds || dCurrentSeconds - pGTSTD->dToneSeconds > 0.5 ) { hb_gt_std_termOut( pGTSTD, s_szBell, 1 ); pGTSTD->dToneSeconds = dCurrentSeconds; } HB_SYMBOL_UNUSED( dFrequency ); /* convert Clipper (DOS) timer tick units to seconds ( x / 18.2 ) */ hb_idleSleep( dDuration / 18.2 ); }
static PHB_FILE hb_sxSemOpen( char * szFileName, HB_BOOL * pfNewFile ) { PHB_FILE pFile; int i = 0; do { pFile = hb_fileExtOpen( szFileName, ".sem", FO_READWRITE | FO_EXCLUSIVE | FXO_DEFAULTS | FXO_SHARELOCK | FXO_COPYNAME, NULL, NULL ); if( pFile != NULL ) break; if( pfNewFile ) { pFile = hb_fileExtOpen( szFileName, ".sem", FXO_UNIQUE | FO_READWRITE | FO_EXCLUSIVE | FXO_DEFAULTS | FXO_SHARELOCK | FXO_COPYNAME, NULL, NULL ); if( pFile != NULL ) { *pfNewFile = HB_TRUE; break; } } else { HB_ERRCODE errCode = hb_fsError(); if( errCode != 5 && errCode != 32 && errCode != 33 ) break; } hb_idleSleep( 0.01 ); } while( ++i < 25 ); return pFile; }