static svn_error_t *
end_getloc(svn_ra_serf__xml_parser_t *parser,
           void *userData,
           svn_ra_serf__dav_props_t name)
{
    loc_context_t *loc_ctx = userData;
    loc_state_list_t *cur_state;

    if (!loc_ctx->state)
    {
        return SVN_NO_ERROR;
    }

    cur_state = loc_ctx->state;

    if (cur_state->state == REPORT &&
            strcmp(name.name, "get-locations-report") == 0)
    {
        pop_state(loc_ctx);
    }
    else if (cur_state->state == LOCATION &&
             strcmp(name.name, "location") == 0)
    {
        pop_state(loc_ctx);
    }

    return SVN_NO_ERROR;
}
Beispiel #2
0
/* handler for parser QUOTES state */
static const WCHAR *quotes_state( struct parser *parser, const WCHAR *pos )
{
  const WCHAR *p, *token_end = parser->start;

  for (p = pos; !is_eol( parser, p ); p++)
    {
      if (*p == '"')
        {
          if (p+1 < parser->end && p[1] == '"')  /* double quotes */
            {
              push_token( parser, p + 1 );
              parser->start = token_end = p + 2;
              p++;
            }
          else  /* end of quotes */
            {
              push_token( parser, p );
              parser->start = p + 1;
              pop_state( parser );
              return p + 1;
            }
        }
    }
  push_token( parser, p );
  pop_state( parser );
  return p;
}
Beispiel #3
0
	GLvoid CMenuButton::draw()
	{	
		if (over)
		{
			push_state();
			GLfloat old_w = extent.width;
			GLfloat old_h = extent.height;
			scale(1.012f,1.12f);
			translate(-(extent.width-old_w)/2.0f,-(extent.height-old_h)/2.0f,0.0f);

			glPushMatrix();	
			set_color(red,0.0f,0.0f);
			red+=red_speed;
			if (red>1.0f || red<0.0f)
			{
				red_speed=-red_speed;
			}
			over=false;

			set_texture(effect_texture);
			CTexturedGUIButton::draw();
			glPopMatrix();

			pop_state();	
		}
		else
		{
			red=0.0f;
		}		

		set_color(1.0f,1.0f,1.0f);
		set_texture(normal_texture);
		CTexturedGUIButton::draw();
		set_caption_color(1.0f,0.0f,0.0f);
	}
