Exemplo n.º 1
0
char RemoteConnect( void )
{
int rc;
#ifdef SERVER
    rc = LookForConv( &_id );
    if( rc == 1 ) {
        return( 1 );
    } else if( rc == 0 ) {
        TimeSlice();
    }
    return( 0 );
#else
static int _first=1;
    if( _first ) {

        _first = 0;
        rc = StartConv( _id );
        if( rc != 0 ) {
        }
    }
    for( ;; ) {
        rc = IsConvAck( _id );
        if( !rc ) {
            TimeSlice();
        } else if( rc < 0 ) {
        } else {
            return( 1 );
        }
    }
#endif
}
Exemplo n.º 2
0
/*
 * VxDConnect - connect to a client/server
 */
char __pascal VxDConnect( void )
{
    int rc;
#ifdef SERVER
    rc = LookForConv( &__ConvId );
    if( rc == 1 ) {
        return( 1 );
    } else if( rc == 0 ) {
        TimeSlice();
        return( 0 );
    }
    return 0;           //added by TW (no return value otherwise)??
#else
    static int _first=1;
    if( _first ) {
        _first = 0;
        rc = StartConv( __ConvId );
    }
    while( 1 ) {
        rc = IsConvAck( __ConvId );
        if( !rc ) {
            TimeSlice();
        } else if( rc < 0 ) {
        } else {
            return( 1 );
        }
    }
#endif

} /* VxDConnect */
Exemplo n.º 3
0
//--------------------------------------------------------------------
//  Compute sea level parameters 
//---------------------------------------------------------------------
void CAtmosphereModelJSBSim::InitModel(void)
{
//  FGModel::InitModel();
  //--- Assume no temperature deviation from standard
  dtaTC = 0;
  //--- Assume no pressure deviation ----------------
  dtaPS = dtaPB = 0;
  //--- Assume standard density in slugper cubic foot
  densD   = 0.00237767f;
  tempR   = 32;
  //---Init valuators -----------------------------------
  tVAL.Conf(INDN_LINEAR,1);
  pVAL.Conf(INDN_LINEAR,1);
  dVAL.Conf(INDN_LINEAR,1);
  TimeSlice(0,0);         //  Set Target
  TimeSlice(1,0);         //  Get Values
  //---Set sea level parameters --------------
  SLtemp    = tempR;        // Rankine
  SLpres    = presS;        // .
  SLdens    = densD;        // .
  SLpresHG  = presS * PSF_TO_INHG; 
  SLsoundspeed    = sqrt(SHRatio*Reng*tempR);
  rSLtemp         = 1.0/tempR;
  rSLpres         = 1.0/presS;
  rSLdens         = 1.0/densD;
  rSLsoundspeed   = 1.0/SLsoundspeed;
  return;
}
Exemplo n.º 4
0
bool RemoteConnect( void )
{
    int rc;

#ifdef SERVER
    rc = LookForConv( &_id );
    if( rc == 1 ) {
        return( TRUE );
    } else if( rc == 0 ) {
        TimeSlice();
    }
    return( FALSE );
#else
    static bool _first = TRUE;

    if( _first ) {

        _first = FALSE;
        rc = StartConv( _id );
        if( rc != 0 ) {
        }
    }
    for( ;; ) {
        rc = IsConvAck( _id );
        if( !rc ) {
            TimeSlice();
        } else if( rc < 0 ) {
        } else {
            return( TRUE );
        }
    }
#endif
}
nsresult nsMsgSearchSession::StartTimer()
{
    nsresult err;
    PRBool done;

    m_backgroundTimer = do_CreateInstance("@mozilla.org/timer;1", &err);
    m_backgroundTimer->InitWithFuncCallback(TimerCallback, (void *) this, 0,
                                            nsITimer::TYPE_REPEATING_SLACK);
    // ### start meteors?
    return TimeSlice(&done);
}
Exemplo n.º 6
0
void main (int argc,char **argv) {
    /* argc = number of parameters from DOS + 1 */
    /* argv[1] is first parameter from DOS */

    puts("RACDK - Test CRC-32 routine/demonstration\n        ");
    if (argc==2) printf("The 32-bit CRC of '%s' is 0x%lx\n",
                            argv[1], CRC32(argv[1], strlen(argv[1])));
    else
        puts("Syntax: TESTCRC.EXE string\n");
    while(!kbhit()) TimeSlice();
}
Exemplo n.º 7
0
/*
 * IDEInit - set up for communication with the IDE
 */
void IDEInit( void )
{
    if( !VxDPresent() ) {
        Die( "WDEBUG.386 not present!" );
    }
    for( ;; ) {
        if( VxDLink( EDITOR_LINK_NAME ) == NULL ) {
            VxDConnect();
            break;
        }
        TimeSlice();
    }

} /* IDEInit */
Exemplo n.º 8
0
static void messageLoop( void )
{
    MSG         msg;

    Yield();
    while( PeekMessage( &msg, (HWND) NULL, (UINT) NULL, (UINT) NULL,
                    PM_NOYIELD | PM_NOREMOVE ) ) {
        GetMessage( &msg, NULL, 0, 0 );
        TranslateMessage( &msg );
        DispatchMessage( &msg );
    }
    Yield();
    TimeSlice();
    Yield();

} /* messageLoop */