예제 #1
0
static void
macro_tree_delete_key (void *untyped_key)
{
  struct macro_key *key = (struct macro_key *) untyped_key;

  macro_bcache_free (key->table, (char *) key->name);
  macro_free (key, key->table);
}
예제 #2
0
파일: macro.c 프로젝트: dleonard0/state
void
macro_list_free(struct macro_list *next)
{
	struct macro_list *ml;

	while ((ml = next)) {
		next = ml->next;
		macro_free(ml->macro);
		macro_list_dealloc(ml);
	}
}
예제 #3
0
/* Free a source file, and all the source files it #included.  */
static void
free_macro_source_file (struct macro_source_file *src)
{
  struct macro_source_file *child, *next_child;

  /* Free this file's children.  */
  for (child = src->includes; child; child = next_child)
    {
      next_child = child->next_included;
      free_macro_source_file (child);
    }

  macro_bcache_free (src->table, (char *) src->filename);
  macro_free (src, src->table);
}
예제 #4
0
파일: macro.c 프로젝트: dleonard0/state
void
macro_ltrim(macro **mp)
{
        macro *m;

	while ((m = *mp)) {
            if (m->type != MACRO_STR)
	        break;
	    str_ltrim(&m->str);
	    if (m->str)
		break;
	    *mp = m->next;
            m->next = 0;
	    macro_free(m);
        }
}
예제 #5
0
/* Free a macro definition.  */
static void
macro_tree_delete_value (void *untyped_definition)
{
  struct macro_definition *d = (struct macro_definition *) untyped_definition;
  struct macro_table *t = d->table;

  if (d->kind == macro_function_like)
    {
      int i;

      for (i = 0; i < d->argc; i++)
        macro_bcache_free (t, (char *) d->argv[i]);
      macro_bcache_free (t, (char **) d->argv);
    }
  
  macro_bcache_free (t, (char *) d->replacement);
  macro_free (d, t);
}
예제 #6
0
파일: macro.c 프로젝트: dleonard0/state
void
macro_rtrim(macro **mp)
{
        macro *m = *mp;

        if (!m)
		return;
        macro_rtrim(&m->next);
	if (m->next)
		return;
        if (m->type != MACRO_STR)
		return;
        str_rtrim(&m->str);
	if (m->str)
		return;
        macro_free(m);
        *mp = 0;
}
예제 #7
0
파일: init2.c 프로젝트: cinereaste/angband
void cleanup_angband(void)
{
	int i;


	/* Free the macros */
	macro_free();

	/* Free the macro triggers */
	macro_trigger_free();

	/* Free the allocation tables */
	free_obj_alloc();
	FREE(alloc_ego_table);
	FREE(alloc_race_table);

	if (store)
	{
		/* Free the store inventories */
		for (i = 0; i < MAX_STORES; i++)
		{
			/* Get the store */
			store_type *st_ptr = &store[i];

			/* Free the store inventory */
			FREE(st_ptr->stock);
			FREE(st_ptr->table);
		}
	}


	/* Free the stores */
	FREE(store);

	/* Free the player inventory */
	FREE(inventory);

	/* Free the quest list */
	FREE(q_list);

	/* Free the lore, monster, and object lists */
	FREE(l_list);
	FREE(mon_list);
	FREE(o_list);

	/* Flow arrays */
	FREE(cave_when);
	FREE(cave_cost);

	/* Free the cave */
	FREE(cave_o_idx);
	FREE(cave_m_idx);
	FREE(cave_feat);
	FREE(cave_info2);
	FREE(cave_info);

	/* Free the "update_view()" array */
	FREE(view_g);

	/* Free the temp array */
	FREE(temp_g);

	/* Free the messages */
	messages_free();

	/* Free the "quarks" */
	quarks_free();

	/* Free the info, name, and text arrays */
	free_info(&flavor_head);
	free_info(&g_head);
	free_info(&b_head);
	free_info(&c_head);
	free_info(&p_head);
	free_info(&h_head);
	free_info(&v_head);
	free_info(&r_head);
	free_info(&e_head);
	free_info(&a_head);
	free_info(&k_head);
	free_info(&f_head);
	free_info(&z_head);
	free_info(&s_head);

	/* Free the format() buffer */
	vformat_kill();

	/* Free the directories */
	string_free(ANGBAND_DIR_APEX);
	string_free(ANGBAND_DIR_EDIT);
	string_free(ANGBAND_DIR_FILE);
	string_free(ANGBAND_DIR_HELP);
	string_free(ANGBAND_DIR_INFO);
	string_free(ANGBAND_DIR_SAVE);
	string_free(ANGBAND_DIR_PREF);
	string_free(ANGBAND_DIR_USER);
	string_free(ANGBAND_DIR_XTRA);
}
예제 #8
0
void cleanup_angband(void)
{
	int i;

    delete_notes_file();

	/* Free the macros */
	macro_free();

	/* Free the macro triggers */
	macro_trigger_free();

	/* Free the allocation tables */
	FREE(alloc_ego_table);
	FREE(alloc_feat_table);
	FREE(alloc_race_table);
	FREE(alloc_kind_table);

	if (store)
	{
		/* Free the store inventories */
		for (i = 0; i < MAX_STORES; i++)
		{
			/* Get the store */
			store_type *st_ptr = &store[i];

			/* Free the store inventory */
			FREE(st_ptr->stock);
		}
	}

	/* Free the stores */
	FREE(store);

	event_remove_all_handlers();

	/* free the buttons */
	button_free();

	/* Free the player inventory */
	FREE(inventory);

	/*Clean the Autoinscribe*/
	autoinscribe_clean();

	/* Free the lore, monster, effects, and object lists */
	FREE(l_list);
	FREE(f_l_list);
	FREE(a_l_list);
	FREE(mon_list);
	FREE(o_list);
	FREE(x_list);

#ifdef MONSTER_SMELL

	/* Flow arrays */
	FREE(cave_when);

#endif /* MONSTER_SMELL */

	/* Free the cave */
	FREE(cave_o_idx);
	FREE(cave_m_idx);
	FREE(cave_x_idx);
	FREE(cave_feat);
	FREE(cave_info);

	/* Prepare monster movement array*/
	FREE(mon_moment_info);

	/* Free the "update_view()" array */
	FREE(view_g);

	/* Free the other "update_view()" array */
	FREE(fire_g);

	/* Free the temp array */
	FREE(temp_g);
	FREE(temp_y);
	FREE(temp_x);

	/* Free the dynamic features array */
	FREE(dyna_g);

	/* Free the stacked monster messages */
	FREE(mon_msg);
	FREE(mon_message_hist);

	/* Free the messages */
	messages_free();

	/* Free the "quarks" */
	quarks_free();

	/*free the randart arrays*/
	free_randart_tables();

	/* Free the info, name, and text arrays */
	free_info(&flavor_head);
	free_info(&g_head);
	free_info(&b_head);
	free_info(&c_head);
	free_info(&p_head);
	free_info(&h_head);
	free_info(&v_head);
	free_info(&r_head);
	free_info(&e_head);
	free_info(&a_head);
	free_info(&k_head);
	free_info(&t_head);
	free_info(&f_head);
	free_info(&z_head);
	free_info(&n_head);

	/* Free the format() buffer */
	vformat_kill();

	/* Free the directories */
	string_free(ANGBAND_DIR);
	string_free(ANGBAND_DIR_APEX);
	string_free(ANGBAND_DIR_BONE);
	string_free(ANGBAND_DIR_DATA);
	string_free(ANGBAND_DIR_EDIT);
	string_free(ANGBAND_DIR_FILE);
	string_free(ANGBAND_DIR_HELP);
	string_free(ANGBAND_DIR_INFO);
	string_free(ANGBAND_DIR_SAVE);
	string_free(ANGBAND_DIR_PREF);
	string_free(ANGBAND_DIR_USER);
	string_free(ANGBAND_DIR_XTRA);
}