Beispiel #4
0
int
make1( TARGET *t )
{
	state *pState;

	memset( (char *)counts, 0, sizeof( *counts ) );

	/* Recursively make the target and its dependents */
	push_state(&state_stack, t, NULL, T_STATE_MAKE1A);

	do
	{
		while((pState = current_state(&state_stack)) != NULL)
		{
            if (intr) 
                pop_state(&state_stack);

			switch(pState->curstate)
			{
			case T_STATE_MAKE1A:
				make1a(pState);
				break;
			case T_STATE_MAKE1ATAIL:
				make1atail(pState);
				break;
			case T_STATE_MAKE1B:
				make1b(pState);
				break;
			case T_STATE_MAKE1C:
				make1c(pState);
				break;
			case T_STATE_MAKE1D:
				make1d(pState);
				break;
			default:
				break;
			}
		}
	

	/* Wait for any outstanding commands to finish running. */
	} while( execwait() );

	clear_state_freelist();

	/* Talk about it */
	if( counts->failed )
	    printf( "...failed updating %d target%s...\n", counts->failed,
		        counts->failed > 1 ? "s" : "" );

	if( DEBUG_MAKE && counts->skipped )
	    printf( "...skipped %d target%s...\n", counts->skipped,
		        counts->skipped > 1 ? "s" : "" );

	if( DEBUG_MAKE && counts->made )
	    printf( "...updated %d target%s...\n", counts->made,
		        counts->made > 1 ? "s" : "" );

	return counts->total != counts->made;
}
Beispiel #5
0
void Game::change_state(Gamestate* state){
	if(!this->states.empty())
		pop_state();
	push_state(state);

	return;
}
Beispiel #6
0
static void expect_property_or_endobj(JSONRD_T *jsonrd) {
  if (jsonrd->token.type == TOK_STRING) {
    STR_T *property;
    property = jsonrd->token.value_string;
    if (jsonrd->callbacks.start_property) {
      jsonrd->callbacks.start_property(jsonrd->user_data, str_internal(property), str_len(property));
    }
    jsonrd->state = PS_COLON;
  } else if (jsonrd->token.type == TOK_ENDOBJ) {
    if (jsonrd->callbacks.end_object) {
      jsonrd->callbacks.end_object(jsonrd->user_data);
    }
    jsonrd->state = pop_state(jsonrd);
    if (jsonrd->state == PS_COMMA_OR_ENDOBJ) {
      if (jsonrd->callbacks.end_property) {
        jsonrd->callbacks.end_property(jsonrd->user_data);
      }
    } else if (jsonrd->state == PS_FIND_LANDMARK) {
      if (jsonrd->callbacks.end_data) {
        jsonrd->callbacks.end_data(jsonrd->user_data);
      }
    }
  } else {
    error(jsonrd, "Expected a object property or the end of the object.");
  }
}
Beispiel #7
0
void m6809_base_device::execute_one()
{
	switch(pop_state())
	{
#include "cpu/m6809/m6809.inc"
	}
}
Beispiel #8
0
static void
make1a( state *pState)
{
    TARGET* t = pState->t;
	TARGETS	*c;
    TARGETS   *inc;

	/* If the parent is the first to try to build this target */
	/* or this target is in the make1c() quagmire, arrange for the */
	/* parent to be notified when this target is built. */

	if( pState->parent )
	    switch( pState->t->progress )
	{
	case T_MAKE_INIT:
	case T_MAKE_ACTIVE:
	case T_MAKE_RUNNING:
	    pState->t->parents = targetentry( pState->t->parents, pState->parent );
	    pState->parent->asynccnt++;
	}

	if( pState->t->progress != T_MAKE_INIT )
	{
		pop_state(&state_stack);
		return;
	}

	/* Asynccnt counts the dependents preventing this target from */
	/* proceeding to make1b() for actual building.  We start off with */
	/* a count of 1 to prevent anything from happening until we can */
	/* call all dependents.  This 1 is accounted for when we call */
	/* make1b() ourselves, below. */

	pState->t->asynccnt = 1;

    /* Add header node that was created during building process. */

    inc = 0;
    for (c = t->depends; c; c = c->next) {        
        if (c->target->rescanned && c->target->includes)
            inc = targetentry(inc, c->target->includes);           
    }
    t->depends = targetchain(t->depends, inc);

	/* against circular dependency. */

	pState->t->progress = T_MAKE_ONSTACK;

	{
		stack temp_stack = { NULL };
        for( c = t->depends; c && !intr; c = c->next )            
            push_state(&temp_stack, c->target, pState->t, T_STATE_MAKE1A);

		/* using stacks reverses the order of execution. Reverse it back */
		push_stack_on_stack(&state_stack, &temp_stack);
	}

	pState->curstate = T_STATE_MAKE1ATAIL;
}
Beispiel #9
0
static void cleanup_stack(struct stack* stack,struct rtf_state* state,cli_ctx* ctx)
{
	while(stack && stack->stack_cnt /* && state->default_elements*/) {
		pop_state(stack,state);
		if(state->cb_data && state->cb_end)
			state->cb_end(state,ctx);
	}
}
Beispiel #10
0
/*
 * jsonwr_end_object_value
 */
void jsonwr_end_object_value(JSONWR_T* jsonwr) {
  enforce_state(jsonwr->state, 2, JSON_EMPTY_OBJECT, JSON_OBJECT);
  jsonwr->indent -= jsonwr->tab_cols;
  if (jsonwr->state != JSON_EMPTY_OBJECT) write_nl_indent(jsonwr);
  fputc('}', jsonwr->file);
  jsonwr->column += 1;
  jsonwr->state = pop_state(jsonwr->stack);
}
Beispiel #11
0
	GLvoid CItemButton::on_mouse_up()
	{
		if (first_down)
		{
			pop_state(&top_texture_extent);
			first_down=false;
		}
	}
