int setup_tests(void **state) { quarks_init(); return 0; }
/* * Initialize some other arrays */ static errr init_other(void) { int i; /*** Prepare the various "bizarre" arrays ***/ /* Initialize the "macro" package */ (void)macro_init(); /* Initialize the "quark" package */ (void)quarks_init(); /* Initialize squelch things */ autoinscribe_init(); init_cmd_know(); /* Initialize the "message" package */ (void)messages_init(); /*** Prepare grid arrays ***/ /* Array of grids */ view_g = C_ZNEW(VIEW_MAX, u16b); /* Array of grids */ temp_g = C_ZNEW(TEMP_MAX, u16b); /* Hack -- use some memory twice */ temp_y = ((byte*)(temp_g)) + 0; temp_x = ((byte*)(temp_g)) + TEMP_MAX; /* Array of grids */ fire_g = C_ZNEW(VIEW_MAX, u16b); /* has_LIGHT patch causes both temp_g and temp_x/y to be used in targetting mode: can't use the same memory any more. */ temp_y = C_ZNEW(TEMP_MAX, byte); temp_x = C_ZNEW(TEMP_MAX, byte); /* Array of dynamic grids */ dyna_g = C_ZNEW(DYNA_MAX, dynamic_grid_type); /* Array of stacked monster messages */ mon_msg = C_ZNEW(MAX_STORED_MON_MSG, monster_race_message); mon_message_hist = C_ZNEW(MAX_STORED_MON_CODES, monster_message_history); /* Prepare monster movement array*/ mon_moment_info = C_ZNEW(z_info->m_max, move_moment_type); /*** Prepare dungeon arrays ***/ /* Padded into array */ cave_info = C_ZNEW(MAX_DUNGEON_HGT, u16b_256); /* Feature array */ cave_feat = C_ZNEW(MAX_DUNGEON_HGT, byte_wid); /* Entity arrays */ cave_o_idx = C_ZNEW(MAX_DUNGEON_HGT, s16b_wid); cave_m_idx = C_ZNEW(MAX_DUNGEON_HGT, s16b_wid); cave_x_idx = C_ZNEW(MAX_DUNGEON_HGT, s16b_wid); #ifdef MONSTER_SMELL /* Flow arrays */ cave_when = C_ZNEW(MAX_DUNGEON_HGT, byte_wid); #endif /* MONSTER_SMELL */ /*start with cost at center 0*/ for (i = 0; i < MAX_FLOWS; i++) { cost_at_center[i] = 0; } /*** Prepare "vinfo" array ***/ /* Used by "update_view()" */ (void)vinfo_init(); /*** Prepare entity arrays ***/ /* Objects */ o_list = C_ZNEW(z_info->o_max, object_type); /* Monsters */ mon_list = C_ZNEW(z_info->m_max, monster_type); /* Effects */ x_list = C_ZNEW(z_info->x_max, effect_type); /*** Prepare mosnter lore array ***/ /* Lore */ l_list = C_ZNEW(z_info->r_max, monster_lore); /*** Prepare terrain lore array ***/ /* Lore */ f_l_list = C_ZNEW(z_info->f_max, feature_lore); /*** Prepare artifact lore array ***/ /* Lore */ a_l_list = C_ZNEW(z_info->art_max, artifact_lore); /*** Prepare mouse buttons ***/ button_init(button_add_text, button_kill_text); /*** Prepare the inventory ***/ /* Allocate it */ inventory = C_ZNEW(ALL_INVEN_TOTAL, object_type); /*** Prepare the stores ***/ /* Allocate the stores */ store = C_ZNEW(MAX_STORES, store_type); /* Fill in each store */ for (i = 0; i < MAX_STORES; i++) { /* Get the store */ store_type *st_ptr = &store[i]; /* Assume full stock */ st_ptr->stock_size = STORE_INVEN_MAX; /* Allocate the stock */ st_ptr->stock = C_ZNEW(st_ptr->stock_size, object_type); } /*** Prepare the options ***/ /* Initialize the options */ for (i = 0; i < OPT_MAX; i++) { /* Default value */ op_ptr->opt[i] = options[i].normal; } /* Initialize the window flags */ for (i = 0; i < ANGBAND_TERM_MAX; i++) { /* Assume no flags */ op_ptr->window_flag[i] = 0L; } /*Clear the update flags*/ p_ptr->notice = 0L; p_ptr->update = 0L; p_ptr->redraw = 0L; /*** Pre-allocate space for the "format()" buffer ***/ /* Hack -- Just call the "format()" function */ (void)format("%s", MAINTAINER); /* Success */ return (0); }
/* * Initialize some other arrays */ static errr init_other(void) { int i; /*** Prepare the various "bizarre" arrays ***/ /* Initialize the "macro" package */ (void)macro_init(); /* Initialize the "quark" package */ (void)quarks_init(); /* Initialize squelch things */ autoinscribe_init(); squelch_init(); init_cmd_know(); /* Initialize the "message" package */ (void)messages_init(); /*** Prepare grid arrays ***/ /* Array of grids */ view_g = C_ZNEW(VIEW_MAX, u16b); /* Array of grids */ temp_g = C_ZNEW(TEMP_MAX, u16b); /* Hack -- use some memory twice */ temp_y = ((byte*)(temp_g)) + 0; temp_x = ((byte*)(temp_g)) + TEMP_MAX; /*** Prepare dungeon arrays ***/ /* Padded into array */ cave_info = C_ZNEW(DUNGEON_HGT, byte_256); cave_info2 = C_ZNEW(DUNGEON_HGT, byte_256); /* Feature array */ cave_feat = C_ZNEW(DUNGEON_HGT, byte_wid); /* Entity arrays */ cave_o_idx = C_ZNEW(DUNGEON_HGT, s16b_wid); cave_m_idx = C_ZNEW(DUNGEON_HGT, s16b_wid); /* Flow arrays */ cave_cost = C_ZNEW(DUNGEON_HGT, byte_wid); cave_when = C_ZNEW(DUNGEON_HGT, byte_wid); /*** Prepare "vinfo" array ***/ /* Used by "update_view()" */ (void)vinfo_init(); /*** Prepare entity arrays ***/ /* Objects */ o_list = C_ZNEW(z_info->o_max, object_type); /* Monsters */ mon_list = C_ZNEW(z_info->m_max, monster_type); /*** Prepare lore array ***/ /* Lore */ l_list = C_ZNEW(z_info->r_max, monster_lore); /*** Prepare mouse buttons ***/ button_init(button_add_text, button_kill_text); /*** Prepare quest array ***/ /* Quests */ q_list = C_ZNEW(MAX_Q_IDX, quest); /*** Prepare the inventory ***/ /* Allocate it */ inventory = C_ZNEW(ALL_INVEN_TOTAL, object_type); /*** Prepare the options ***/ option_set_defaults(); /* Initialize the window flags */ for (i = 0; i < ANGBAND_TERM_MAX; i++) { /* Assume no flags */ op_ptr->window_flag[i] = 0L; } /*** Pre-allocate space for the "format()" buffer ***/ /* Hack -- Just call the "format()" function */ (void)format("I wish you could swim, like dolphins can swim..."); /* Success */ return (0); }
/* init application functions and structures and widgets All widgets are created, but not visible. functions can now communicate with widgets */ static void InitializeApplication( Widget top ) { trace_level = SETTINGS.traceLevel; SETTINGS.vset = v_init(); quarks_init(); }