Пример #1
0
/* main
 *
 *	do some main stuff.
 */
int main( int argc, char ** argv )
{
	basic_program * bp;
	basic_line * bl;


	printf( "0\n" );
	/* set up our program space */
	bp = newProgram();
	if( !bp ) {
		errorReport( kErrorMalloc, 1 );
		return 0;
	}

	/* display version info */
	cmd_info( bp, NULL );

	bl = consumeString( bp, program[0] );
	bl = consumeString( bp, program[1] );
	bl = consumeString( bp, program[2] );
	bl = consumeString( bp, program[3] );
	bl = consumeString( bp, program[4] );

	/* and run the program, if we should... */
	printf( "Running program\n" );
	runProgram( bp, 0 );
	while( run_poll( bp ) );

	/* just show access of variables */
	printf( "Variable 'a' is %ld\n", getVariableNumber( bp->variables, "a" ));

	deleteProgram( bp );

	return 0;
}
Пример #2
0
void poll_thread::run ()
{
  assert(idle_timer == 0);
  idle_timer = new QTimer(this);
  connect(idle_timer, SIGNAL (timeout ()), this, SLOT(run_poll ())
          , Qt::QueuedConnection);

  QThread::exec ();
}