Ejemplo n.º 1
0
void
nautilus_directory_add_file (NautilusDirectory *directory, NautilusFile *file)
{
	GList *node;
	gboolean add_to_work_queue;

	g_assert (NAUTILUS_IS_DIRECTORY (directory));
	g_assert (NAUTILUS_IS_FILE (file));
	g_assert (file->details->name != NULL);

	/* Add to list. */
	node = g_list_prepend (directory->details->file_list, file);
	directory->details->file_list = node;

	/* Add to hash table. */
	add_to_hash_table (directory, file, node);

	directory->details->confirmed_file_count++;

	add_to_work_queue = FALSE;
	if (nautilus_directory_is_file_list_monitored (directory)) {
		/* Ref if we are monitoring, since monitoring owns the file list. */
		nautilus_file_ref (file);
		add_to_work_queue = TRUE;
	} else if (nautilus_directory_has_active_request_for_file (directory, file)) {
		/* We're waiting for the file in a call_when_ready. Make sure
		   we add the file to the work queue so that said waiter won't
		   wait forever for e.g. all files in the directory to be done */
		add_to_work_queue = TRUE;
	}
	
	if (add_to_work_queue) {
		nautilus_directory_add_file_to_work_queue (directory, file);
	}
}
Ejemplo n.º 2
0
void
nautilus_directory_end_file_name_change (NautilusDirectory *directory,
					 NautilusFile *file,
					 GList *node)
{
	/* Add the list node to the hash table. */
	if (node != NULL) {
		add_to_hash_table (directory, file, node);
	}
}
Ejemplo n.º 3
0
/*
 *  Initialize the command table.
 *
 *  The command table is a global structure (a hash table) which
 *  stores allows commands to be looked up by name, and invoked via a
 *  function pointer.  This function serves only to initilize this
 *  command table, and name each one of the commands availble to the
 *  user.  Note that commands may be added under more that one name,
 *  but that names must be unique.
 */
void init_soar_command_table( void ) {
  
  gSoarCommands = make_hash_table( 6, (hash_function)hash_soar_command );
  
  add_to_hash_table( gSoarCommands,
		     new_soar_command( ".", interface_Source ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "add-wme", soar_AddWme ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "build-info", soar_BuildInfo ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "counter-demo", interface_counter_demo ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "echo", interface_echo ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "excise", soar_Excise ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "indifferent-selection", 
				       soar_IndifferentSelection ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "init-soar",
				       soar_ReInitSoar ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "learn", soar_Learn ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "log", soar_Log ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "matches", soar_Matches ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "multi-attributes", 
				       soar_MultiAttributes ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "p", soar_Print ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "pf", soar_ProductionFind ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "popd", interface_popd ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "pref", soar_Preferences ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "print", soar_Print ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "pushd", interface_pushd ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "quit", soar_Quit ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "remove-wme", soar_RemoveWme ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "rete-net", soar_ReteNet ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "run", soar_Run ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "set", interface_Set ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "source", interface_Source ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "sp", soar_Sp ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "stats", soar_Stats ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "toh-demo", interface_toh_demo ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "v", soar_Verbose ) );  
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "verbose", soar_Verbose ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "w", soar_Watch ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "watch", soar_Watch ) );
#ifdef USE_CAPTURE_REPLAY
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "capture", soar_CaptureInput ) );
  add_to_hash_table( gSoarCommands,
		     new_soar_command( "replay", soar_ReplayInput ) );
#endif
}
Ejemplo n.º 4
0
LIB_LOCAL 	void copy_tg_pts_from_intfc(
	TRI_GRID *ntg,
	P_LINK   *hash_table,
	int      h_size)
{
#if defined(TWOD) || defined(THREED)
	TG_PT     *fr_pt;
	INTERFACE *intfc = ntg->grid_intfc;
	POINT     *point;
#endif /* defined(TWOD) || defined(THREED) */

	reset_hash_table(hash_table,h_size);

#if defined(TWOD)
	if (intfc->dim == 2)
	{
	    BOND  *b;
	    CURVE **c;
	    NODE  **n;

	    fr_pt = ntg->front_points;
	    for (n = intfc->nodes; n && *n; ++n)
	    {
		point = (*n)->posn;
		Coords(fr_pt)[0] = Coords(point)[0];
		Coords(fr_pt)[1] = Coords(point)[1];
		(void) add_to_hash_table((POINTER)point,(POINTER)fr_pt,
			                 hash_table,h_size);
		++fr_pt;
	    }
	    for (c = intfc->curves; c && *c; ++c)
	    {
		for (b = (*c)->first; b != (*c)->last; b = b->next)
		{
		   point = b->end;
		   Coords(fr_pt)[0] = Coords(point)[0];
		   Coords(fr_pt)[1] = Coords(point)[1];
		   (void) add_to_hash_table((POINTER)point,(POINTER)fr_pt,
				            hash_table,h_size);
		   ++fr_pt;
		}
	    }
	}
#endif /* defined(TWOD) */
#if defined(THREED)
	if (intfc->dim == 3)
	{
	    HYPER_SURF         *hs;
	    HYPER_SURF_ELEMENT *hse;

	    fr_pt = ntg->front_points;
	    (void) next_point(intfc,NULL,NULL,NULL);
	    while (next_point(intfc,&point,&hse,&hs))
	    {
	          Coords(fr_pt)[0] = Coords(point)[0];
	          Coords(fr_pt)[1] = Coords(point)[1];
	          Coords(fr_pt)[2] = Coords(point)[2];
	          (void) add_to_hash_table((POINTER)point,(POINTER)fr_pt,
				           hash_table,h_size);
	          ++fr_pt;
	    }
	}
#endif /* defined(THREED) */
}		/*end copy_tg_pts_from_intfc*/