Beispiel #12
0
/* handler for parser COMMENT state */
static const WCHAR *comment_state( struct parser *parser, const WCHAR *pos )
{
  const WCHAR *p = pos;

  while (!is_eol( parser, p ))
     p++;
  pop_state( parser );
  return p;
}
// Free up ressources
void GameStateMachine::clean()
{
	// Clean up all individual states
	for (int i{0}; i < m_game_states.size(); i++)
		pop_state();

	// Destroy the current instance
	delete s_instance;
	s_instance = 0;
}
Beispiel #14
0
/* handler for parser EOL_BACKSLASH state */
static
const CHAR*
eol_backslash_state(
    struct parser *parser,
    const CHAR *pos )
{
    const CHAR *p;

    for (p = pos; !is_eof(parser, p); p++)
    {
        switch(*p)
        {
        case '\r':
            continue;

        case '\n':
            parser->line_pos++;
            parser->start = p + 1;
            set_state(parser, LEADING_SPACES);
            return p + 1;

        case '\\':
            continue;

        case ';':
            push_state(parser, EOL_BACKSLASH);
            set_state(parser, COMMENT);
            return p + 1;

        default:
            if (isspace((unsigned char)*p))
                continue;
            push_token(parser, p);
            pop_state(parser);
            return p;
        }
    }
    parser->start = p;
    pop_state(parser);

    return p;
}
static void handle_backwards_frame() {
    assert(n_recorded_frames > 0);
    // Do not pop the top state if we just started rewinding (i.e., if
    // !is_backwards_frame). We want to run it again backwards first to
    // get a clean transition in the sound.
    if (is_backwards_frame && n_recorded_frames > 1)
        pop_state();
    load_top_state();

    is_backwards_frame = true;
}
Beispiel #16
0
static void expect_value_or_endlst(JSONRD_T *jsonrd) {
  switch (jsonrd->token.type) {
    case TOK_STRING:
      if (jsonrd->callbacks.atom_string) {
        STR_T *value;
        value = jsonrd->token.value_string;
        jsonrd->callbacks.atom_string(jsonrd->user_data, str_internal(value), str_len(value));
      }
      goto atom_value;
    case TOK_NUMBER:
      if (jsonrd->callbacks.atom_number) {
        jsonrd->callbacks.atom_number(jsonrd->user_data, jsonrd->token.value_number);
      }
      goto atom_value;
    case TOK_TRUE:
    case TOK_FALSE:
      if (jsonrd->callbacks.atom_bool) {
        jsonrd->callbacks.atom_bool(jsonrd->user_data, jsonrd->token.value_bool);
      }
      goto atom_value;
    case TOK_NULL:
      if (jsonrd->callbacks.atom_null) {
        jsonrd->callbacks.atom_null(jsonrd->user_data);
      }
atom_value:
      jsonrd->state = PS_COMMA_OR_ENDLST;
      break;
    case TOK_STARTOBJ:
      if (jsonrd->callbacks.start_object) {
        jsonrd->callbacks.start_object(jsonrd->user_data);
      }
      push_state(jsonrd, PS_COMMA_OR_ENDLST);
      jsonrd->state = PS_PROPERTY_OR_ENDOBJ;
      break;
    case TOK_STARTLST:
      if (jsonrd->callbacks.start_list) {
        jsonrd->callbacks.start_list(jsonrd->user_data);
      }
      push_state(jsonrd, PS_COMMA_OR_ENDLST);
      jsonrd->state = PS_VALUE_OR_ENDLST;
      break;
    case TOK_ENDLST:
      if (jsonrd->callbacks.end_list) {
        jsonrd->callbacks.end_list(jsonrd->user_data);
      }
      jsonrd->state = pop_state(jsonrd);
      if (jsonrd->state == PS_COMMA_OR_ENDOBJ && jsonrd->callbacks.end_property) {
        jsonrd->callbacks.end_property(jsonrd->user_data);
      }
      break;
    default:
      error(jsonrd, "Expected a list value or the end of the list.");
  }
}
Beispiel #17
0
	GLvoid CItemButton::on_mouse_out()
	{
		shape->set_z(0.0f);
		set_texture(normal_texture);

		if (first_down)
		{
			pop_state(&top_texture_extent);
			first_down=false;
		}
	}
