Esempio n. 1
0
/*****************************************************************************
 * FUNCTION
 *  EVM_Process
 * DESCRIPTION
 *  Process all outstanding events.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void EVM_Process(void)
{

    /* Do not permit stack API calls to occur until we're done */
    OS_LockStack();

    /* Let HCI process any events */
    HCI_Process();

    /* Look for timers that might have fired */
    CheckTimers();

    /* Permit stack API calls again */
    OS_UnlockStack();
}
Esempio n. 2
0
int main(int UNUSED(argc), char * UNUSED(argv[]))
{
	if ((botinfo = malloc(sizeof(struct botstruct))) == NULL) {
		fprintf(stderr, "main: Malloc error!\n");
		acid_shutdown(-1);
	}
	
	time(&currtime);
	time(&botinfo->starttime);

	startup();

	if(botinfo->ver == NULL) {
		botinfo->ver = malloc(50) ;
		snprintf(botinfo->ver, 50, "Acidblood %s\n",VERSION) ;
	}

	/* load user data */
	if ((read_user_data()) < 0) {
		fprintf(stderr, "Error reading in user file.\n");
		acid_shutdown(-1);
	}
	
	background() ;

	while (1) {
		
		time(&currtime);

		CheckConfServers() ;
	
		check_connections();
		
		CheckTimers() ;
		
		ReapUserList();

	}
}