static void
end_element_handler (GMarkupParseContext  *context,
                     const gchar          *element_name,
                     gpointer              user_data,
                     GError              **error)
{
  ParseInfo *info = user_data;

  switch (peek_state (info))
    {
    case STATE_UNKNOWN:
      pop_state (info);
      g_assert (peek_state (info) == STATE_UNKNOWN ||
                peek_state (info) == STATE_TAG     ||
                peek_state (info) == STATE_MARKUP);
      break;

    case STATE_TAG:
      pop_state (info);
      g_assert (peek_state (info) == STATE_UNKNOWN ||
                peek_state (info) == STATE_TAG     ||
                peek_state (info) == STATE_MARKUP);

      /* Pop tag */
      info->tag_stack = g_slist_delete_link (info->tag_stack,
                                             info->tag_stack);
      break;

    case STATE_MARKUP:
      pop_state (info);
      g_assert (peek_state (info) == STATE_START);

      info->spans = g_list_reverse (info->spans);
      break;

    default:
      g_assert_not_reached ();
      break;
    }
}
Beispiel #19
0
void StructureVisitor::endElement(const char * name)
{
	State &st = state();
	vtStructure *pStruct = st.item;

	if (string(name) == (string)"structures")
	{
		pop_state();
	}
	if (string(name) == (string)"structure")
	{
		if (st.item != NULL)
			m_pSA->Append(st.item);
		pop_state();
	}
	if (string(name) == (string)"shapes")
	{
		// currently, building wall information is not saved or restored, so
		// we must manually indicate that detail should be implied upon loading
		vtBuilding *bld = pStruct->GetBuilding();
		bld->AddDefaultDetails();

		pop_state();
	}
	if (_level == 3)
	{
		if (pStruct->GetType() == ST_INSTANCE &&
			string(name) != (string)"placement")
		{
			// save all other tags as literal strings
			vtTag tag;
			tag.name = name;
			tag.value = _data.c_str();

			pStruct->AddTag(tag);
		}
	}
}
Beispiel #20
0
/*
 * Separates multiple values in an array and ensures that the
 * line length is within the preferred value when possible.
 */
static void write_value(JSONWR_T* jsonwr) {
  int line_len, val_len;
  enforce_state(jsonwr->state, 4, JSON_PROPERTY, JSON_EMPTY_ARRAY, 
      JSON_SL_ARRAY, JSON_ML_ARRAY);
  val_len = str_len(jsonwr->value_buf);
  if (jsonwr->state == JSON_EMPTY_ARRAY) {
    if ((jsonwr->indent + 1 + val_len + 2) < jsonwr->line_cols) {
      str_clear(jsonwr->line_buf);
      str_append(jsonwr->line_buf, str_internal(jsonwr->value_buf), val_len);
      jsonwr->state = JSON_SL_ARRAY;
      return; // don't write anything yet
    } else {
      fputc('[', jsonwr->file);
      jsonwr->column += 1;
      write_nl_indent(jsonwr);
    }
  } else if (jsonwr->state == JSON_SL_ARRAY) {
    line_len = str_len(jsonwr->line_buf);
    if ((jsonwr->indent + 1 + line_len + 2 + val_len + 2) < jsonwr->line_cols) {
      str_append(jsonwr->line_buf, ", ", 2);
      str_append(jsonwr->line_buf, str_internal(jsonwr->value_buf), val_len);
      return; // don't write anything yet
    } else {
      fputc('[', jsonwr->file);
      jsonwr->column += 1;
      write_nl_indent(jsonwr);
      fputs(str_internal(jsonwr->line_buf), jsonwr->file);
      jsonwr->column += line_len;
      jsonwr->state = JSON_ML_ARRAY;
    }
  }
  if (jsonwr->state == JSON_ML_ARRAY) {
    fputc(',', jsonwr->file);
    jsonwr->column += 1;
    if ((jsonwr->column + 1 + val_len + 2) < jsonwr->line_cols) {
      fputc(' ', jsonwr->file);
      jsonwr->column += 1;
    } else {
      write_nl_indent(jsonwr);
    }
  }
  fputs(str_internal(jsonwr->value_buf), jsonwr->file);
  jsonwr->column += str_len(jsonwr->value_buf);
  if (jsonwr->state == JSON_PROPERTY) {
    jsonwr->state = pop_state(jsonwr->stack);
  } else { // ARRAY
    jsonwr->state = JSON_ML_ARRAY;
  }
}
Beispiel #21
0
static void expect_comma_or_endlst(JSONRD_T *jsonrd) {
  if (jsonrd->token.type == TOK_COMMA) {
    jsonrd->state = PS_LIST_VALUE;
  } else if (jsonrd->token.type == TOK_ENDLST) {
    if (jsonrd->callbacks.end_list) {
      jsonrd->callbacks.end_list(jsonrd->user_data);
    }
    jsonrd->state = pop_state(jsonrd);
    if (jsonrd->state == PS_COMMA_OR_ENDOBJ && jsonrd->callbacks.end_property) {
      jsonrd->callbacks.end_property(jsonrd->user_data);
    }
  } else {
    error(jsonrd, "Expected a comma or the end of the list.");
  }
}
Beispiel #22
0
int make1( TARGET * const t )
{
    state * pState;

    memset( (char *)counts, 0, sizeof( *counts ) );

    /* Recursively make the target and its dependencies. */
    push_state( &state_stack, t, NULL, T_STATE_MAKE1A );

    while ( 1 )
    {
        while ( ( pState = current_state( &state_stack ) ) )
        {
            if ( intr )
                pop_state( &state_stack );

            switch ( pState->curstate )
            {
                case T_STATE_MAKE1A: make1a( pState ); break;
                case T_STATE_MAKE1B: make1b( pState ); break;
                case T_STATE_MAKE1C: make1c( pState ); break;
                default:
                    assert( !"make1(): Invalid state detected." );
            }
        }
        if ( !cmdsrunning )
            break;
        /* Wait for outstanding commands to finish running. */
        exec_wait();
    }

    clear_state_freelist();

    /* Talk about it. */
    if ( counts->failed )
        printf( "...failed updating %d target%s...\n", counts->failed,
            counts->failed > 1 ? "s" : "" );
    if ( DEBUG_MAKE && counts->skipped )
        printf( "...skipped %d target%s...\n", counts->skipped,
            counts->skipped > 1 ? "s" : "" );
    if ( DEBUG_MAKE && counts->made )
        printf( "...updated %d target%s...\n", counts->made,
            counts->made > 1 ? "s" : "" );

    return counts->total != counts->made;
}
Beispiel #23
0
/* handler for parser TRAILING_SPACES state */
static const WCHAR *trailing_spaces_state( struct parser *parser, const WCHAR *pos )
{
  const WCHAR *p;

  for (p = pos; !is_eol( parser, p ); p++)
    {
      if (*p == '\\')
        {
          set_state( parser, EOL_BACKSLASH );
          return p;
        }
      if (!isspaceW(*p))
        break;
    }
  pop_state( parser );
  return p;
}
// Change the game state, erasing the previous one
void GameStateMachine::change_state(GameState* state)
{
	if (!m_game_states.empty())
	{
		// Do not change to the same state
		if (m_game_states.back()->get_state_id() == state->get_state_id())
		{
			std::cerr << "Tried to change to the same state" << std::endl;
			return;
		}

		std::clog << "Changing state from " << m_game_states.back()->get_state_id() << " to " << state->get_state_id() << "..." << std::endl;

		pop_state();
	}

	push_state(state);
}		
Beispiel #25
0
/*
 * jsonwr_end_array_value
 */
void jsonwr_end_array_value(JSONWR_T* jsonwr) {
  int line_len;
  enforce_state(jsonwr->state, 3, JSON_EMPTY_ARRAY, JSON_SL_ARRAY, JSON_ML_ARRAY);
  jsonwr->indent -= jsonwr->tab_cols;
  if (jsonwr->state == JSON_ML_ARRAY) {
    write_nl_indent(jsonwr);
  } else {
    line_len = (jsonwr->state == JSON_SL_ARRAY ? str_len(jsonwr->line_buf) : 0);
    if ((jsonwr->column + 1 + line_len + 2) >= jsonwr->line_cols)
      write_nl_indent(jsonwr);
    fputc('[', jsonwr->file);
    jsonwr->column += 1;
  }
  if (jsonwr->state == JSON_SL_ARRAY) {
    fputs(str_internal(jsonwr->line_buf), jsonwr->file);
    jsonwr->column += str_len(jsonwr->line_buf);
  }
  fputc(']', jsonwr->file);
  jsonwr->column += 1;
  jsonwr->state = pop_state(jsonwr->stack);
}
Beispiel #26
0
static void expect_comma_or_endobj(JSONRD_T *jsonrd) {
  if (jsonrd->token.type == TOK_COMMA) {
    jsonrd->state = PS_PROPERTY;
  } else if (jsonrd->token.type == TOK_ENDOBJ) {
    if (jsonrd->callbacks.end_object) {
      jsonrd->callbacks.end_object(jsonrd->user_data);
    }
    jsonrd->state = pop_state(jsonrd);
    if (jsonrd->state == PS_COMMA_OR_ENDOBJ) {
      if (jsonrd->callbacks.end_property) {
        jsonrd->callbacks.end_property(jsonrd->user_data);
      }
    } else if (jsonrd->state == PS_FIND_LANDMARK) {
      if (jsonrd->callbacks.end_data) {
        jsonrd->callbacks.end_data(jsonrd->user_data);
      }
    }

  } else {
    error(jsonrd, "Expected a comma or the end of the object.");
  }
}
Beispiel #27
0
/* Pop a previously saved list */
void pop_state(interp_core_type *interp) {
    object_type *state=0;

    TRACE("Po")
    
    if(interp->state_stack==0) {
	fail("Attempt to pop non-existent state");
    }

    state=interp->state_stack;
    
    interp->added=interp->current;
    interp->current=car(state);
    interp->state_stack=cdr(state);

    /* we are in the depths of a chain, pop until 
       we're out of it */
    if(state->type==CHAIN) {
	set(interp, CDR);
	pop_state(interp);
    }
}
Beispiel #28
0
/* handler for parser LEADING_SPACES state */
static
const CHAR*
leading_spaces_state(
    struct parser *parser,
    const CHAR *pos )
{
    const CHAR *p;

    for (p = pos; !is_eol(parser, p); p++)
    {
        if (*p == '\\')
        {
            parser->start = p;
            set_state(parser, EOL_BACKSLASH);
            return p;
        }
        if (!isspace((unsigned char)*p))
            break;
    }
    parser->start = p;
    pop_state(parser);
    return p;
}
Beispiel #29
0
 void set_state(Game_State* state) { pop_state(); push_state(state); }
Beispiel #30
0
static void
make1c( state *pState )
{
	CMD	*cmd = (CMD *)pState->t->cmds;

	/* If there are (more) commands to run to build this target */
	/* (and we haven't hit an error running earlier comands) we */
	/* launch the command with execcmd(). */
	
	/* If there are no more commands to run, we collect the status */
	/* from all the actions then report our completion to all the */
	/* parents. */

	if( cmd && pState->t->status == EXEC_CMD_OK )
	{
		if( DEBUG_MAKEQ || 
            ! ( cmd->rule->actions->flags & RULE_QUIETLY ) && DEBUG_MAKE)
	    {
		printf( "%s ", cmd->rule->name );
		list_print( lol_get( &cmd->args, 0 ) );
		printf( "\n" );
	    }

	    if( DEBUG_EXEC )
		printf( "%s\n", cmd->buf );

	    if( globs.cmdout )
		fprintf( globs.cmdout, "%s", cmd->buf );

	    if( globs.noexec )
	    {
			pState->curstate = T_STATE_MAKE1D;
			pState->status = EXEC_CMD_OK;
	    } 
	    else
	    {
			TARGET *t = pState->t;
			fflush( stdout );

			pop_state(&state_stack); /* pop state first because execcmd could push state */
			execcmd( cmd->buf, make_closure, t, cmd->shell );
	    }
	}
	else
	{
	    TARGETS	*c;
	    ACTIONS	*actions;

	    /* Collect status from actions, and distribute it as well */

	    for( actions = pState->t->actions; actions; actions = actions->next )
		if( actions->action->status > pState->t->status )
		    pState->t->status = actions->action->status;

	    for( actions = pState->t->actions; actions; actions = actions->next )
		if( pState->t->status > actions->action->status )
		    actions->action->status = pState->t->status;

	    /* Tally success/failure for those we tried to update. */

	    if( pState->t->progress == T_MAKE_RUNNING )
		switch( pState->t->status )
	    {
	    case EXEC_CMD_OK:
		++counts->made;
		break;
	    case EXEC_CMD_FAIL:
		++counts->failed;
		break;
	    }

	    /* Tell parents dependent has been built */
		{
			stack temp_stack = { NULL };
			TARGET *t = pState->t;            
            TARGET* additional_includes = NULL;

			t->progress = T_MAKE_DONE;

            /* Target was updated. Rescan dependencies. */
            if (t->fate >= T_FATE_MISSING &&
                t->status == EXEC_CMD_OK &&
                !t->rescanned) {

                TARGET *target_to_rescan = t;
                SETTINGS *s;               

                target_to_rescan->rescanned = 1;

                if (target_to_rescan->flags & T_FLAG_INTERNAL) {
                    target_to_rescan = t->original_target;                    
                }

                /* Clean current includes */
                if (target_to_rescan->includes) {
                    target_to_rescan->includes = 0;
                }

                s = copysettings( target_to_rescan->settings );
                pushsettings( s );
                headers(target_to_rescan);
                popsettings( s );
                freesettings( s );

                if (target_to_rescan->includes) {
                    target_to_rescan->includes->rescanned = 1;
                    /* Tricky. The parents were already processed, but they
                       did not seen the internal node, because it was just 
                       created. We need to make the calls to make1a that would
                       have been done by parents here, and also make sure all
                       unprocessed parents will pick up the includes. We must
                       make sure processing of the additional make1a invocations
                       is done before make1b which means this target is built,
                       otherwise the parent will be considered built before this
                       make1a processing is even started.
                    */
                    make0(target_to_rescan->includes, target_to_rescan->parents->target, 0, 0, 0);
                    for( c = target_to_rescan->parents; c; c = c->next) {
                        c->target->depends = targetentry( c->target->depends, 
                                                          target_to_rescan->includes );
                    }
                    /* Will be processed below. */
                    additional_includes = target_to_rescan->includes;
                }                
            }

            if (additional_includes)
                for ( c = t->parents; c; c = c->next ) {                            
                    push_state(&temp_stack, additional_includes, c->target, T_STATE_MAKE1A);
                    
                }

			for( c = t->parents; c; c = c->next ) {
				push_state(&temp_stack, c->target, NULL, T_STATE_MAKE1B);
            }
             


#ifdef OPT_SEMAPHORE
	    /* If there is a semaphore, its now free */
	    if( t->semaphore )
	    {
		assert( t->semaphore->asynccnt == 1 );
		--(t->semaphore->asynccnt);

		if( DEBUG_EXECCMD )
		    printf( "SEM: %s is now free\n", t->semaphore->name);

		/* If anything is waiting, notify the next target. There's no
            point in notifying all waiting targets, since they'll be
            serialized again. */
		if( t->semaphore->parents )
		{
		    TARGETS *first = t->semaphore->parents;
		    if( first->next )
			first->next->tail = first->tail;
		    t->semaphore->parents = first->next;

		    if( DEBUG_EXECCMD )
			printf( "SEM: placing %s on stack\n", first->target->name);
            push_state(&temp_stack, first->target, NULL, T_STATE_MAKE1B);
		    free( first );
		}
	    }
#endif

		
			/* must pop state before pushing any more */
			pop_state(&state_stack);
		
			/* using stacks reverses the order of execution. Reverse it back */
			push_stack_on_stack(&state_stack, &temp_stack);

		}
	}
}