Added function name output when compiled with DEBUG.

This commit is contained in:
gyboth 2008-11-25 13:50:07 +00:00
parent 9e9f33093e
commit 23cfbb3f0c
78 changed files with 4243 additions and 23 deletions

View File

@ -41,6 +41,10 @@
gfloat
bet_round_odd(gfloat odd)
{
#ifdef DEBUG
printf("bet_round_odd\n");
#endif
gint local_odd = (gint)rint(odd * 100);
if(local_odd % 5 == 0)
@ -56,6 +60,10 @@ bet_round_odd(gfloat odd)
BetMatch*
bet_from_fixture(gint fix_id)
{
#ifdef DEBUG
printf("bet_from_fixture\n");
#endif
gint i, j;
for(i=1;i>=0;i--)
@ -74,6 +82,10 @@ bet_from_fixture(gint fix_id)
void
bet_update_user_bets(void)
{
#ifdef DEBUG
printf("bet_update_user_bets\n");
#endif
gint i, j, outcome;
const BetMatch *bet = NULL;
const Fixture *fix = NULL;
@ -127,6 +139,10 @@ bet_update_user_bets(void)
void
bet_get_odds(BetMatch *bet)
{
#ifdef DEBUG
printf("bet_get_odds\n");
#endif
const Fixture *fix = fixture_from_id(bet->fix_id, TRUE);
gfloat home_advantage = (fix->home_advantage) ?
(const_float("float_game_home_advantage_lower") +
@ -175,6 +191,10 @@ bet_get_odds(BetMatch *bet)
void
bet_update(void)
{
#ifdef DEBUG
printf("bet_update\n");
#endif
gint i;
GPtrArray *fixtures = fixture_get_week_list(week, week_round);
BetMatch new_bet;
@ -206,6 +226,10 @@ bet_update(void)
BetUser*
bet_is_user(const BetMatch *bet)
{
#ifdef DEBUG
printf("bet_is_user\n");
#endif
gint i, j;
for(i=1;i>=0;i--)
@ -221,6 +245,10 @@ bet_is_user(const BetMatch *bet)
gboolean
bet_place(gint fix_id, gint outcome, gint wager)
{
#ifdef DEBUG
printf("bet_place\n");
#endif
gint max_wager = (gint)rint(finance_wage_unit(current_user.tm) *
const_float("float_bet_wager_limit_factor"));
BetUser new_bet;
@ -261,6 +289,10 @@ bet_place(gint fix_id, gint outcome, gint wager)
void
bet_remove(gint fix_id)
{
#ifdef DEBUG
printf("bet_remove\n");
#endif
gint i;
for(i=0;i<current_user.bets[1]->len;i++)

View File

@ -89,6 +89,9 @@
#define debug const_int("int_debug")
#define debug_writer const_int("int_debug_writer")
/* Uncommenting this will cause each function to print its name when it's entered.
Makes the whole program really slow, of course. */
//#define DEBUG
/**
* Exit codes.

View File

@ -50,6 +50,10 @@
void
callback_show_next_live_game(void)
{
#ifdef DEBUG
printf("callback_show_next_live_game\n");
#endif
gint i, j;
for(i=0;i<users->len;i++)
@ -97,6 +101,10 @@ callback_show_next_live_game(void)
void
callback_player_activate(gint idx)
{
#ifdef DEBUG
printf("callback_player_activate\n");
#endif
if(stat0 == STATUS_SHOW_TRANSFER_LIST)
{
selected_row = -1;
@ -144,6 +152,10 @@ callback_player_activate(gint idx)
void
callback_player_clicked(gint idx, GdkEventButton *event)
{
#ifdef DEBUG
printf("callback_player_clicked\n");
#endif
/* Only accept single-clicks right now. */
if(event->type != GDK_BUTTON_PRESS)
return;
@ -164,6 +176,10 @@ callback_player_clicked(gint idx, GdkEventButton *event)
void
callback_show_last_match(gboolean start, LiveGame *lg)
{
#ifdef DEBUG
printf("callback_show_last_match\n");
#endif
gint i;
stat4 = -1;
@ -216,6 +232,10 @@ callback_show_last_match(gboolean start, LiveGame *lg)
void
callback_show_last_match_stats(void)
{
#ifdef DEBUG
printf("callback_show_last_match_stats\n");
#endif
current_user.live_game.fix =
fixture_from_id(current_user.live_game.fix_id, TRUE);
@ -229,6 +249,10 @@ callback_show_last_match_stats(void)
void
callback_show_fixtures_week(gint type)
{
#ifdef DEBUG
printf("callback_show_fixtures_week\n");
#endif
switch(type)
{
default:
@ -269,6 +293,10 @@ callback_show_fixtures_week(gint type)
void
callback_show_fixtures(gint type)
{
#ifdef DEBUG
printf("callback_show_fixtures\n");
#endif
const Fixture *fix = fixture_get(type, stat1, stat2, stat3,
current_user.tm);
@ -285,6 +313,10 @@ callback_show_fixtures(gint type)
void
callback_show_tables(gint type)
{
#ifdef DEBUG
printf("callback_show_tables\n");
#endif
gint clid = -1;
if(type == SHOW_CURRENT)
@ -318,6 +350,10 @@ callback_show_tables(gint type)
void
callback_get_loan(void)
{
#ifdef DEBUG
printf("callback_get_loan\n");
#endif
gchar buf[SMALL], buf2[SMALL];
gint max_loan =
finance_team_drawing_credit_loan(current_user.tm, TRUE) + current_user.debt;
@ -339,6 +375,10 @@ callback_get_loan(void)
void
callback_pay_loan(void)
{
#ifdef DEBUG
printf("callback_pay_loan\n");
#endif
gchar buf[SMALL], buf2[SMALL];
gint max_payback = MIN(BUDGET(cur_user), -current_user.debt);
@ -368,6 +408,10 @@ callback_pay_loan(void)
void
callback_transfer_list_user(gint button, gint idx)
{
#ifdef DEBUG
printf("callback_transfer_list_user\n");
#endif
gchar buf[SMALL],
buf2[SMALL], buf3[SMALL];
@ -410,6 +454,10 @@ callback_transfer_list_user(gint button, gint idx)
void
callback_transfer_list_cpu(gint button, gint idx)
{
#ifdef DEBUG
printf("callback_transfer_list_cpu\n");
#endif
gchar buf[SMALL], buf2[SMALL], buf3[SMALL];
if(button == 2)
@ -448,6 +496,10 @@ callback_transfer_list_cpu(gint button, gint idx)
void
callback_transfer_list_clicked(gint button, gint idx)
{
#ifdef DEBUG
printf("callback_transfer_list_clicked\n");
#endif
gchar buf[SMALL];
Transfer *tr = &trans(idx);
gint old_fee, old_wage = -1;
@ -509,6 +561,10 @@ callback_transfer_list_clicked(gint button, gint idx)
void
callback_offer_new_contract(gint idx)
{
#ifdef DEBUG
printf("callback_offer_new_contract\n");
#endif
gint i;
gchar buf[SMALL];
Player *pl = player_of_idx_team(current_user.tm, idx);
@ -568,6 +624,10 @@ callback_offer_new_contract(gint idx)
void
callback_show_team(gint type)
{
#ifdef DEBUG
printf("callback_show_team\n");
#endif
GtkTreeView *treeview_right =
GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right"));
const Team *tm;
@ -635,6 +695,10 @@ callback_show_team(gint type)
void
callback_show_player_list(gint type)
{
#ifdef DEBUG
printf("callback_show_player_list\n");
#endif
stat0 = STATUS_SHOW_PLAYER_LIST;
switch(type)
@ -665,6 +729,10 @@ callback_show_player_list(gint type)
void
callback_fire_player(gint idx)
{
#ifdef DEBUG
printf("callback_fire_player\n");
#endif
gchar buf[SMALL], buf2[SMALL];
Player *pl = player_of_idx_team(current_user.tm, idx);
@ -684,6 +752,10 @@ callback_fire_player(gint idx)
void
callback_show_league_stats(gint type)
{
#ifdef DEBUG
printf("callback_show_league_stats\n");
#endif
switch(type)
{
default:
@ -715,6 +787,10 @@ callback_show_league_stats(gint type)
void
callback_show_season_history(gint type)
{
#ifdef DEBUG
printf("callback_show_season_history\n");
#endif
const SeasonStat *stat = NULL;
gint len = season_stats->len;
@ -761,6 +837,10 @@ callback_show_season_history(gint type)
void
callback_show_next_opponent(void)
{
#ifdef DEBUG
printf("callback_show_next_opponent\n");
#endif
const Fixture *fix = team_get_fixture(current_user.tm, FALSE);
const Team *opp = (fix == NULL) ? NULL :
fix->teams[fix->teams[0] == current_user.tm];
@ -782,6 +862,10 @@ callback_show_next_opponent(void)
void
callback_show_player_team(void)
{
#ifdef DEBUG
printf("callback_show_player_team\n");
#endif
GtkTreeView *treeview_right =
GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right"));
const Player *pl =
@ -798,6 +882,10 @@ callback_show_player_team(void)
void
callback_show_youth_academy(void)
{
#ifdef DEBUG
printf("callback_show_youth_academy\n");
#endif
gint i;
PlayerListAttribute attributes;

View File

@ -54,6 +54,10 @@ on_button_quit_clicked (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_quit_clicked\n");
#endif
on_menu_quit_activate(NULL, NULL);
return TRUE;
@ -64,6 +68,10 @@ void
on_menu_new_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_new_activate\n");
#endif
window_destroy(&window.main);
free_memory();
@ -78,6 +86,10 @@ void
on_menu_open_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_open_activate\n");
#endif
stat5 = STATUS_LOAD_GAME;
window_show_file_sel();
}
@ -87,6 +99,10 @@ void
on_menu_save_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_save_activate\n");
#endif
if(!opt_int("int_opt_save_will_overwrite") ||
save_file == NULL)
on_menu_save_as_activate(NULL, NULL);
@ -99,6 +115,10 @@ void
on_menu_save_as_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_save_as_activate\n");
#endif
stat5 = STATUS_SAVE_GAME;
window_show_file_sel();
}
@ -107,6 +127,10 @@ void
on_menu_quit_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_quit_activate\n");
#endif
if(!getsav || !opt_int("int_opt_confirm_quit"))
main_exit_program(EXIT_OK, NULL);
else
@ -123,6 +147,10 @@ void
on_menu_help_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_help_activate\n");
#endif
window_show_help(2);
}
@ -131,6 +159,10 @@ void
on_menu_contributors_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_contributors_activate\n");
#endif
window_show_help(1);
}
@ -139,6 +171,10 @@ void
on_menu_about_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_about_activate\n");
#endif
window_show_help(0);
}
@ -147,6 +183,10 @@ void
on_button_load_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_load_clicked\n");
#endif
on_menu_open_activate(NULL, NULL);
}
@ -155,6 +195,10 @@ void
on_button_save_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_save_clicked\n");
#endif
on_menu_save_activate(NULL, NULL);
}
@ -163,6 +207,10 @@ void
on_button_back_to_main_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_back_to_main_clicked\n");
#endif
if(stat0 != STATUS_LIVE_GAME_PAUSE)
stat0 = STATUS_MAIN;
gtk_notebook_set_current_page(GTK_NOTEBOOK(lookup_widget(window.main, "notebook_player")), 0);
@ -177,6 +225,10 @@ void
on_button_transfers_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_transfers_clicked\n");
#endif
if(sett_int("int_opt_disable_transfers"))
game_gui_print_message(_("Transfers are disabled in this country definition."));
else if(week < transfer_get_deadline() || transfer_list->len > 0)
@ -206,6 +258,10 @@ void
on_button_new_week_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_new_week_clicked\n");
#endif
if(transfer_offers_pending())
game_gui_show_warning(_("You still have some transfer business to manage."));
else if(query_user_no_turn())
@ -232,6 +288,10 @@ on_player_list1_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_player_list1_button_press_event\n");
#endif
gint idx = -1;
if(event->button == 2)
@ -265,6 +325,10 @@ on_player_list1_key_press_event (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_player_list1_key_press_event\n");
#endif
gint idx = -1;
if(event->keyval != GDK_Return)
@ -288,6 +352,10 @@ void
on_button_browse_forward_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_browse_forward_clicked\n");
#endif
switch(stat0)
{
case STATUS_SHOW_FIXTURES:
@ -314,6 +382,10 @@ void
on_button_browse_back_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_browse_back_clicked\n");
#endif
switch(stat0)
{
case STATUS_SHOW_FIXTURES:
@ -339,6 +411,10 @@ void
on_button_cl_back_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_cl_back_clicked\n");
#endif
switch(stat0)
{
case STATUS_SHOW_FIXTURES:
@ -366,6 +442,10 @@ void
on_button_cl_forward_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_cl_forward_clicked\n");
#endif
switch(stat0)
{
case STATUS_SHOW_FIXTURES:
@ -394,6 +474,10 @@ void
on_menu_preferences_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_preferences_activate\n");
#endif
window_show_options();
}
@ -401,6 +485,10 @@ void
on_menu_fixtures_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_fixtures_activate\n");
#endif
game_gui_print_message(
_("Left click to show table."));
@ -414,6 +502,10 @@ void
on_menu_fixtures_week_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_fixtures_week_activate\n");
#endif
stat0 = STATUS_SHOW_FIXTURES_WEEK;
callback_show_fixtures_week(SHOW_CURRENT);
@ -425,6 +517,10 @@ void
on_menu_tables_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_tables_activate\n");
#endif
/* No tables in this country? */
if(!query_tables_in_country())
{
@ -448,6 +544,10 @@ void
on_menu_league_stats_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_league_stats_activate\n");
#endif
if(!query_leagues_active_in_country())
{
game_gui_print_message(
@ -466,6 +566,10 @@ void
on_menu_season_history_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_season_history_activate\n");
#endif
if(season_stats->len == 0)
{
game_gui_print_message(
@ -484,6 +588,10 @@ void
on_menu_put_on_transfer_list_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_put_on_transfer_list_activate\n");
#endif
if(sett_int("int_opt_disable_transfers"))
game_gui_print_message(_("Transfers are disabled in this country definition."));
else if(selected_row == -1)
@ -502,6 +610,10 @@ void
on_menu_remove_from_transfer_list_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_remove_from_transfer_list_activate\n");
#endif
if(selected_row == -1)
game_gui_print_message(_("You haven't selected a player."));
else if(!query_transfer_player_is_on_list(player_of_idx_team(current_user.tm, selected_row)))
@ -518,6 +630,10 @@ void
on_menu_fire_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_fire_activate\n");
#endif
if(selected_row == -1)
game_gui_print_message(_("You haven't selected a player."));
else if(current_user.tm->players->len == 11)
@ -534,6 +650,10 @@ void
on_menu_shoots_penalties_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_shoots_penalties_activate\n");
#endif
if(selected_row == -1)
game_gui_print_message(_("You haven't selected a player."));
else if(player_of_idx_team(current_user.tm, selected_row)->id ==
@ -560,6 +680,10 @@ void
on_menu_move_to_youth_academy_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_move_to_youth_academy_activate\n");
#endif
Player *pl;
if(sett_int("int_opt_disable_ya"))
@ -598,6 +722,10 @@ void
on_menu_my_league_results_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_my_league_results_activate\n");
#endif
stat0 = STATUS_SHOW_LEAGUE_RESULTS;
treeview_show_league_results(GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right")));
@ -610,6 +738,10 @@ void
on_menu_season_results_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_season_results_activate\n");
#endif
stat0 = STATUS_SHOW_SEASON_RESULTS;
treeview2_show_season_results();
gui_set_arrows();
@ -620,6 +752,10 @@ void
on_menu_browse_teams_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_browse_teams_activate\n");
#endif
GtkWidget *treeview_right =
lookup_widget(window.main, "treeview_right");
@ -636,6 +772,10 @@ on_treeview_right_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_treeview_right_button_press_event\n");
#endif
gint idx;
if(stat0 == STATUS_SHOW_FINANCES)
@ -736,6 +876,10 @@ void
on_menu_next_user_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_next_user_activate\n");
#endif
if(transfer_offers_pending())
{
game_gui_show_warning(_("You still have some transfer business to manage."));
@ -753,6 +897,10 @@ void
on_menu_previous_user_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_previous_user_activate\n");
#endif
if(transfer_offers_pending())
{
game_gui_show_warning(_("You still have some transfer business to manage."));
@ -770,6 +918,10 @@ void
on_menu_custom_structure_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_custom_structure_activate\n");
#endif
stat1 = STATUS_CUSTOM_STRUCTURE;
window_show_digits(_("Enter a structure. The digits must sum up to 10."),
NULL, -1, _("Structure"), current_user.tm->structure, FALSE);
@ -781,6 +933,10 @@ on_menu_team_button_release_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_team_button_release_event\n");
#endif
game_gui_read_radio_items(widget);
setsav0;
@ -791,6 +947,10 @@ void
on_menu_manage_users_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_manage_users_activate\n");
#endif
stat0 = stat1 = STATUS_USER_MANAGEMENT;
window_create(WINDOW_USER_MANAGEMENT);
treeview_show_users(GTK_TREE_VIEW(lookup_widget(window.user_management, "treeview_user_management_users")));
@ -803,6 +963,10 @@ void
on_menu_user_show_last_match_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_user_show_last_match_activate\n");
#endif
if(current_user.live_game.units->len == 0)
{
game_gui_show_warning(_("No match stored."));
@ -819,6 +983,10 @@ void
on_menu_user_show_last_stats_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_user_show_last_stats_activate\n");
#endif
if(current_user.live_game.units->len == 0)
{
game_gui_show_warning(_("No match stored."));
@ -837,6 +1005,10 @@ on_menu_user_show_coming_matches_activate
(GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_user_show_coming_matches_activate\n");
#endif
stat0 = STATUS_SHOW_PREVIEW;
treeview_show_preview();
@ -849,6 +1021,10 @@ on_eventbox_style_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_eventbox_style_button_press_event\n");
#endif
gint new_style = -1;
if(event->type != GDK_BUTTON_PRESS)
@ -882,6 +1058,10 @@ on_eventbox_boost_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_eventbox_boost_button_press_event\n");
#endif
gint new_boost = -1;
if(event->type != GDK_BUTTON_PRESS)
@ -916,6 +1096,10 @@ void
on_menu_show_finances_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_show_finances_activate\n");
#endif
if(sett_int("int_opt_disable_finances"))
{
game_gui_print_message(_("Finances are disabled in this country definition."));
@ -935,6 +1119,10 @@ void
on_menu_show_stadium_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_show_stadium_activate\n");
#endif
if(sett_int("int_opt_disable_stadium"))
{
game_gui_print_message(
@ -950,6 +1138,10 @@ on_menu_check_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_check_button_press_event\n");
#endif
game_gui_read_check_items(widget);
setsav0;
@ -961,6 +1153,10 @@ void
on_menu_offer_new_contract_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_offer_new_contract_activate\n");
#endif
if(sett_int("int_opt_disable_contracts"))
{
game_gui_print_message(_("Contracts are disabled in this country definition."));
@ -983,6 +1179,10 @@ void
on_menu_show_info_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_show_info_activate\n");
#endif
if(selected_row == -1)
{
game_gui_print_message(_("You haven't selected a player."));
@ -1002,6 +1202,10 @@ on_player_menu_put_on_transfer_list_activate
(GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_player_menu_put_on_transfer_list_activate\n");
#endif
on_menu_put_on_transfer_list_activate(NULL, NULL);
}
@ -1011,6 +1215,10 @@ on_player_menu_remove_from_transfer_list_activate
(GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_player_menu_remove_from_transfer_list_activate\n");
#endif
on_menu_remove_from_transfer_list_activate(NULL, NULL);
}
@ -1020,6 +1228,10 @@ on_player_menu_offer_new_contract_activate
(GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_player_menu_offer_new_contract_activate\n");
#endif
on_menu_offer_new_contract_activate(NULL, NULL);
}
@ -1028,6 +1240,10 @@ void
on_player_menu_fire_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_player_menu_fire_activate\n");
#endif
on_menu_fire_activate(NULL, NULL);
}
@ -1037,6 +1253,10 @@ on_player_menu_shoots_penalties_activate
(GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_player_menu_shoots_penalties_activate\n");
#endif
on_menu_shoots_penalties_activate(NULL, NULL);
}
@ -1045,6 +1265,10 @@ on_player_menu_move_to_youth_academy_activate
(GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_player_menu_move_to_youth_academy_activate\n");
#endif
on_menu_move_to_youth_academy_activate(NULL, NULL);
}
@ -1053,6 +1277,10 @@ void
on_menu_browse_players_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_browse_players_activate\n");
#endif
stat0 = STATUS_SHOW_PLAYER_LIST;
callback_show_player_list(SHOW_CURRENT);
@ -1063,6 +1291,10 @@ void
on_player_menu_show_info_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_player_menu_show_info_activate\n");
#endif
on_menu_show_info_activate(NULL, NULL);
}
@ -1071,6 +1303,10 @@ void
on_menu_rearrange_team_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_rearrange_team_activate\n");
#endif
team_rearrange(current_user.tm);
treeview_show_user_player_list();
}
@ -1080,6 +1316,10 @@ void
on_menu_load_last_save_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_load_last_save_activate\n");
#endif
if(load_save_load_game("last_save", FALSE))
{
cur_user = 0;
@ -1092,6 +1332,10 @@ void
on_menu_user_show_history_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_user_show_history_activate\n");
#endif
stat0 = STATUS_SHOW_USER_HISTORY;
treeview_show_user_history();
@ -1102,6 +1346,10 @@ void
on_button_reset_players_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_reset_players_clicked\n");
#endif
on_menu_reset_players_activate(NULL, NULL);
}
@ -1110,6 +1358,10 @@ void
on_menu_reset_players_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_reset_players_activate\n");
#endif
gint idx = -1;
if(team_is_user(usr(stat2).live_game.fix->teams[0]) == -1 ||
@ -1131,6 +1383,10 @@ on_button_quit_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_quit_button_press_event\n");
#endif
if(event->button == 3 && counters[COUNT_SHOW_DEBUG] == 0)
{
counters[COUNT_SHOW_DEBUG] = 1;
@ -1150,6 +1406,10 @@ void
on_menu_show_youth_academy_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_show_youth_academy_activate\n");
#endif
if(sett_int("int_opt_disable_ya"))
{
game_gui_print_message(
@ -1165,6 +1425,10 @@ void
on_menu_set_investment_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_set_investment_activate\n");
#endif
if(sett_int("int_opt_disable_ya"))
{
game_gui_print_message(
@ -1182,6 +1446,10 @@ void
on_menu_youth_move_to_team_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_youth_move_to_team_activate\n");
#endif
if(sett_int("int_opt_disable_ya"))
{
game_gui_print_message(
@ -1207,6 +1475,10 @@ on_menu_youth_kick_out_of_academy_activate
(GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_youth_kick_out_of_academy_activate\n");
#endif
if(opt_user_int("int_opt_user_confirm_youth"))
{
stat1 = STATUS_QUERY_KICK_YOUTH;
@ -1225,6 +1497,10 @@ void
on_mm_add_last_match_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_mm_add_last_match_activate\n");
#endif
if(current_user.live_game.units->len == 0)
{
game_gui_show_warning(_("No match stored."));
@ -1245,6 +1521,10 @@ void
on_mm_manage_matches_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_mm_manage_matches_activate\n");
#endif
if(current_user.mmatches_file == NULL)
{
stat5 = STATUS_SELECT_MM_FILE_LOAD;
@ -1258,6 +1538,10 @@ void
on_menu_save_window_geometry_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_save_window_geometry_activate\n");
#endif
window_main_save_geometry();
}
@ -1265,6 +1549,10 @@ void
on_menu_betting_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_betting_activate\n");
#endif
on_button_back_to_main_clicked(NULL, NULL);
window_show_bets();
}
@ -1273,6 +1561,10 @@ void
on_menu_show_job_exchange_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_menu_show_job_exchange_activate\n");
#endif
stat0 = STATUS_SHOW_JOB_EXCHANGE;
gui_set_arrows();
@ -1291,6 +1583,10 @@ on_hpaned2_button_release_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_hpaned2_button_release_event\n");
#endif
window.paned_pos =
gtk_paned_get_position(GTK_PANED(widget));
@ -1301,6 +1597,10 @@ void
on_training_camp_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_training_camp_activate\n");
#endif
if(sett_int("int_opt_disable_training_camp"))
{
game_gui_print_message(
@ -1329,6 +1629,10 @@ void
on_automatic_loan_repayment_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef DEBUG
printf("on_automatic_loan_repayment_activate\n");
#endif
if(sett_int("int_opt_disable_finances"))
{
game_gui_print_message(_("Finances are disabled in this country definition."));

136
src/cup.c
View File

@ -44,6 +44,10 @@
Cup
cup_new(gboolean new_id)
{
#ifdef DEBUG
printf("cup_new\n");
#endif
Cup new;
new.name = NULL;
@ -78,6 +82,14 @@ cup_new(gboolean new_id)
CupChooseTeam
cup_choose_team_new(void)
{
#ifdef DEBUG
printf("cup_choose_team_new\n");
#endif
#ifdef DEBUG
printf("cup_choose_team_new\n");
#endif
CupChooseTeam new;
new.sid = NULL;
@ -95,6 +107,10 @@ cup_choose_team_new(void)
CupRound
cup_round_new(void)
{
#ifdef DEBUG
printf("cup_round_new\n");
#endif
CupRound new;
new.new_teams = 0;
@ -122,6 +138,10 @@ cup_round_new(void)
void
cup_reset(Cup *cup)
{
#ifdef DEBUG
printf("cup_reset\n");
#endif
gint i;
free_gchar_array(&cup->team_names);
@ -161,6 +181,10 @@ cup_reset(Cup *cup)
gboolean
query_cup_choose_team_is_league(const gchar *sid)
{
#ifdef DEBUG
printf("query_cup_choose_team_is_league\n");
#endif
gint i;
for(i=0;i<ligs->len;i++)
@ -176,6 +200,10 @@ void
cup_get_choose_team_league_cup(const CupChooseTeam *ct,
const League **league, const Cup **cup)
{
#ifdef DEBUG
printf("cup_get_choose_team_league_cup\n");
#endif
gint i, idx;
gchar trash[SMALL];
@ -229,6 +257,10 @@ cup_get_choose_team_league_cup(const CupChooseTeam *ct,
void
cup_get_team_pointers(Cup *cup, gint round)
{
#ifdef DEBUG
printf("cup_get_team_pointers\n");
#endif
gint i;
CupRound *cup_round = &g_array_index(cup->rounds, CupRound, round);
GPtrArray *teams = cup_round->team_ptrs;
@ -277,6 +309,10 @@ cup_get_team_pointers(Cup *cup, gint round)
void
cup_load_choose_team(Cup *cup, GPtrArray *teams, const CupChooseTeam *ct)
{
#ifdef DEBUG
printf("cup_load_choose_team\n");
#endif
gint i;
gint debug_num = teams->len;
const League *league = NULL;
@ -301,6 +337,10 @@ cup_load_choose_team(Cup *cup, GPtrArray *teams, const CupChooseTeam *ct)
void
cup_load_choose_team_from_cup(Cup *cup, const Cup *cup_temp, GPtrArray *teams, const CupChooseTeam *ct)
{
#ifdef DEBUG
printf("cup_load_choose_team_from_cup\n");
#endif
gint i;
gint start, end;
gint number_of_teams;
@ -390,6 +430,10 @@ void
cup_load_choose_team_from_league(Cup *cup, const League *league,
GPtrArray *teams, const CupChooseTeam *ct)
{
#ifdef DEBUG
printf("cup_load_choose_team_from_league\n");
#endif
gint start, end;
gint number_of_teams;
gint j;
@ -463,6 +507,10 @@ cup_load_choose_team_from_league(Cup *cup, const League *league,
void
cup_load_choose_team_generate(Cup *cup, CupRound *cup_round, const CupChooseTeam *ct)
{
#ifdef DEBUG
printf("cup_load_choose_team_generate\n");
#endif
gint j, k;
gint number_of_teams, end_idx = -1;
GArray *teams_local = NULL;
@ -578,6 +626,10 @@ cup_load_choose_team_generate(Cup *cup, CupRound *cup_round, const CupChooseTeam
GPtrArray*
cup_get_teams_sorted(const Cup *cup)
{
#ifdef DEBUG
printf("cup_get_teams_sorted\n");
#endif
gint i, j;
GPtrArray *teams = g_ptr_array_new();
GArray *team_ids = g_array_new(FALSE, FALSE, sizeof(gint));
@ -603,6 +655,10 @@ cup_get_teams_sorted(const Cup *cup)
gint
cup_compare_success(gconstpointer a, gconstpointer b, gpointer data)
{
#ifdef DEBUG
printf("cup_compare_success\n");
#endif
const Cup *cup = (const Cup*)data;
const CupRound *cupround = NULL;
const GArray *fixtures = cup->fixtures;
@ -636,6 +692,10 @@ cup_compare_success(gconstpointer a, gconstpointer b, gpointer data)
gint
cup_compare_success_knockout(const Team *tm1, const Team *tm2, const GArray *fixtures)
{
#ifdef DEBUG
printf("cup_compare_success_knockout\n");
#endif
gint i;
gint winner1 = -1, winner2 = -1;
gint return_value = 0;
@ -669,6 +729,10 @@ cup_compare_success_knockout(const Team *tm1, const Team *tm2, const GArray *fix
gint
cup_compare_success_tables(const Team *tm1, const Team *tm2, const Cup *cup, gint round)
{
#ifdef DEBUG
printf("cup_compare_success_tables\n");
#endif
gint i, j;
gint return_value = 0;
const CupRound *cupround = &g_array_index(cup->rounds, CupRound, round);
@ -700,6 +764,10 @@ cup_compare_success_tables(const Team *tm1, const Team *tm2, const Cup *cup, gin
gint
cup_get_round_reached(const Team *tm, const GArray *fixtures)
{
#ifdef DEBUG
printf("cup_get_round_reached\n");
#endif
gint round = -1;
gint i;
@ -719,6 +787,10 @@ cup_get_round_reached(const Team *tm, const GArray *fixtures)
gint
cup_get_first_week_of_cup_round(Cup *cup, gint cup_round)
{
#ifdef DEBUG
printf("cup_get_first_week_of_cup_round\n");
#endif
gint i;
gint week_number;
@ -762,6 +834,10 @@ cup_get_first_week_of_cup_round(Cup *cup, gint cup_round)
gint
cup_get_last_week_from_first(const Cup *cup, gint first_week)
{
#ifdef DEBUG
printf("cup_get_last_week_from_first\n");
#endif
gint i;
gint matchdays = 0;
@ -778,6 +854,10 @@ cup_get_last_week_from_first(const Cup *cup, gint first_week)
gint
cup_get_matchdays_in_cup_round(const Cup *cup, gint round)
{
#ifdef DEBUG
printf("cup_get_matchdays_in_cup_round\n");
#endif
gint i;
const CupRound *cup_round = &g_array_index(cup->rounds, CupRound, round);
gint number_of_teams = -1;
@ -821,6 +901,10 @@ cup_get_matchdays_in_cup_round(const Cup *cup, gint round)
gint
cup_round_get_number_of_teams(const Cup *cup, gint round)
{
#ifdef DEBUG
printf("cup_round_get_number_of_teams\n");
#endif
const CupRound *cup_round = &g_array_index(cup->rounds, CupRound, round);
gint number_of_teams = 0;
@ -845,6 +929,10 @@ cup_round_get_number_of_teams(const Cup *cup, gint round)
gint
cup_round_get_byes(const Cup *cup, gint round)
{
#ifdef DEBUG
printf("cup_round_get_byes\n");
#endif
const CupRound *cup_round = &g_array_index(cup->rounds, CupRound, round);
gint number_of_byes = 0, new_teams = 0;
@ -880,6 +968,10 @@ cup_round_get_byes(const Cup *cup, gint round)
gint
cup_round_get_new_teams(const CupRound *cup_round)
{
#ifdef DEBUG
printf("cup_round_get_new_teams\n");
#endif
gint i, new_teams = 0;
const Cup *cup_temp = NULL;
const League *league = NULL;
@ -922,6 +1014,10 @@ cup_round_get_new_teams(const CupRound *cup_round)
Cup*
cup_from_clid(gint clid)
{
#ifdef DEBUG
printf("cup_from_clid\n");
#endif
gint i;
for(i=0;i<cps->len;i++)
@ -938,6 +1034,10 @@ cup_from_clid(gint clid)
Cup*
cup_from_sid(const gchar *sid)
{
#ifdef DEBUG
printf("cup_from_sid\n");
#endif
gint i;
for(i=0;i<cps->len;i++)
@ -957,6 +1057,10 @@ cup_from_sid(const gchar *sid)
void
cup_round_name(const Fixture *fix, gchar *buf)
{
#ifdef DEBUG
printf("cup_round_name\n");
#endif
const Cup *cup = cup_from_clid(fix->clid);
const CupRound *cup_round =
&g_array_index(cup->rounds, CupRound, fix->round);
@ -978,6 +1082,10 @@ cup_round_name(const Fixture *fix, gchar *buf)
void
cup_get_round_name(const Cup *cup, gint round, gchar *buf)
{
#ifdef DEBUG
printf("cup_get_round_name\n");
#endif
const CupRound *cup_round =
&g_array_index(cup->rounds, CupRound, round);
@ -1013,6 +1121,10 @@ cup_get_round_name(const Cup *cup, gint round, gchar *buf)
gint
cup_has_tables(gint clid)
{
#ifdef DEBUG
printf("cup_has_tables\n");
#endif
const Cup *cup = cup_from_clid(clid);
gint i;
@ -1027,6 +1139,10 @@ cup_has_tables(gint clid)
Team*
cup_get_winner(const Cup *cup)
{
#ifdef DEBUG
printf("cup_get_winner\n");
#endif
GPtrArray *teams_sorted = cup_get_teams_sorted(cup);
Team *tm = (Team*)g_ptr_array_index(teams_sorted, 0);
@ -1039,6 +1155,10 @@ cup_get_winner(const Cup *cup)
gboolean
query_cup_begins(const Cup *cup)
{
#ifdef DEBUG
printf("query_cup_begins\n");
#endif
gint i, j;
const League *league = NULL;
const Cup *cup_temp = NULL;
@ -1075,6 +1195,10 @@ query_cup_begins(const Cup *cup)
gboolean
query_cup_transfer(void)
{
#ifdef DEBUG
printf("query_cup_transfer\n");
#endif
gint i;
for(i=0;i<acps->len;i++)
@ -1089,6 +1213,14 @@ query_cup_transfer(void)
gchar*
cup_get_highlight_colour(const Cup *cup)
{
#ifdef DEBUG
printf("cup_get_highlight_colour\n");
#endif
#ifdef DEBUG
printf("cup_get_highlight_colour\n");
#endif
gint i;
gchar buf[SMALL];
@ -1107,6 +1239,10 @@ cup_get_highlight_colour(const Cup *cup)
gboolean
cup_check_fixtures(const Cup *cup)
{
#ifdef DEBUG
printf("cup_check_fixtures\n");
#endif
gint i;
for(i = 0; i < cup->fixtures->len; i++)

View File

@ -39,6 +39,10 @@
void
debug_action(const gchar *text)
{
#ifdef DEBUG
printf("debug_action\n");
#endif
gchar buf[SMALL];
gint value = -1;
@ -140,6 +144,10 @@ debug_action(const gchar *text)
gboolean
debug_reset_counter(gpointer data)
{
#ifdef DEBUG
printf("debug_reset_counter\n");
#endif
counters[COUNT_SHOW_DEBUG] = 0;
return FALSE;
@ -148,6 +156,10 @@ debug_reset_counter(gpointer data)
void
debug_calibrate_betting_odds(gint skilldiffmax, gint matches_per_skilldiff)
{
#ifdef DEBUG
printf("debug_calibrate_betting_odds\n");
#endif
gint i, skilldiff, matches;
Fixture *fix = &g_array_index(lig(0).fixtures, Fixture, 0);
@ -189,6 +201,10 @@ debug_calibrate_betting_odds(gint skilldiffmax, gint matches_per_skilldiff)
gboolean
debug_egg_forwards_boost_style(void)
{
#ifdef DEBUG
printf("debug_egg_forwards_boost_style\n");
#endif
gint i, fwds = 0;
if(current_user.tm->boost != 1 ||
@ -219,6 +235,10 @@ debug_writer_out(const gchar *file_name,
const gchar *text,
gint debuglevel)
{
#ifdef DEBUG
printf("debug_writer_out\n");
#endif
gint writer = option_int("int_debug_writer", &constants);
gint debugging = option_int("int_debug", &constants);

View File

@ -47,6 +47,10 @@
void
file_add_support_directory_recursive (const gchar *directory)
{
#ifdef DEBUG
printf("file_add_support_directory_recursive\n");
#endif
GDir *newdir =
g_dir_open(directory, 0, NULL);
const gchar *file;
@ -98,6 +102,14 @@ file_add_support_directory_recursive (const gchar *directo
gchar*
file_find_support_file (const gchar *filename, gboolean warning)
{
#ifdef DEBUG
printf("file_find_support_file\n");
#endif
#ifdef DEBUG
printf("file_find_support_file\n");
#endif
GList *elem = support_directories;
while (elem)
@ -123,6 +135,10 @@ file_find_support_file (const gchar *filename, gboolea
gboolean
file_my_system(const GString *command)
{
#ifdef DEBUG
printf("file_my_system\n");
#endif
if(system(command->str) != 0)
{
g_warning("file_my_system: system returned -1 when executing '%s'.", command->str);
@ -148,6 +164,10 @@ file_my_system(const GString *command)
gboolean
file_my_fopen(const gchar *filename, gchar *bits, FILE **fil, gboolean abort_program)
{
#ifdef DEBUG
printf("file_my_fopen\n");
#endif
gchar *support_file = NULL;
*fil = fopen(filename, bits);
@ -176,6 +196,10 @@ file_my_fopen(const gchar *filename, gchar *bits, FILE **fil, gboolean abort_pro
void
file_check_home_dir_create_dirs(void)
{
#ifdef DEBUG
printf("file_check_home_dir_create_dirs\n");
#endif
gint i;
gchar *dirs[3] =
{HOMEDIRNAME,
@ -197,6 +221,10 @@ file_check_home_dir_create_dirs(void)
void
file_check_home_dir_get_conf_files(GPtrArray **files_to_copy)
{
#ifdef DEBUG
printf("file_check_home_dir_get_conf_files\n");
#endif
gint i;
gchar *conf_files[2] =
{"bygfoot.conf",
@ -224,6 +252,10 @@ void
file_check_home_dir_get_definition_dir(const gchar *dirname, const gchar *basename,
GPtrArray **files_to_copy)
{
#ifdef DEBUG
printf("file_check_home_dir_get_definition_dir\n");
#endif
gint i;
gchar buf[SMALL], buf2[SMALL];
const gchar *home = g_get_home_dir();
@ -275,6 +307,10 @@ file_check_home_dir_get_definition_dir(const gchar *dirname, const gchar *basena
void
file_check_home_dir_get_definition_files(GPtrArray **files_to_copy)
{
#ifdef DEBUG
printf("file_check_home_dir_get_definition_files\n");
#endif
GList *elem = support_directories;
while(elem != NULL)
@ -292,6 +328,10 @@ file_check_home_dir_get_definition_files(GPtrArray **files_to_copy)
void
file_check_home_dir_copy_files(GPtrArray **files_to_copy)
{
#ifdef DEBUG
printf("file_check_home_dir_copy_files\n");
#endif
gint i;
gchar buf[SMALL];
const gchar *filename = NULL;
@ -349,6 +389,10 @@ file_check_home_dir_copy_files(GPtrArray **files_to_copy)
gboolean
file_check_home_dir(void)
{
#ifdef DEBUG
printf("file_check_home_dir\n");
#endif
GPtrArray *files_to_copy[2] = {g_ptr_array_new(),
g_ptr_array_new()};
@ -376,6 +420,10 @@ file_check_home_dir(void)
GPtrArray*
file_dir_get_contents(const gchar *dir_name, const gchar *prefix, const gchar *suffix)
{
#ifdef DEBUG
printf("file_dir_get_contents\n");
#endif
GError *error = NULL;
GDir *dir = g_dir_open(dir_name, 0, &error);
GPtrArray *contents = g_ptr_array_new();
@ -409,6 +457,10 @@ file_dir_get_contents(const gchar *dir_name, const gchar *prefix, const gchar *s
GPtrArray*
file_get_country_files(void)
{
#ifdef DEBUG
printf("file_get_country_files\n");
#endif
gint i;
GList *elem = support_directories;
GPtrArray *country_files = g_ptr_array_new();
@ -443,6 +495,10 @@ file_get_country_files(void)
gboolean
file_get_next_opt_line(FILE *fil, gchar *opt_name, gchar *opt_value)
{
#ifdef DEBUG
printf("file_get_next_opt_line\n");
#endif
gint i;
gchar trash[SMALL];
gchar buf[BIG];
@ -486,6 +542,10 @@ file_get_next_opt_line(FILE *fil, gchar *opt_name, gchar *opt_value)
void
file_save_opt_file(const gchar *filename, OptionList *optionlist)
{
#ifdef DEBUG
printf("file_save_opt_file\n");
#endif
gint i;
FILE *fil = NULL;
@ -507,6 +567,10 @@ file_save_opt_file(const gchar *filename, OptionList *optionlist)
void
file_load_opt_file(const gchar *filename, OptionList *optionlist)
{
#ifdef DEBUG
printf("file_load_opt_file\n");
#endif
gint i;
gchar opt_name[SMALL], opt_value[SMALL];
Option new;
@ -553,6 +617,10 @@ file_load_opt_file(const gchar *filename, OptionList *optionlist)
void
file_load_hints_file(void)
{
#ifdef DEBUG
printf("file_load_hints_file\n");
#endif
gchar buf[SMALL], hints_file[SMALL];
gchar *hints_file_sup = NULL;
@ -574,6 +642,10 @@ file_load_hints_file(void)
void
file_load_conf_files(void)
{
#ifdef DEBUG
printf("file_load_conf_files\n");
#endif
gint i;
gchar *conf_file = file_find_support_file("bygfoot.conf", TRUE);
@ -594,6 +666,10 @@ file_load_conf_files(void)
void
file_load_user_conf_file(User *user)
{
#ifdef DEBUG
printf("file_load_user_conf_file\n");
#endif
FILE *fil = NULL;
gchar *conf_file = NULL, buf[SMALL];
@ -617,6 +693,14 @@ file_load_user_conf_file(User *user)
const gchar*
file_get_first_support_dir(void)
{
#ifdef DEBUG
printf("file_get_first_support_dir\n");
#endif
#ifdef DEBUG
printf("file_get_first_support_dir\n");
#endif
GList *elem = support_directories;
while (elem)
@ -638,6 +722,14 @@ file_get_first_support_dir(void)
const gchar*
file_get_first_support_dir_suffix(const gchar *suffix)
{
#ifdef DEBUG
printf("file_get_first_support_dir_suffix\n");
#endif
#ifdef DEBUG
printf("file_get_first_support_dir_suffix\n");
#endif
GList *elem = support_directories;
while (elem)
@ -659,6 +751,10 @@ file_get_first_support_dir_suffix(const gchar *suffix)
void
file_compress_files(const gchar *destfile, const gchar *prefix)
{
#ifdef DEBUG
printf("file_compress_files\n");
#endif
gint i;
GString *buf = g_string_new("");
gchar *basename = g_path_get_basename(prefix),
@ -706,6 +802,10 @@ file_compress_files(const gchar *destfile, const gchar *prefix)
void
file_decompress(const gchar *filename)
{
#ifdef DEBUG
printf("file_decompress\n");
#endif
GString *buf = g_string_new("");
gchar *dirname = g_path_get_dirname(filename),
*basename = g_path_get_basename(filename),
@ -740,6 +840,10 @@ file_decompress(const gchar *filename)
void
file_remove_files(const GString *files)
{
#ifdef DEBUG
printf("file_remove_files\n");
#endif
GString *buf = g_string_new("");
if(os_is_unix)
@ -756,6 +860,10 @@ file_remove_files(const GString *files)
void
file_copy_file(const gchar *source_file, const gchar *dest_file)
{
#ifdef DEBUG
printf("file_copy_file\n");
#endif
GString *buf = g_string_new("");
if(os_is_unix)
@ -775,6 +883,10 @@ file_copy_file(const gchar *source_file, const gchar *dest_file)
void
file_get_bygfoot_dir(gchar *dir)
{
#ifdef DEBUG
printf("file_get_bygfoot_dir\n");
#endif
const gchar *home = g_get_home_dir();
gchar *pwd = g_get_current_dir();

View File

@ -39,6 +39,10 @@
void
finance_update_user_weekly(User *user)
{
#ifdef DEBUG
printf("finance_update_user_weekly\n");
#endif
gint i;
Team *tm = user->tm;
Team *new_team = NULL;
@ -175,6 +179,10 @@ finance_update_user_weekly(User *user)
gfloat
finance_wage_unit(const Team *tm)
{
#ifdef DEBUG
printf("finance_wage_unit\n");
#endif
gint i;
gfloat sum = 0;
@ -189,6 +197,10 @@ finance_wage_unit(const Team *tm)
gint
finance_team_drawing_credit_loan(const Team *tm, gboolean loan)
{
#ifdef DEBUG
printf("finance_team_drawing_credit_loan\n");
#endif
gint i;
gfloat sum = 0;
@ -211,6 +223,10 @@ finance_team_drawing_credit_loan(const Team *tm, gboolean loan)
void
finance_get_loan(gint value)
{
#ifdef DEBUG
printf("finance_get_loan\n");
#endif
gfloat debt_old = current_user.debt;
gfloat debt_new = -value;
@ -244,6 +260,10 @@ finance_get_loan(gint value)
void
finance_pay_loan(User *user, gint value)
{
#ifdef DEBUG
printf("finance_pay_loan\n");
#endif
gint add = (gint)rint((gfloat)value / (gfloat)(-user->debt) *
(gfloat)const_int("int_finance_payback_weeks"));
@ -277,6 +297,10 @@ finance_pay_loan(User *user, gint value)
gint
finance_get_stadium_improvement_cost(gfloat value, gboolean capacity)
{
#ifdef DEBUG
printf("finance_get_stadium_improvement_cost\n");
#endif
gfloat return_value;
if(capacity)
@ -318,6 +342,10 @@ finance_get_stadium_improvement_cost(gfloat value, gboolean capacity)
gint
finance_get_stadium_improvement_duration(gfloat value, gboolean capacity)
{
#ifdef DEBUG
printf("finance_get_stadium_improvement_duration\n");
#endif
gint return_value;
if(capacity)
@ -336,6 +364,10 @@ finance_get_stadium_improvement_duration(gfloat value, gboolean capacity)
void
finance_assign_game_money(const Fixture *fix)
{
#ifdef DEBUG
printf("finance_assign_game_money\n");
#endif
gint i;
gint user_idx[2] = {team_is_user(fix->teams[0]), team_is_user(fix->teams[1])};
gfloat journey_factor =
@ -389,6 +421,10 @@ finance_assign_game_money(const Fixture *fix)
void
finance_update_current_interest(void)
{
#ifdef DEBUG
printf("finance_update_current_interest\n");
#endif
current_interest += math_rndi(-1, 1) * const_float("float_finance_interest_step");
if(current_interest < const_float("float_finance_interest_lower"))
@ -402,6 +438,10 @@ finance_update_current_interest(void)
gint
finance_calculate_alr_weekly_installment(gint start_week)
{
#ifdef DEBUG
printf("finance_calculate_alr_weekly_installment\n");
#endif
gfloat debt_end;
gfloat interest_factor;
gfloat max_start_week;
@ -425,6 +465,10 @@ finance_calculate_alr_weekly_installment(gint start_week)
gint
finance_calculate_alr_start_week(gint weekly_installment)
{
#ifdef DEBUG
printf("finance_calculate_alr_start_week\n");
#endif
gint upper;
gint start_week;
gint installment;

View File

@ -42,6 +42,10 @@
void
fixture_write_league_fixtures(League *league)
{
#ifdef DEBUG
printf("fixture_write_league_fixtures\n");
#endif
gint i,j;
gint max_rr;
gint joined_clids[league->joined_leagues->len];
@ -102,6 +106,10 @@ fixture_write_league_fixtures(League *league)
gboolean
fixture_write_cup_fixtures(Cup *cup)
{
#ifdef DEBUG
printf("fixture_write_cup_fixtures\n");
#endif
gint i;
for(i=0;i<cup->rounds->len;i++)
@ -124,6 +132,10 @@ fixture_write_cup_fixtures(Cup *cup)
void
fixture_update(Cup *cup)
{
#ifdef DEBUG
printf("fixture_update\n");
#endif
gint i;
GArray *fixtures = cup->fixtures;
gint round = g_array_index(fixtures, Fixture, fixtures->len - 1).round;
@ -187,6 +199,10 @@ fixture_update(Cup *cup)
GPtrArray*
fixture_get_cup_round_winners(const Cup *cup)
{
#ifdef DEBUG
printf("fixture_get_cup_round_winners\n");
#endif
gint i;
GPtrArray *array = NULL;
GArray *fixtures = cup->fixtures;
@ -238,6 +254,10 @@ fixture_get_cup_round_winners(const Cup *cup)
GPtrArray*
fixture_get_round_robin_advance(const Cup *cup, gint round)
{
#ifdef DEBUG
printf("fixture_get_round_robin_advance\n");
#endif
const CupRound *cupround = &g_array_index(cup->rounds, CupRound, round);
GPtrArray *teams = cup_get_teams_sorted(cup);
gint i, remove = teams->len -
@ -259,6 +279,10 @@ fixture_get_round_robin_advance(const Cup *cup, gint round)
gpointer
fixture_winner_of(const Fixture *fix, gboolean team_id)
{
#ifdef DEBUG
printf("fixture_winner_of\n");
#endif
gint winner_idx = -1;
const Fixture *first_leg = NULL;
const CupRound *cupround = NULL;
@ -309,6 +333,10 @@ fixture_winner_of(const Fixture *fix, gboolean team_id)
gboolean
fixture_update_write_replays(Cup *cup)
{
#ifdef DEBUG
printf("fixture_update_write_replays\n");
#endif
gint i;
GArray *fixtures = cup->fixtures;
gint replay_number = g_array_index(fixtures, Fixture, fixtures->len - 1).replay_number + 1;
@ -344,6 +372,10 @@ fixture_update_write_replays(Cup *cup)
void
fixture_write_cup_round_robin(Cup *cup, gint cup_round, GPtrArray *teams)
{
#ifdef DEBUG
printf("fixture_write_cup_round_robin\n");
#endif
gint i, j, cnt;
CupRound *cupround = &g_array_index(cup->rounds, CupRound, cup_round);
gint number_of_groups = cupround->round_robin_number_of_groups;
@ -433,6 +465,10 @@ void
fixture_write_round_robin(gpointer league_cup, gint cup_round,
GPtrArray *teams, gboolean one_round)
{
#ifdef DEBUG
printf("fixture_write_round_robin\n");
#endif
gint i, j;
gint first_week, week_gap, week_number,
week_round_number, clid, first_fixture,
@ -553,6 +589,10 @@ fixture_write_round_robin_matchday(GArray *fixtures, gint cup_round, GPtrArray *
gint special, gint week_number,
gint clid, gboolean home_advantage)
{
#ifdef DEBUG
printf("fixture_write_round_robin_matchday\n");
#endif
gint i;
gint len = teams->len / 2;
gpointer home[len], away[len];
@ -586,6 +626,10 @@ fixture_write_round_robin_matchday(GArray *fixtures, gint cup_round, GPtrArray *
void
fixture_write_knockout_round(Cup *cup, gint cup_round, GPtrArray *teams)
{
#ifdef DEBUG
printf("fixture_write_knockout_round\n");
#endif
gint i, len = teams->len;
gint first_week = cup_get_first_week_of_cup_round(cup, cup_round);
gint week_number, week_round_number;
@ -678,6 +722,10 @@ fixture_write(GArray *fixtures, Team *home_team, Team *away_team, gint week_numb
gint week_round_number, gint clid, gint cup_round, gint replay_number,
gboolean home_advantage, gboolean second_leg, gboolean decisive)
{
#ifdef DEBUG
printf("fixture_write\n");
#endif
gint i;
Fixture new;
@ -714,6 +762,10 @@ fixture_write(GArray *fixtures, Team *home_team, Team *away_team, gint week_numb
gint
fixture_get_free_round(gint week_number, const GPtrArray *teams, gint team_id1, gint team_id2)
{
#ifdef DEBUG
printf("fixture_get_free_round\n");
#endif
gint i, j;
gint max_round = 0;
@ -756,6 +808,10 @@ fixture_get_free_round(gint week_number, const GPtrArray *teams, gint team_id1,
gboolean
query_fixture_is_earlier(const Fixture *fix1, const Fixture *fix2)
{
#ifdef DEBUG
printf("query_fixture_is_earlier\n");
#endif
return (fix1->week_number < fix2->week_number ||
(fix1->week_number == fix2->week_number &&
fix1->week_round_number < fix2->week_round_number));
@ -769,6 +825,10 @@ query_fixture_is_earlier(const Fixture *fix1, const Fixture *fix2)
gboolean
query_fixture_is_later(const Fixture *fix1, const Fixture *fix2)
{
#ifdef DEBUG
printf("query_fixture_is_later\n");
#endif
return (fix1->week_number > fix2->week_number ||
(fix1->week_number == fix2->week_number &&
fix1->week_round_number > fix2->week_round_number));
@ -783,6 +843,10 @@ query_fixture_is_later(const Fixture *fix1, const Fixture *fix2)
gboolean
query_fixture_is_draw(const Fixture *fix)
{
#ifdef DEBUG
printf("query_fixture_is_draw\n");
#endif
const Fixture *first_leg;
if(!fix->decisive)
@ -805,6 +869,10 @@ query_fixture_is_draw(const Fixture *fix)
gint
fixture_user_team_involved(const Fixture *fix)
{
#ifdef DEBUG
printf("fixture_user_team_involved\n");
#endif
if(team_is_user(fix->teams[0]) != -1)
return team_is_user(fix->teams[0]);
@ -821,6 +889,10 @@ fixture_user_team_involved(const Fixture *fix)
gboolean
query_fixture_has_tables(const Fixture *fix)
{
#ifdef DEBUG
printf("query_fixture_has_tables\n");
#endif
return (fix->clid < ID_CUP_START ||
cup_has_tables(fix->clid) == fix->round);
}
@ -834,6 +906,10 @@ query_fixture_has_tables(const Fixture *fix)
gboolean
query_fixture_in_week_round(gint clid, gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("query_fixture_in_week_round\n");
#endif
gint i;
GArray *fixtures = league_cup_get_fixtures(clid);
@ -852,6 +928,10 @@ query_fixture_in_week_round(gint clid, gint week_number, gint week_round_number)
Fixture*
fixture_get_first_leg(const Fixture *fix)
{
#ifdef DEBUG
printf("fixture_get_first_leg\n");
#endif
gint i;
Fixture *first_leg = NULL;
@ -875,6 +955,10 @@ fixture_get_first_leg(const Fixture *fix)
GPtrArray*
fixture_get_week_list_clid(gint clid, gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("fixture_get_week_list_clid\n");
#endif
gint i;
GArray *fixtures = league_cup_get_fixtures(clid);
GPtrArray *fixtures_array = g_ptr_array_new();
@ -891,6 +975,10 @@ fixture_get_week_list_clid(gint clid, gint week_number, gint week_round_number)
GPtrArray*
fixture_get_week_list(gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("fixture_get_week_list\n");
#endif
gint i, j;
GPtrArray *fixtures = g_ptr_array_new();
@ -914,6 +1002,10 @@ fixture_get_week_list(gint week_number, gint week_round_number)
void
fixture_result_to_buf(const Fixture *fix, gchar *buf, gboolean swap)
{
#ifdef DEBUG
printf("fixture_result_to_buf\n");
#endif
gchar local_buf[SMALL];
gint idx0 = 0, idx1 = 1;
@ -952,6 +1044,10 @@ fixture_result_to_buf(const Fixture *fix, gchar *buf, gboolean swap)
gint
fixture_get_number_of_matches(gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("fixture_get_number_of_matches\n");
#endif
gint i, j;
gint sum = 0;
@ -981,6 +1077,10 @@ fixture_get_number_of_matches(gint week_number, gint week_round_number)
Fixture*
fixture_get_next(gint clid, gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("fixture_get_next\n");
#endif
gint i;
GArray *fixtures = league_cup_get_fixtures(clid);
@ -1001,6 +1101,10 @@ fixture_get_next(gint clid, gint week_number, gint week_round_number)
Fixture*
fixture_get_previous(gint clid, gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("fixture_get_previous\n");
#endif
gint i;
GArray *fixtures = league_cup_get_fixtures(clid);
@ -1024,6 +1128,10 @@ Fixture*
fixture_get(gint type, gint clid, gint week_number,
gint week_round_number, const Team *tm)
{
#ifdef DEBUG
printf("fixture_get\n");
#endif
Fixture *fix = NULL;
gint new_clid = -1;
@ -1064,6 +1172,10 @@ fixture_get(gint type, gint clid, gint week_number,
gint
fixture_compare_func(gconstpointer a, gconstpointer b, gpointer data)
{
#ifdef DEBUG
printf("fixture_compare_func\n");
#endif
gint local_data = GPOINTER_TO_INT(data);
const Fixture *fix1 = (local_data >= 100) ?
(const Fixture*)a : *(const Fixture**)a,
@ -1092,6 +1204,10 @@ fixture_compare_func(gconstpointer a, gconstpointer b, gpointer data)
GPtrArray*
fixture_get_latest(const Team *tm)
{
#ifdef DEBUG
printf("fixture_get_latest\n");
#endif
gint i, j;
GPtrArray *latest = g_ptr_array_new();
@ -1126,6 +1242,10 @@ fixture_get_latest(const Team *tm)
GPtrArray*
fixture_get_coming(const Team *tm)
{
#ifdef DEBUG
printf("fixture_get_coming\n");
#endif
gint i, j;
GPtrArray *coming = g_ptr_array_new();
@ -1160,6 +1280,10 @@ fixture_get_coming(const Team *tm)
GPtrArray*
fixture_get_matches(const Team *tm1, const Team *tm2)
{
#ifdef DEBUG
printf("fixture_get_matches\n");
#endif
gint i, j;
GPtrArray *matches = g_ptr_array_new();
@ -1195,6 +1319,10 @@ fixture_get_matches(const Team *tm1, const Team *tm2)
Fixture*
fixture_from_id(gint id, gboolean abort_program)
{
#ifdef DEBUG
printf("fixture_from_id\n");
#endif
gint i, j;
for(i=0;i<ligs->len;i++)
@ -1218,6 +1346,10 @@ fixture_from_id(gint id, gboolean abort_program)
gint
fixture_get_last_week_round(gint week_number)
{
#ifdef DEBUG
printf("fixture_get_last_week_round\n");
#endif
gint i, j;
gint week_round_number = 1;
@ -1235,6 +1367,10 @@ fixture_get_last_week_round(gint week_number)
void
fixture_get_next_week(gint *week_number, gint *week_round_number)
{
#ifdef DEBUG
printf("fixture_get_next_week\n");
#endif
gint i;
gint local_week = *week_number,
local_round = *week_round_number;
@ -1282,6 +1418,10 @@ fixture_get_next_week(gint *week_number, gint *week_round_number)
void
fixture_get_previous_week(gint *week_number, gint *week_round_number)
{
#ifdef DEBUG
printf("fixture_get_previous_week\n");
#endif
gint i;
gint local_week = *week_number,
local_round = *week_round_number;
@ -1331,6 +1471,10 @@ fixture_get_previous_week(gint *week_number, gint *week_round_number)
GPtrArray*
fixture_get_season_results(void)
{
#ifdef DEBUG
printf("fixture_get_season_results\n");
#endif
gint i, j;
GPtrArray *results = g_ptr_array_new();
GArray *fixtures = NULL;
@ -1365,6 +1509,10 @@ fixture_get_season_results(void)
gint
fixture_get_goals_to_win(const Fixture *fix, const Team *tm)
{
#ifdef DEBUG
printf("fixture_get_goals_to_win\n");
#endif
const Fixture *first_leg = NULL;
gint idx = (tm == fix->teams[1]), return_value = -100;
gint res[2] = {math_sum_int_array(fix->result[0], 2),
@ -1431,6 +1579,10 @@ fixture_get_goals_to_win(const Fixture *fix, const Team *tm)
gint
fixture_count_matchdays(const GArray *fixtures)
{
#ifdef DEBUG
printf("fixture_count_matchdays\n");
#endif
gint i;
gint count = 0;
@ -1450,6 +1602,10 @@ fixture_count_matchdays(const GArray *fixtures)
gint
fixture_get_last_scheduled_week(void)
{
#ifdef DEBUG
printf("fixture_get_last_scheduled_week\n");
#endif
gint i;
gint week_nr = 0;
@ -1467,6 +1623,10 @@ fixture_get_last_scheduled_week(void)
void
fixture_remove_rrs(GArray *fixtures, gint clid1, gint clid2, gint to_remove)
{
#ifdef DEBUG
printf("fixture_remove_rrs\n");
#endif
gint i, j, k;
gint removed;
gint start;
@ -1501,6 +1661,10 @@ fixture_remove_rrs(GArray *fixtures, gint clid1, gint clid2, gint to_remove)
void
fixtures_condense(GArray *fixtures)
{
#ifdef DEBUG
printf("fixtures_condense\n");
#endif
gint i, j, k, l;
GArray *matchday_teams[1000][5];
Fixture *fix;

View File

@ -38,6 +38,10 @@
void
free_memory(void)
{
#ifdef DEBUG
printf("free_memory\n");
#endif
free_variables();
free_names(FALSE);
free_transfer_list();
@ -55,6 +59,10 @@ free_memory(void)
void
free_transfer_list(void)
{
#ifdef DEBUG
printf("free_transfer_list\n");
#endif
gint i;
for(i=0;i<transfer_list->len;i++)
@ -67,6 +75,10 @@ free_transfer_list(void)
void
free_season_stats(gboolean reset)
{
#ifdef DEBUG
printf("free_season_stats\n");
#endif
gint i, j;
if(season_stats == NULL)
@ -121,6 +133,10 @@ free_season_stats(gboolean reset)
void
free_users(gboolean reset)
{
#ifdef DEBUG
printf("free_users\n");
#endif
gint i;
if(users == NULL)
@ -144,6 +160,10 @@ free_users(gboolean reset)
void
free_user(User *user)
{
#ifdef DEBUG
printf("free_user\n");
#endif
gint i, j;
free_gchar_ptr(user->name);
@ -180,6 +200,10 @@ free_user(User *user)
void
free_mmatches(GArray **mmatches, gboolean reset)
{
#ifdef DEBUG
printf("free_mmatches\n");
#endif
gint i;
if(*mmatches == NULL)
@ -205,6 +229,10 @@ free_mmatches(GArray **mmatches, gboolean reset)
void
free_event(Event *event)
{
#ifdef DEBUG
printf("free_event\n");
#endif
free_gchar_ptr(event->value_string);
}
@ -215,6 +243,10 @@ free_event(Event *event)
void
free_option_list(OptionList *optionlist, gboolean reset)
{
#ifdef DEBUG
printf("free_option_list\n");
#endif
gint i;
if(optionlist->list == NULL)
@ -247,6 +279,10 @@ free_option_list(OptionList *optionlist, gboolean reset)
void
free_live_game(LiveGame *match)
{
#ifdef DEBUG
printf("free_live_game\n");
#endif
gint i, j, k;
if(match->units == NULL || match->started_game == -1)
@ -278,6 +314,10 @@ free_live_game(LiveGame *match)
void
free_country(Country *cntry, gboolean reset)
{
#ifdef DEBUG
printf("free_country\n");
#endif
free_gchar_ptr(cntry->name);
free_gchar_ptr(cntry->symbol);
free_gchar_ptr(cntry->sid);
@ -300,6 +340,10 @@ free_country(Country *cntry, gboolean reset)
void
free_leagues_array(GArray **leagues, gboolean reset)
{
#ifdef DEBUG
printf("free_leagues_array\n");
#endif
gint i;
if(*leagues == NULL)
@ -325,6 +369,10 @@ free_leagues_array(GArray **leagues, gboolean reset)
void
free_league(League *league)
{
#ifdef DEBUG
printf("free_league\n");
#endif
free_gchar_ptr(league->name);
free_gchar_ptr(league->short_name);
free_gchar_ptr(league->symbol);
@ -355,6 +403,10 @@ free_league(League *league)
void
free_joined_leagues(GArray **joined_leagues)
{
#ifdef DEBUG
printf("free_joined_leagues\n");
#endif
gint i;
for(i = 0; i < (*joined_leagues)->len; i++)
@ -367,6 +419,10 @@ free_joined_leagues(GArray **joined_leagues)
void
free_league_stats(LeagueStat *stats)
{
#ifdef DEBUG
printf("free_league_stats\n");
#endif
gint i;
free_gchar_ptr(stats->league_name);
@ -400,6 +456,10 @@ free_league_stats(LeagueStat *stats)
void
free_tables(GArray **tables)
{
#ifdef DEBUG
printf("free_tables\n");
#endif
gint i;
for(i = 0; i < (*tables)->len; i++)
@ -416,6 +476,10 @@ free_tables(GArray **tables)
void
free_new_tables(GArray **new_tables)
{
#ifdef DEBUG
printf("free_new_tables\n");
#endif
gint i;
for(i = 0; i < (*new_tables)->len; i++)
@ -430,6 +494,10 @@ free_new_tables(GArray **new_tables)
void
free_teams_array(GArray **teams, gboolean reset)
{
#ifdef DEBUG
printf("free_teams_array\n");
#endif
gint i;
if(*teams == NULL)
@ -455,6 +523,10 @@ free_teams_array(GArray **teams, gboolean reset)
void
free_team(Team *tm)
{
#ifdef DEBUG
printf("free_team\n");
#endif
free_gchar_ptr(tm->stadium.name);
free_gchar_ptr(tm->name);
free_gchar_ptr(tm->names_file);
@ -468,6 +540,10 @@ free_team(Team *tm)
void
free_player_array(GArray **players)
{
#ifdef DEBUG
printf("free_player_array\n");
#endif
gint i;
if(*players != NULL)
@ -484,6 +560,10 @@ free_player_array(GArray **players)
void
free_player(Player *pl)
{
#ifdef DEBUG
printf("free_player\n");
#endif
free_gchar_ptr(pl->name);
free_g_array(&pl->cards);
@ -497,6 +577,10 @@ free_player(Player *pl)
void
free_cups_array(GArray **cups, gboolean reset)
{
#ifdef DEBUG
printf("free_cups_array\n");
#endif
gint i;
if(*cups == NULL)
@ -522,6 +606,10 @@ free_cups_array(GArray **cups, gboolean reset)
void
free_cup(Cup *cup)
{
#ifdef DEBUG
printf("free_cup\n");
#endif
gint i, j;
free_gchar_ptr(cup->name);
@ -564,6 +652,10 @@ free_cup(Cup *cup)
void
free_cup_choose_team(CupChooseTeam *cup_choose_team)
{
#ifdef DEBUG
printf("free_cup_choose_team\n");
#endif
free_gchar_ptr(cup_choose_team->sid);
}
@ -571,6 +663,10 @@ free_cup_choose_team(CupChooseTeam *cup_choose_team)
void
free_variables(void)
{
#ifdef DEBUG
printf("free_variables\n");
#endif
free_option_list(&options, FALSE);
free_option_list(&settings, FALSE);
free_option_list(&constants, FALSE);
@ -588,6 +684,10 @@ free_variables(void)
void
free_lg_commentary(gboolean reset)
{
#ifdef DEBUG
printf("free_lg_commentary\n");
#endif
gint i, j;
for(i=0;i<LIVE_GAME_EVENT_END;i++)
@ -614,6 +714,14 @@ free_lg_commentary(gboolean reset)
void
free_gchar_array(GPtrArray **array)
{
#ifdef DEBUG
printf("_array\n");
#endif
#ifdef DEBUG
printf("free_gchar_array\n");
#endif
gint i;
if(*array == NULL)
@ -631,6 +739,10 @@ free_gchar_array(GPtrArray **array)
void
free_g_string(GString **string)
{
#ifdef DEBUG
printf("free_g_string\n");
#endif
if(*string == NULL)
return;
@ -644,6 +756,10 @@ free_g_string(GString **string)
void
free_g_array(GArray **array)
{
#ifdef DEBUG
printf("free_g_array\n");
#endif
if(*array == NULL)
return;
@ -657,6 +773,10 @@ free_g_array(GArray **array)
void
free_g_ptr_array(GPtrArray **array)
{
#ifdef DEBUG
printf("free_g_ptr_array\n");
#endif
if(*array == NULL)
return;
@ -669,6 +789,10 @@ free_g_ptr_array(GPtrArray **array)
void
free_support_dirs(void)
{
#ifdef DEBUG
printf("free_support_dirs\n");
#endif
GList *elem = support_directories;
if(elem == NULL)
@ -688,6 +812,10 @@ free_support_dirs(void)
void
free_name_list(NameList *namelist, gboolean reset)
{
#ifdef DEBUG
printf("free_name_list\n");
#endif
gint i;
if(namelist->sid == NULL)
@ -724,6 +852,10 @@ free_name_list(NameList *namelist, gboolean reset)
void
free_names(gboolean reset)
{
#ifdef DEBUG
printf("free_names\n");
#endif
gint i;
if(name_lists == NULL)
@ -747,6 +879,10 @@ free_names(gboolean reset)
void
free_strategies(void)
{
#ifdef DEBUG
printf("free_strategies\n");
#endif
gint i, j;
for(i=0;i<strategies->len;i++)
@ -788,6 +924,10 @@ free_strategies(void)
void
free_bets(gboolean reset)
{
#ifdef DEBUG
printf("free_bets\n");
#endif
free_g_array(&(bets[0]));
free_g_array(&(bets[1]));
@ -804,6 +944,10 @@ free_bets(gboolean reset)
void
free_job(Job *job, gboolean free_tm)
{
#ifdef DEBUG
printf("free_job\n");
#endif
gint i;
if(job->type == JOB_TYPE_INTERNATIONAL)
@ -826,6 +970,10 @@ free_job(Job *job, gboolean free_tm)
void
free_jobs(gboolean reset)
{
#ifdef DEBUG
printf("free_jobs\n");
#endif
gint i;
if(jobs == NULL)

View File

@ -52,6 +52,10 @@ void
game_get_values(const Fixture *fix, gfloat team_values[][GAME_TEAM_VALUE_END],
gfloat home_advantage)
{
#ifdef DEBUG
printf("game_get_values\n");
#endif
gint i, j;
Team *tm[2] = {fix->teams[0], fix->teams[1]};
gfloat style_factor;
@ -100,6 +104,7 @@ game_get_values(const Fixture *fix, gfloat team_values[][GAME_TEAM_VALUE_END],
gfloat
game_get_player_contribution(const Player *pl, gint type, gboolean special)
{
/** How the cskill of field players get weighted for the team values in
a match. Rows are player position, columns value type.
@see game_get_player_contribution() */
@ -132,6 +137,10 @@ game_get_player(const Team *tm, gint player_type,
gint last_penalty, gint not_this_one,
gboolean skills)
{
#ifdef DEBUG
printf("game_get_player\n");
#endif
gint i, player = not_this_one;
gfloat weights[3];
gfloat probs[10];
@ -206,6 +215,10 @@ game_get_player(const Team *tm, gint player_type,
void
game_get_player_probs(GArray *players, gfloat *probs, gfloat *weights, gboolean skills)
{
#ifdef DEBUG
printf("game_get_player_probs\n");
#endif
gint i;
probs[0] = (skills) ?
@ -239,6 +252,10 @@ game_get_player_probs(GArray *players, gfloat *probs, gfloat *weights, gboolean
gint
game_get_penalty_taker(const Team *tm, gint last_penalty)
{
#ifdef DEBUG
printf("game_get_penalty_taker\n");
#endif
gint i, return_value = -1;
GPtrArray *players = g_ptr_array_new();
@ -271,6 +288,10 @@ game_get_penalty_taker(const Team *tm, gint last_penalty)
void
game_initialize(Fixture *fix)
{
#ifdef DEBUG
printf("game_initialize\n");
#endif
gint i, j;
gint user_idx[2] = {team_is_user(fix->teams[0]), team_is_user(fix->teams[1])};
@ -328,6 +349,10 @@ game_initialize(Fixture *fix)
void
game_assign_attendance(Fixture *fix)
{
#ifdef DEBUG
printf("game_assign_attendance\n");
#endif
Team *tm[2] = {fix->teams[0], fix->teams[1]};
gfloat factor =
math_rnd(const_float("float_game_stadium_attendance_percentage_lower"),
@ -375,6 +400,10 @@ game_assign_attendance(Fixture *fix)
void
game_assign_attendance_neutral(Fixture *fix)
{
#ifdef DEBUG
printf("game_assign_attendance_neutral\n");
#endif
const GPtrArray *teamsp =
(GPtrArray*)league_cup_get_teams(fix->clid);
gfloat av_att = (fix->clid >= ID_CUP_START &&
@ -392,6 +421,10 @@ game_assign_attendance_neutral(Fixture *fix)
void
game_save_team_states(void)
{
#ifdef DEBUG
printf("game_save_team_states\n");
#endif
gint i, j;
const Team *teams[2] = {usr(stat2).live_game.fix->teams[0],
usr(stat2).live_game.fix->teams[1]};
@ -417,6 +450,10 @@ game_save_team_states(void)
gboolean
game_check_live_game_resume_state(void)
{
#ifdef DEBUG
printf("game_check_live_game_resume_state\n");
#endif
gint i, j;
gint subs[2] = {0, 0};
const Team *teams[2] = {usr(stat2).live_game.fix->teams[0],
@ -446,6 +483,10 @@ game_check_live_game_resume_state(void)
void
game_reset_players(gint idx)
{
#ifdef DEBUG
printf("game_reset_players\n");
#endif
gint i;
Team *tm = usr(stat2).live_game.fix->teams[idx];
GArray *players = g_array_new(FALSE, FALSE, sizeof(Player));
@ -474,6 +515,10 @@ game_reset_players(gint idx)
void
game_get_subs(gint team_number, gint *subs_in, gint *subs_out)
{
#ifdef DEBUG
printf("game_get_subs\n");
#endif
gint i, cnt = 0;
const Team *tm = usr(stat2).live_game.fix->teams[team_number];
gint current_players[11];
@ -508,6 +553,10 @@ game_get_subs(gint team_number, gint *subs_in, gint *subs_out)
void
game_player_injury(Player *pl)
{
#ifdef DEBUG
printf("game_player_injury\n");
#endif
gint i;
gfloat rndom;
/* probabilities of different injuries */
@ -608,6 +657,10 @@ game_player_injury(Player *pl)
gfloat
game_get_foul_possession_factor(gint boost1, gint boost2)
{
#ifdef DEBUG
printf("game_get_foul_possession_factor\n");
#endif
if(boost1 == boost2)
return 1;
@ -625,6 +678,10 @@ game_get_foul_possession_factor(gint boost1, gint boost2)
gint
game_substitute_player(Team *tm, gint player_number)
{
#ifdef DEBUG
printf("game_substitute_player\n");
#endif
gint i, substitute = -1;
GPtrArray *substitutes = g_ptr_array_new();
gboolean adapt_structure;
@ -686,6 +743,10 @@ game_substitute_player(Team *tm, gint player_number)
gint
game_find_to_substitute(gint clid, const Team *tm)
{
#ifdef DEBUG
printf("game_find_to_substitute\n");
#endif
gint i;
gint position_to_substitute = -1;
GPtrArray *players = g_ptr_array_new();
@ -726,6 +787,10 @@ game_find_to_substitute(gint clid, const Team *tm)
gint
game_player_get_ban_duration(void)
{
#ifdef DEBUG
printf("game_player_get_ban_duration\n");
#endif
gint i;
gfloat rndom;
gfloat duration_probs[6] =
@ -759,6 +824,10 @@ void
game_substitute_player_send_off(gint clid, Team *tm, gint player_number,
gint *to_substitute, gint *substitute)
{
#ifdef DEBUG
printf("game_substitute_player_send_off\n");
#endif
gint i;
gint position = -1;
GPtrArray *substitutes = NULL;
@ -816,6 +885,10 @@ game_substitute_player_send_off(gint clid, Team *tm, gint player_number,
void
game_decrease_fitness(const Fixture *fix)
{
#ifdef DEBUG
printf("game_decrease_fitness\n");
#endif
gint i, j;
for(i=0;i<2;i++)
@ -833,6 +906,10 @@ game_decrease_fitness(const Fixture *fix)
void
game_update_stats(LiveGame *lg, const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("game_update_stats\n");
#endif
gint i;
LiveGameStats *stats = &lg->stats;
@ -891,6 +968,10 @@ game_update_stats(LiveGame *lg, const LiveGameUnit *unit)
void
game_update_stats_player(LiveGame *lg, const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("game_update_stats_player\n");
#endif
gint i;
gchar buf[SMALL], buf2[SMALL];
LiveGameStats *stats = &lg->stats;
@ -969,6 +1050,10 @@ game_update_stats_player(LiveGame *lg, const LiveGameUnit *unit)
void
game_post_match(Fixture *fix)
{
#ifdef DEBUG
printf("game_post_match\n");
#endif
gint i;
GPtrArray *teams = NULL;
Cup *cup = NULL;
@ -1039,6 +1124,10 @@ game_post_match(Fixture *fix)
void
game_stadium_event(Stadium *stadium, gint type)
{
#ifdef DEBUG
printf("game_stadium_event\n");
#endif
gfloat reduce;
gfloat reduce_factor[3][2] =
{{const_float("float_game_stadium_safety_reduce_breakdown_lower"),
@ -1062,6 +1151,10 @@ game_stadium_event(Stadium *stadium, gint type)
void
game_get_max_values(gfloat max_values[4])
{
#ifdef DEBUG
printf("game_get_max_values\n");
#endif
gint i, j;
Player pl;
@ -1088,6 +1181,10 @@ game_get_max_values(gfloat max_values[4])
gint
game_get_default_penalty_shooter(const Team *tm)
{
#ifdef DEBUG
printf("game_get_default_penalty_shooter\n");
#endif
gint return_value = -1;
if(team_is_user(tm) != -1 &&
@ -1112,6 +1209,10 @@ game_get_default_penalty_shooter(const Team *tm)
void
game_boost_cost(void)
{
#ifdef DEBUG
printf("game_boost_cost\n");
#endif
gfloat wage_unit = finance_wage_unit(usr(stat2).tm);
gint deduce =
(gint)rint(wage_unit * const_float("float_boost_cost_factor"));

View File

@ -45,6 +45,10 @@
void
game_gui_live_game_show_unit(const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("game_gui_live_game_show_unit\n");
#endif
gchar buf[SMALL];
gfloat sleep_factor = (unit->time == 3) ?
const_float("float_game_gui_live_game_speed_penalties_factor") : 1;
@ -119,6 +123,10 @@ game_gui_live_game_show_unit(const LiveGameUnit *unit)
void
game_gui_live_game_set_hscale(const LiveGameUnit *unit, GtkHScale *hscale)
{
#ifdef DEBUG
printf("game_gui_live_game_set_hscale\n");
#endif
GdkColor color;
gtk_widget_modify_bg(GTK_WIDGET(hscale), GTK_STATE_NORMAL, NULL);
@ -184,6 +192,10 @@ game_gui_live_game_set_hscale(const LiveGameUnit *unit, GtkHScale *hscale)
void
game_gui_live_game_show_opponent(void)
{
#ifdef DEBUG
printf("game_gui_live_game_show_opponent\n");
#endif
GtkImage *image_style =
GTK_IMAGE(lookup_widget(window.live, "image_lg_opp_style")),
*image_boost =
@ -216,6 +228,10 @@ game_gui_get_radio_items(GtkWidget **style, GtkWidget **scout,
GtkWidget **physio, GtkWidget **boost,
GtkWidget **yc, GtkWidget **ya_pos_pref)
{
#ifdef DEBUG
printf("game_gui_get_radio_items\n");
#endif
style[0] = lookup_widget(window.main, "menu_all_out_defend");
style[1] = lookup_widget(window.main, "menu_defend");
style[2] = lookup_widget(window.main, "menu_balanced");
@ -252,6 +268,10 @@ game_gui_get_radio_items(GtkWidget **style, GtkWidget **scout,
void
game_gui_set_main_window_header(void)
{
#ifdef DEBUG
printf("game_gui_set_main_window_header\n");
#endif
gint i, rank;
gchar buf[SMALL];
GtkLabel *label_user= GTK_LABEL(lookup_widget(window.main, "label_user")),
@ -311,6 +331,10 @@ game_gui_set_main_window_header(void)
void
game_gui_write_av_skills(const Team *tm)
{
#ifdef DEBUG
printf("game_gui_write_av_skills\n");
#endif
gchar buf[SMALL];
GtkLabel *label_av_skills= GTK_LABEL(lookup_widget(window.main, "label_av_skills"));
const Team *tm_local = (tm == NULL) ? current_user.tm : tm;
@ -326,6 +350,10 @@ game_gui_write_av_skills(const Team *tm)
void
game_gui_write_meter_images(const Team *tm, GtkImage *style, GtkImage *boost)
{
#ifdef DEBUG
printf("game_gui_write_meter_images\n");
#endif
gint i;
gchar *image_style_files[5] =
@ -353,6 +381,10 @@ game_gui_write_meter_images(const Team *tm, GtkImage *style, GtkImage *boost)
void
game_gui_write_meters(const Team *tm)
{
#ifdef DEBUG
printf("game_gui_write_meters\n");
#endif
GtkImage *image_style_main = GTK_IMAGE(lookup_widget(window.main, "image_style")),
*image_boost_main = GTK_IMAGE(lookup_widget(window.main, "image_boost"));
GtkImage *image_style_live = NULL,
@ -374,6 +406,10 @@ game_gui_write_meters(const Team *tm)
void
game_gui_write_radio_items(void)
{
#ifdef DEBUG
printf("game_gui_write_radio_items\n");
#endif
GtkWidget *style[5], *scout[4], *physio[4],
*boost[3], *yc[4], *ya_pos_pref[5];
@ -399,6 +435,10 @@ game_gui_write_radio_items(void)
void
game_gui_read_radio_items(GtkWidget *widget)
{
#ifdef DEBUG
printf("game_gui_read_radio_items\n");
#endif
gint i;
GtkWidget *boost[3], *yc[4], *ya_pos_pref[5];
GtkWidget *style[5], *scout[4], *physio[4];
@ -476,6 +516,10 @@ game_gui_read_radio_items(GtkWidget *widget)
void
game_gui_show_main(void)
{
#ifdef DEBUG
printf("game_gui_show_main\n");
#endif
game_gui_set_main_window_header();
treeview_show_user_player_list();
@ -503,6 +547,10 @@ game_gui_show_main(void)
void
game_gui_print_message(gchar *format, ...)
{
#ifdef DEBUG
printf("game_gui_print_message\n");
#endif
gchar text[SMALL];
va_list args;
@ -523,6 +571,10 @@ game_gui_print_message(gchar *format, ...)
gboolean
game_gui_print_message_source(gpointer data)
{
#ifdef DEBUG
printf("game_gui_print_message_source\n");
#endif
game_gui_print_message((gchar*)data);
g_free(data);
@ -534,6 +586,10 @@ game_gui_print_message_source(gpointer data)
void
game_gui_print_message_with_delay(const gchar *format, ...)
{
#ifdef DEBUG
printf("game_gui_print_message_with_delay\n");
#endif
gchar text[SMALL];
va_list args;
@ -553,6 +609,10 @@ game_gui_print_message_with_delay(const gchar *format, ...)
gboolean
game_gui_clear_entry_message(gpointer data)
{
#ifdef DEBUG
printf("game_gui_clear_entry_message\n");
#endif
if(window.main != NULL)
gtk_entry_set_text(GTK_ENTRY(lookup_widget(window.main, "entry_message")), "");
@ -598,6 +658,10 @@ enum MainWindowShowItems
void
game_gui_set_main_window_sensitivity(gboolean value)
{
#ifdef DEBUG
printf("game_gui_set_main_window_sensitivity\n");
#endif
gint i;
GtkWidget *insensitive_items[INSENSITIVE_ITEM_END];
GtkWidget *show_items[SHOW_ITEM_END];
@ -664,6 +728,10 @@ game_gui_set_main_window_sensitivity(gboolean value)
void
game_gui_show_warning(const gchar *format, ...)
{
#ifdef DEBUG
printf("game_gui_show_warning\n");
#endif
gchar text[SMALL];
va_list args;
@ -690,6 +758,10 @@ game_gui_show_warning(const gchar *format, ...)
void
game_gui_show_job_offer(Team *team, Job *job, gint type)
{
#ifdef DEBUG
printf("game_gui_show_job_offer\n");
#endif
gchar buf[SMALL], buf2[SMALL];
GtkLabel *label_text, *label_text2, *label_name,
*label_league, *label_rank, *label_money,
@ -778,6 +850,10 @@ game_gui_show_job_offer(Team *team, Job *job, gint type)
void
game_gui_write_check_items(void)
{
#ifdef DEBUG
printf("game_gui_write_check_items\n");
#endif
GtkCheckMenuItem *menu_job_offers =
GTK_CHECK_MENU_ITEM(lookup_widget(window.main, "menu_job_offers")),
*menu_live_game =
@ -797,6 +873,10 @@ game_gui_write_check_items(void)
void
game_gui_read_check_items(GtkWidget *widget)
{
#ifdef DEBUG
printf("game_gui_read_check_items\n");
#endif
GtkWidget *menu_job_offers =
lookup_widget(window.main, "menu_job_offers"),
*menu_live_game = lookup_widget(window.main, "menu_live_game"),
@ -838,6 +918,10 @@ game_gui_read_check_items(GtkWidget *widget)
void
game_gui_set_help_labels(void)
{
#ifdef DEBUG
printf("game_gui_set_help_labels\n");
#endif
GtkLabel *label_help_text1 =
GTK_LABEL(lookup_widget(window.help, "label_help_text1")),
*label_help_text2 = GTK_LABEL(lookup_widget(window.help, "label_help_text2"));
@ -859,6 +943,10 @@ game_gui_set_help_labels(void)
void
game_gui_write_money(void)
{
#ifdef DEBUG
printf("game_gui_write_money\n");
#endif
gchar buf[SMALL];
GtkLabel *label_money= GTK_LABEL(lookup_widget(window.main, "label_money"));

View File

@ -37,6 +37,10 @@
void
gui_label_set_text_from_int(GtkLabel *label, gint number, gboolean append)
{
#ifdef DEBUG
printf("gui_label_set_text_from_int\n");
#endif
const gchar *current_text = gtk_label_get_text(label);
gchar buf[SMALL], buf2[SMALL];
@ -64,6 +68,10 @@ gui_label_set_text_from_int(GtkLabel *label, gint number, gboolean append)
void
gui_show_progress(gfloat value, const gchar *text, gint pictype)
{
#ifdef DEBUG
printf("gui_show_progress\n");
#endif
GtkProgressBar *progressbar = NULL;
if(value == 1 || value < 0)
@ -95,6 +103,10 @@ gui_show_progress(gfloat value, const gchar *text, gint pictype)
void
gui_set_arrow_pair(gint pair, gboolean state)
{
#ifdef DEBUG
printf("gui_set_arrow_pair\n");
#endif
gint i, j;
GtkWidget *buttons[2][2] =
{{lookup_widget(window.main ,"button_cl_back"),
@ -117,6 +129,10 @@ gui_set_arrow_pair(gint pair, gboolean state)
void
gui_set_arrows(void)
{
#ifdef DEBUG
printf("gui_set_arrows\n");
#endif
gui_set_arrow_pair(3, FALSE);
if(stat0 == STATUS_SHOW_FIXTURES ||
@ -137,6 +153,10 @@ gui_set_arrows(void)
void
gui_set_sensitive_lg_meters(gboolean state)
{
#ifdef DEBUG
printf("gui_set_sensitive_lg_meters\n");
#endif
gtk_widget_set_sensitive(lookup_widget(window.live, "image_lg_style"), state);
gtk_widget_set_sensitive(lookup_widget(window.live, "eventbox_lg_style"), state);
gtk_widget_set_sensitive(lookup_widget(window.live, "image_lg_boost"), state);

View File

@ -1,7 +1,6 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -44,6 +44,10 @@
void
job_update(void)
{
#ifdef DEBUG
printf("job_update\n");
#endif
gint i;
gint new_offers, int_offers;
@ -74,6 +78,10 @@ job_update(void)
void
job_add_new_international(gint num_of_new)
{
#ifdef DEBUG
printf("job_add_new_international\n");
#endif
gint i, k, rndom, idx;
GPtrArray *country_files = file_get_country_files();
Country countries[num_of_new];
@ -152,6 +160,10 @@ gint
job_country_is_in_list(const gchar *country_file,
const Country *countries, gint len)
{
#ifdef DEBUG
printf("job_country_is_in_list\n");
#endif
gint i;
for(i=0;i<len;i++)
@ -169,6 +181,10 @@ job_country_is_in_list(const gchar *country_file,
void
job_add_new_national(void)
{
#ifdef DEBUG
printf("job_add_new_national\n");
#endif
Job new_job;
League *league = NULL;
Team *tm = NULL;
@ -195,6 +211,10 @@ job_add_new_national(void)
void
job_pick_team_from_country(const Country *cntry, Team **tm, League **league)
{
#ifdef DEBUG
printf("job_pick_team_from_country\n");
#endif
gint i, rndom;
gint team_lens[cntry->leagues->len];
@ -232,6 +252,10 @@ job_pick_team_from_country(const Country *cntry, Team **tm, League **league)
gint
job_team_is_on_list(gint team_id)
{
#ifdef DEBUG
printf("job_team_is_on_list\n");
#endif
gint i;
for(i=0;i<jobs->len;i++)
@ -247,6 +271,10 @@ job_team_is_on_list(gint team_id)
gint
job_team_is_in_cup(const gchar *team_name)
{
#ifdef DEBUG
printf("job_team_is_in_cup\n");
#endif
gint i, j;
for(i=0;i<acps->len;i++)
@ -262,6 +290,10 @@ job_team_is_in_cup(const gchar *team_name)
Team*
job_get_team(const Job *job)
{
#ifdef DEBUG
printf("job_get_team\n");
#endif
gint i, j;
if(job->type == JOB_TYPE_NATIONAL)
@ -293,6 +325,10 @@ job_get_team(const Job *job)
gboolean
query_job_application_successful(const Job *job, const User *user)
{
#ifdef DEBUG
printf("query_job_application_successful\n");
#endif
gfloat success_needed;
const Team *tm = job_get_team(job);
gfloat user_av_skill = team_get_average_skill(user->tm, FALSE),
@ -324,6 +360,10 @@ query_job_application_successful(const Job *job, const User *user)
void
job_remove(Job *job, gboolean free_tm)
{
#ifdef DEBUG
printf("job_remove\n");
#endif
gint i;
for(i=0;i<jobs->len;i++)
@ -340,6 +380,10 @@ job_remove(Job *job, gboolean free_tm)
void
job_change_country(Job *job)
{
#ifdef DEBUG
printf("job_change_country\n");
#endif
gint i, j, k;
Team tm = *(job_get_team(job));
gint season_temp = season + 1;

View File

@ -42,6 +42,10 @@ extern int _nl_msg_cat_cntr=0;
void
language_set(gint index)
{
#ifdef DEBUG
printf("language_set\n");
#endif
gchar buf[SMALL], buf2[SMALL];
gchar *pwd = g_get_current_dir();
GPtrArray *codes =
@ -56,7 +60,6 @@ language_set(gint index)
window.main == NULL)
{
sprintf(buf2, "%s%slocale", pwd, G_DIR_SEPARATOR_S);
#ifdef ENABLE_NLS
if(g_file_test(buf2, G_FILE_TEST_EXISTS))
{
@ -92,6 +95,10 @@ language_set(gint index)
gint
language_get_code_index(const gchar *code)
{
#ifdef DEBUG
printf("language_get_code_index\n");
#endif
gint i, return_value = -1;
GPtrArray *codes =
misc_separate_strings(const_str("string_language_codes"));
@ -119,6 +126,10 @@ language_get_code_index(const gchar *code)
gint
language_compare_country_files(gconstpointer a, gconstpointer b, gpointer data)
{
#ifdef DEBUG
printf("language_compare_country_files\n");
#endif
gint i, j;
const gchar *prefdef = (const gchar*)data;
const gchar *def1 = *(const gchar**)a;
@ -169,6 +180,10 @@ language_compare_country_files(gconstpointer a, gconstpointer b, gpointer data)
void
language_pick_country(GPtrArray *country_files)
{
#ifdef DEBUG
printf("language_pick_country\n");
#endif
gint i, j;
GPtrArray *codes =
misc_separate_strings(const_str("string_language_codes"));
@ -213,8 +228,11 @@ language_pick_country(GPtrArray *country_files)
void
language_get_code(gchar *buf)
{
gchar *cur_locale = NULL;
#ifdef DEBUG
printf("language_get_code\n");
#endif
gchar *cur_locale = NULL;
#ifdef G_OS_UNIX
cur_locale = setlocale(LC_MESSAGES, NULL);
#else

View File

@ -45,6 +45,10 @@
League
league_new(gboolean new_id)
{
#ifdef DEBUG
printf("league_new\n");
#endif
League new;
new.name = NULL;
@ -92,6 +96,10 @@ league_new(gboolean new_id)
PromRelElement
prom_rel_element_new(void)
{
#ifdef DEBUG
printf("prom_rel_element_new\n");
#endif
PromRelElement new;
new.ranks[0] = new.ranks[1] =
@ -108,6 +116,10 @@ prom_rel_element_new(void)
gint
league_cup_get_index_from_clid(gint clid)
{
#ifdef DEBUG
printf("league_cup_get_index_from_clid\n");
#endif
gint i;
gint index = -1;
@ -142,6 +154,10 @@ league_cup_get_index_from_clid(gint clid)
League*
league_from_clid(gint clid)
{
#ifdef DEBUG
printf("league_from_clid\n");
#endif
gint i;
for(i=0;i<ligs->len;i++)
@ -162,6 +178,10 @@ league_from_clid(gint clid)
gint
league_cup_get_next_clid(gint clid, gboolean count_inactive)
{
#ifdef DEBUG
printf("league_cup_get_next_clid\n");
#endif
gint i, return_value = -1;
if(clid < ID_CUP_START)
@ -214,6 +234,10 @@ league_cup_get_next_clid(gint clid, gboolean count_inactive)
gint
league_cup_get_previous_clid(gint clid, gboolean count_inactive)
{
#ifdef DEBUG
printf("league_cup_get_previous_clid\n");
#endif
gint i, return_value = -1;
if(clid < ID_CUP_START)
@ -265,6 +289,10 @@ league_cup_get_previous_clid(gint clid, gboolean count_inactive)
Fixture*
league_cup_get_next_fixture(gint clid, gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("league_cup_get_next_fixture\n");
#endif
gint i;
GArray *fixtures = league_cup_get_fixtures(clid);
@ -283,6 +311,10 @@ league_cup_get_next_fixture(gint clid, gint week_number, gint week_round_number)
Fixture*
league_cup_get_previous_fixture(gint clid, gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("league_cup_get_previous_fixture\n");
#endif
gint i;
GArray *fixtures = league_cup_get_fixtures(clid);
@ -301,6 +333,10 @@ league_cup_get_previous_fixture(gint clid, gint week_number, gint week_round_num
gint
league_cup_average_capacity(gint clid)
{
#ifdef DEBUG
printf("league_cup_average_capacity\n");
#endif
gint i, cnt = 0;
gfloat sum = 0;
const GArray *teams = NULL;
@ -334,6 +370,10 @@ league_cup_average_capacity(gint clid)
gint
league_index_from_sid(const gchar *sid)
{
#ifdef DEBUG
printf("league_index_from_sid\n");
#endif
gint i;
for(i=0;i<ligs->len;i++)
@ -351,6 +391,10 @@ league_index_from_sid(const gchar *sid)
void
league_remove_team_with_id(League *league, gint id)
{
#ifdef DEBUG
printf("league_remove_team_with_id\n");
#endif
gint i;
for(i=0;i<league->teams->len;i++)
@ -371,6 +415,10 @@ league_remove_team_with_id(League *league, gint id)
void
league_season_start(League *league)
{
#ifdef DEBUG
printf("league_season_start\n");
#endif
gint i, j;
gint idx = league_index_from_sid(league->sid);
gboolean user_champ =
@ -459,6 +507,10 @@ league_season_start(League *league)
gboolean
query_league_rank_in_prom_games(const League *league, gint rank)
{
#ifdef DEBUG
printf("query_league_rank_in_prom_games\n");
#endif
gint i, j, k;
const Cup *cup = NULL;
const CupRound *cup_round = NULL;
@ -500,6 +552,10 @@ query_league_rank_in_prom_games(const League *league, gint rank)
gboolean
query_league_matches_in_week(const League *league, gint week_number)
{
#ifdef DEBUG
printf("query_league_matches_in_week\n");
#endif
gint i;
for(i=0;i<league->fixtures->len;i++)
@ -514,6 +570,10 @@ query_league_matches_in_week(const League *league, gint week_number)
void
league_get_team_movements_prom_rel(const League *league, GArray *team_movements)
{
#ifdef DEBUG
printf("league_get_team_movements_prom_rel\n");
#endif
gint i, j, k;
TeamMove new_move;
const GArray *elements = league->prom_rel.elements;
@ -560,6 +620,10 @@ void
league_get_team_movements_prom_games(const League *league, GArray *team_movements,
const GPtrArray *prom_games_teams, gboolean up)
{
#ifdef DEBUG
printf("league_get_team_movements_prom_games\n");
#endif
gint i, j;
TeamMove new_move;
GPtrArray *dest_sids = (up) ?
@ -606,6 +670,10 @@ league_get_team_movements_prom_games(const League *league, GArray *team_movement
void
league_get_team_movements(League *league, GArray *team_movements)
{
#ifdef DEBUG
printf("league_get_team_movements\n");
#endif
GPtrArray *prom_games_teams = NULL;
const Cup *prom_cup = NULL;
@ -641,6 +709,10 @@ league_get_team_movements(League *league, GArray *team_movements)
gboolean
query_league_team_movements_unassigned(const GArray *team_movements)
{
#ifdef DEBUG
printf("query_league_team_movements_unassigned\n");
#endif
gint i;
for(i=0;i<team_movements->len;i++)
@ -655,6 +727,10 @@ query_league_team_movements_unassigned(const GArray *team_movements)
gboolean
query_league_team_movements_unassigned_single(const GArray *team_movements)
{
#ifdef DEBUG
printf("query_league_team_movements_unassigned_single\n");
#endif
gint i;
for(i=0;i<team_movements->len;i++)
@ -670,6 +746,10 @@ void
league_team_movements_print(const GArray *team_movements,
const gint *league_size, const gint *league_cur_size)
{
#ifdef DEBUG
printf("league_team_movements_print\n");
#endif
gint i, j;
const TeamMove *tmove = NULL;
@ -701,6 +781,10 @@ gint
league_team_movements_compare_dest_idcs(gconstpointer a, gconstpointer b,
gpointer data)
{
#ifdef DEBUG
printf("league_team_movements_compare_dest_idcs\n");
#endif
gint league_idx1 = *(gint*)a,
league_idx2 = *(gint*)b;
const gint *league_cur_size = (const gint*)data;
@ -720,6 +804,10 @@ void
league_team_movements_assign_dest(GArray *team_movements, gint idx,
const gint *league_size, gint *league_cur_size)
{
#ifdef DEBUG
printf("league_team_movements_assign_dest\n");
#endif
gint i, j, dest_idx;
TeamMove *tmove = &g_array_index(team_movements, TeamMove, idx);
@ -792,6 +880,10 @@ void
league_team_movements_prune(GArray *team_movements, const gint *league_size,
gint *league_cur_size)
{
#ifdef DEBUG
printf("league_team_movements_prune\n");
#endif
gint i;
if(debug > 60)
@ -814,6 +906,10 @@ league_team_movements_prune(GArray *team_movements, const gint *league_size,
void
league_team_movements_destinations(GArray *team_movements, const gint *league_size)
{
#ifdef DEBUG
printf("league_team_movements_destinations\n");
#endif
gint i;
gint league_cur_size[ligs->len];
@ -843,6 +939,10 @@ league_team_movements_destinations(GArray *team_movements, const gint *league_si
gboolean
query_leagues_active_in_country(void)
{
#ifdef DEBUG
printf("query_leagues_active_in_country\n");
#endif
gint i;
for(i=0;i<ligs->len;i++)
@ -857,6 +957,10 @@ query_leagues_active_in_country(void)
gboolean
query_league_cup_matchday_in_two_match_week(GArray **two_match_weeks, gint matchday)
{
#ifdef DEBUG
printf("query_league_cup_matchday_in_two_match_week\n");
#endif
gint i;
for(i=0;i<two_match_weeks[0]->len;i++)
@ -875,6 +979,10 @@ query_league_cup_matchday_in_two_match_week(GArray **two_match_weeks, gint match
void
league_check_new_tables(League *league)
{
#ifdef DEBUG
printf("league_check_new_tables\n");
#endif
gint i;
Table new_table;
@ -898,6 +1006,10 @@ league_check_new_tables(League *league)
void
league_add_table(League *league)
{
#ifdef DEBUG
printf("league_add_table\n");
#endif
gint i;
Table new_table;
TableElement new_table_element;

View File

@ -14,6 +14,10 @@ on_window_league_table_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_league_table_delete_event\n");
#endif
return FALSE;
}
@ -23,6 +27,10 @@ void
on_lt_b_ok_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_lt_b_ok_clicked\n");
#endif
}

View File

@ -1,7 +1,6 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -56,6 +56,10 @@ void
lg_commentary_generate(const LiveGame *live_game, LiveGameUnit *unit,
const gchar *event_name, gint ev_type)
{
#ifdef DEBUG
printf("lg_commentary_generate\n");
#endif
gint i, event_type = -1;
gint commentary_idx = -1;
gchar buf[SMALL];
@ -123,6 +127,10 @@ lg_commentary_generate(const LiveGame *live_game, LiveGameUnit *unit,
gint
lg_commentary_select(const GArray *commentaries, gchar *buf)
{
#ifdef DEBUG
printf("lg_commentary_select\n");
#endif
gint i, order[commentaries->len];
lg_commentary_get_order(commentaries, order);
@ -155,6 +163,10 @@ lg_commentary_select(const GArray *commentaries, gchar *buf)
gboolean
lg_commentary_check_commentary(const LGCommentary *commentary, gchar *dest)
{
#ifdef DEBUG
printf("lg_commentary_check_commentary\n");
#endif
gchar buf[SMALL];
if(strlen(commentary->text) == 0 ||
@ -181,6 +193,10 @@ lg_commentary_check_commentary(const LGCommentary *commentary, gchar *dest)
gboolean
query_lg_commentary_is_repetition(gint id)
{
#ifdef DEBUG
printf("query_lg_commentary_is_repetition\n");
#endif
const GArray *units = ((LiveGame*)statp)->units;
gint units_min = units->len - const_int("int_lg_commentary_check_backwards") - 1;
gint i, min = MAX(units_min, 0);
@ -199,6 +215,10 @@ query_lg_commentary_is_repetition(gint id)
void
lg_commentary_get_order(const GArray *commentaries, gint *order)
{
#ifdef DEBUG
printf("lg_commentary_get_order\n");
#endif
gint i, j, order_idx = 0;
gint priority_sum = 0, bounds[commentaries->len + 1];
@ -238,6 +258,10 @@ lg_commentary_get_order(const GArray *commentaries, gint *order)
void
lg_commentary_set_stats_tokens(const LiveGameStats *stats)
{
#ifdef DEBUG
printf("lg_commentary_set_stats_tokens\n");
#endif
misc_token_add(token_rep,
option_int("string_token_stat_shots0", &tokens),
misc_int_to_char(stats->values[0][LIVE_GAME_STAT_VALUE_SHOTS]));
@ -299,6 +323,10 @@ lg_commentary_set_stats_tokens(const LiveGameStats *stats)
void
lg_commentary_set_basic_tokens(const LiveGameUnit *unit, const Fixture *fix)
{
#ifdef DEBUG
printf("lg_commentary_set_basic_tokens\n");
#endif
gchar buf[SMALL];
gint tmp_int = 1, current_min = live_game_unit_get_minute(unit);
gint avskill0 = (gint)rint(team_get_average_skill(fix->teams[0], TRUE)),
@ -368,6 +396,10 @@ lg_commentary_set_basic_tokens(const LiveGameUnit *unit, const Fixture *fix)
void
lg_commentary_set_team_tokens(const LiveGameUnit *unit, const Fixture *fix)
{
#ifdef DEBUG
printf("lg_commentary_set_team_tokens\n");
#endif
if(unit->result[0] != unit->result[1])
{
misc_token_add(token_rep,
@ -394,6 +426,10 @@ lg_commentary_set_team_tokens(const LiveGameUnit *unit, const Fixture *fix)
void
lg_commentary_set_player_tokens(const LiveGameUnit *unit, const Fixture *fix)
{
#ifdef DEBUG
printf("lg_commentary_set_player_tokens\n");
#endif
Player *pl1 = NULL,
*pl2 = NULL;
@ -482,6 +518,14 @@ lg_commentary_set_player_tokens(const LiveGameUnit *unit, const Fixture *fix)
gchar*
lg_commentary_get_extra_data(const LiveGameUnit *unit, const Fixture *fix)
{
#ifdef DEBUG
printf("lg_commentary_get_extra_data\n");
#endif
#ifdef DEBUG
printf("lg_commentary_get_extra_data\n");
#endif
gchar buf[SMALL];
switch(unit->event.type)
@ -527,6 +571,10 @@ lg_commentary_get_extra_data(const LiveGameUnit *unit, const Fixture *fix)
void
lg_commentary_initialize(const Fixture *fix)
{
#ifdef DEBUG
printf("lg_commentary_initialize\n");
#endif
gchar buf[SMALL];
token_rep[0] = g_ptr_array_new();
@ -581,6 +629,10 @@ lg_commentary_initialize(const Fixture *fix)
void
lg_commentary_free_tokens(void)
{
#ifdef DEBUG
printf("lg_commentary_free_tokens\n");
#endif
gint i;
for(i=token_rep[0]->len - 1;i >= 0; i--)
@ -598,6 +650,10 @@ lg_commentary_free_tokens(void)
void
lg_commentary_load_commentary_file_from_option(void)
{
#ifdef DEBUG
printf("lg_commentary_load_commentary_file_from_option\n");
#endif
gchar buf[SMALL], commentary_file[SMALL];
language_get_code(buf);
@ -612,6 +668,10 @@ lg_commentary_load_commentary_file_from_option(void)
void
lg_commentary_load_commentary_file(const gchar *commentary_file, gboolean abort)
{
#ifdef DEBUG
printf("lg_commentary_load_commentary_file\n");
#endif
gchar *file_name = NULL;
if(g_file_test(commentary_file, G_FILE_TEST_EXISTS))
@ -642,6 +702,10 @@ lg_commentary_load_commentary_file(const gchar *commentary_file, gboolean abort)
void
lg_commentary_test_load_token_file(const gchar *token_file)
{
#ifdef DEBUG
printf("lg_commentary_test_load_token_file\n");
#endif
gchar token_name[SMALL], token_value[SMALL];
FILE *fil = NULL;
@ -666,6 +730,10 @@ void
lg_commentary_test(const gchar *commentary_file, const gchar* token_file,
const gchar *event_name, gint number_of_passes)
{
#ifdef DEBUG
printf("lg_commentary_test\n");
#endif
gint i, j;
LiveGame dummy;

View File

@ -66,6 +66,10 @@ gboolean show;
void
live_game_calculate_fixture(Fixture *fix)
{
#ifdef DEBUG
printf("live_game_calculate_fixture\n");
#endif
if(stat0 != STATUS_LIVE_GAME_PAUSE &&
stat0 != STATUS_LIVE_GAME_CHANGE)
live_game_initialize(fix);
@ -103,6 +107,10 @@ live_game_calculate_fixture(Fixture *fix)
void
live_game_initialize(Fixture *fix)
{
#ifdef DEBUG
printf("live_game_initialize\n");
#endif
stat2 = fixture_user_team_involved(fix);
statp= (stat2 != -1) ?
@ -140,6 +148,10 @@ live_game_initialize(Fixture *fix)
void
live_game_create_unit(void)
{
#ifdef DEBUG
printf("live_game_create_unit\n");
#endif
LiveGameUnit new;
if((debug > 100 && stat2 != -1) ||
@ -194,6 +206,10 @@ live_game_create_unit(void)
void
live_game_fill_new_unit(LiveGameUnit *new)
{
#ifdef DEBUG
printf("live_game_fill_new_unit\n");
#endif
LiveGameUnit *old = &last_unit;
gfloat rndom = math_rnd(0, 1);
gfloat stadium_event =
@ -260,6 +276,10 @@ live_game_fill_new_unit(LiveGameUnit *new)
void
live_game_create_start_unit(void)
{
#ifdef DEBUG
printf("live_game_create_start_unit\n");
#endif
LiveGameUnit new;
if((debug > 100 && stat2 != -1) ||
@ -289,6 +309,10 @@ live_game_create_start_unit(void)
void
live_game_evaluate_unit(LiveGameUnit *unit)
{
#ifdef DEBUG
printf("live_game_evaluate_unit\n");
#endif
gint type = unit->event.type;
if((debug > 100 && stat2 != -1) ||
@ -329,6 +353,10 @@ live_game_evaluate_unit(LiveGameUnit *unit)
void
live_game_event_foul(void)
{
#ifdef DEBUG
printf("live_game_event_foul\n");
#endif
gfloat rndom = math_rnd(0, 1);
gint type, fouled_player, foul_player, foul_team;
@ -411,6 +439,10 @@ live_game_event_foul(void)
void
live_game_event_lost_possession(void)
{
#ifdef DEBUG
printf("live_game_event_lost_possession\n");
#endif
if((debug > 100 && stat2 != -1) ||
debug > 130)
g_print("\t\tlive_game_event_lost_possession\n");
@ -440,6 +472,10 @@ live_game_event_lost_possession(void)
void
live_game_event_injury(gint team, gint player, gboolean create_new)
{
#ifdef DEBUG
printf("live_game_event_injury\n");
#endif
LiveGameUnit new;
gint old_structure = -1, sub_in = -1;
gint usr_idx = -1;
@ -530,6 +566,10 @@ live_game_event_injury(gint team, gint player, gboolean create_new)
void
live_game_event_stadium(void)
{
#ifdef DEBUG
printf("live_game_event_stadium\n");
#endif
gint i;
gfloat rndom = math_rnd(0, 1);
gfloat probs[3] =
@ -564,6 +604,10 @@ live_game_event_stadium(void)
void
live_game_event_scoring_chance(void)
{
#ifdef DEBUG
printf("live_game_event_scoring_chance\n");
#endif
gint res_idx = -1;
if(last_unit.time == LIVE_GAME_UNIT_TIME_EXTRA_TIME)
@ -640,6 +684,10 @@ live_game_event_scoring_chance(void)
void
live_game_event_penalty(void)
{
#ifdef DEBUG
printf("live_game_event_penalty\n");
#endif
LiveGameUnit new;
if((debug > 100 && stat2 != -1) ||
@ -706,6 +754,10 @@ live_game_event_penalty(void)
void
live_game_event_general(gboolean create_new)
{
#ifdef DEBUG
printf("live_game_event_general\n");
#endif
LiveGameUnit new;
if((debug > 100 && stat2 != -1) ||
@ -801,6 +853,10 @@ live_game_event_general(gboolean create_new)
void
live_game_event_general_get_players(void)
{
#ifdef DEBUG
printf("live_game_event_general_get_players\n");
#endif
gint *pl1 = &last_unit.event.player;
gint *pl2 = &last_unit.event.player2;
gint old_pl1 =
@ -839,6 +895,10 @@ live_game_event_general_get_players(void)
void
live_game_event_free_kick(void)
{
#ifdef DEBUG
printf("live_game_event_free_kick\n");
#endif
LiveGameUnit new = last_unit;
if((debug > 100 && stat2 != -1) ||
@ -872,6 +932,10 @@ live_game_event_free_kick(void)
void
live_game_event_send_off(gint team, gint player, gboolean second_yellow)
{
#ifdef DEBUG
printf("live_game_event_send_off\n");
#endif
LiveGameUnit new = last_unit;
gint substitute = -1, to_substitute = -1;
gint usr_idx = team_is_user(tms[team]);
@ -965,6 +1029,10 @@ live_game_event_send_off(gint team, gint player, gboolean second_yellow)
void
live_game_event_substitution(gint team_number, gint sub_in, gint sub_out)
{
#ifdef DEBUG
printf("live_game_event_substitution\n");
#endif
LiveGameUnit new = last_unit;
new.minute = -1;
@ -1008,6 +1076,10 @@ live_game_event_substitution(gint team_number, gint sub_in, gint sub_out)
void
live_game_event_team_change(gint team_number, gint event_type)
{
#ifdef DEBUG
printf("live_game_event_team_change\n");
#endif
LiveGameUnit new = last_unit;
new.minute = -1;
@ -1031,6 +1103,10 @@ live_game_event_team_change(gint team_number, gint event_type)
void
live_game_event_duel(void)
{
#ifdef DEBUG
printf("live_game_event_duel\n");
#endif
gfloat rndom = math_rnd(0, 1);
gfloat scoring_prob;
gfloat duel_factor;
@ -1136,6 +1212,10 @@ live_game_event_duel(void)
gboolean
query_live_game_second_yellow(gint team, gint player)
{
#ifdef DEBUG
printf("query_live_game_second_yellow\n");
#endif
gint i;
for(i=0;i<unis->len - 1;i++)
@ -1156,6 +1236,10 @@ query_live_game_second_yellow(gint team, gint player)
gboolean
query_live_game_event_is_break(gint minute, gint time)
{
#ifdef DEBUG
printf("query_live_game_event_is_break\n");
#endif
gfloat rndom;
if(time == LIVE_GAME_UNIT_TIME_EXTRA_TIME)
@ -1185,6 +1269,10 @@ query_live_game_event_is_break(gint minute, gint time)
gboolean
query_live_game_penalties_over(void)
{
#ifdef DEBUG
printf("query_live_game_penalties_over\n");
#endif
gint i;
gint pen_attempted[2] = {0, 0};
@ -1212,6 +1300,10 @@ query_live_game_penalties_over(void)
gint
live_game_get_break(void)
{
#ifdef DEBUG
printf("live_game_get_break\n");
#endif
gint type;
if(last_unit.time == LIVE_GAME_UNIT_TIME_FIRST_HALF)
@ -1243,6 +1335,10 @@ live_game_get_break(void)
gint
live_game_get_time(const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("live_game_get_time\n");
#endif
gint time;
if(unit->event.type == LIVE_GAME_EVENT_HALF_TIME)
@ -1262,6 +1358,10 @@ live_game_get_time(const LiveGameUnit *unit)
gint
live_game_get_minute(void)
{
#ifdef DEBUG
printf("live_game_get_minute\n");
#endif
gint i;
if(last_unit.event.type == LIVE_GAME_EVENT_HALF_TIME)
@ -1283,6 +1383,10 @@ live_game_get_minute(void)
gint
live_game_get_minutes_remaining(const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("live_game_get_minutes_remaining\n");
#endif
gint current_min = live_game_unit_get_minute(unit);
gint return_value = -1;
@ -1303,6 +1407,10 @@ live_game_get_minutes_remaining(const LiveGameUnit *unit)
gint
live_game_unit_get_minute(const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("live_game_unit_get_minute\n");
#endif
gint i, j;
for(i=unis->len - 1; i >= 0; i--)
@ -1326,6 +1434,10 @@ live_game_unit_get_minute(const LiveGameUnit *unit)
LiveGameUnit*
live_game_unit_before(const LiveGameUnit* unit, gint gap)
{
#ifdef DEBUG
printf("live_game_unit_before\n");
#endif
gint i;
if(gap > 0)
@ -1363,6 +1475,10 @@ live_game_unit_before(const LiveGameUnit* unit, gint gap)
gint
live_game_get_area(const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("live_game_get_area\n");
#endif
gint new_area = unit->area;
gfloat rndom = math_rnd(0, 1);
gfloat probs[4] =
@ -1398,6 +1514,10 @@ live_game_get_area(const LiveGameUnit *unit)
gfloat
live_game_pit_teams(const LiveGameUnit *unit, gfloat exponent)
{
#ifdef DEBUG
printf("live_game_pit_teams\n");
#endif
gfloat factor;
if(unit->area == LIVE_GAME_UNIT_AREA_DEFEND)
@ -1421,6 +1541,10 @@ live_game_pit_teams(const LiveGameUnit *unit, gfloat exponent)
void
live_game_finish_unit(void)
{
#ifdef DEBUG
printf("live_game_finish_unit\n");
#endif
LiveGameUnit *unit = &last_unit;
if((debug > 100 && stat2 != -1) ||
@ -1497,6 +1621,10 @@ live_game_finish_unit(void)
void
live_game_injury_get_player(void)
{
#ifdef DEBUG
printf("live_game_injury_get_player\n");
#endif
gint i, j;
gfloat probs[22];
gfloat rndom, fitness_factor;
@ -1545,6 +1673,10 @@ live_game_injury_get_player(void)
void
live_game_resume(void)
{
#ifdef DEBUG
printf("live_game_resume\n");
#endif
gint i, j;
gint subs_in[3],
subs_out[3];
@ -1583,6 +1715,10 @@ live_game_resume(void)
void
live_game_reset(LiveGame *live_game, Fixture *fix, gboolean free_variable)
{
#ifdef DEBUG
printf("live_game_reset\n");
#endif
gint i;
if(free_variable)
@ -1632,6 +1768,10 @@ live_game_reset(LiveGame *live_game, Fixture *fix, gboolean free_variable)
gint
live_game_event_get_verbosity(gint event_type)
{
#ifdef DEBUG
printf("live_game_event_get_verbosity\n");
#endif
gint return_value = -1;
if(event_type == LIVE_GAME_EVENT_START_MATCH ||
@ -1691,6 +1831,10 @@ live_game_event_get_verbosity(gint event_type)
void
live_game_unit_result_to_buf(const LiveGameUnit *unit, gchar *buf, gboolean swap)
{
#ifdef DEBUG
printf("live_game_unit_result_to_buf\n");
#endif
gint idx = (swap) ? 1 : 0;
if(unit->time == LIVE_GAME_UNIT_TIME_PENALTIES)
@ -1710,6 +1854,10 @@ live_game_unit_result_to_buf(const LiveGameUnit *unit, gchar *buf, gboolean swap
gint
live_game_penalties_taken(void)
{
#ifdef DEBUG
printf("live_game_penalties_taken\n");
#endif
gint i, penalties = 0;
for(i=unis->len - 1;i>=0;i--)

View File

@ -51,6 +51,10 @@
void
load_save_save_game(const gchar *filename)
{
#ifdef DEBUG
printf("load_save_save_game\n");
#endif
gchar buf[SMALL];
gchar *prefix = (g_str_has_suffix(filename, const_str("string_fs_save_suffix"))) ?
g_strndup(filename, strlen(filename) - strlen(const_str("string_fs_save_suffix"))) :
@ -176,6 +180,10 @@ load_save_save_game(const gchar *filename)
gboolean
load_save_load_game(const gchar* filename, gboolean create_main_window)
{
#ifdef DEBUG
printf("load_save_load_game\n");
#endif
GString *buf = g_string_new("");
gchar *fullname = (g_str_has_suffix(filename, const_str("string_fs_save_suffix"))) ?
g_strdup(filename) :
@ -340,6 +348,10 @@ load_save_load_game(const gchar* filename, gboolean create_main_window)
void
load_save_last_save_set(const gchar *filename)
{
#ifdef DEBUG
printf("load_save_last_save_set\n");
#endif
gchar buf[SMALL];
const gchar *home = g_get_home_dir();
FILE *fil = NULL;
@ -367,6 +379,14 @@ load_save_last_save_set(const gchar *filename)
gchar*
load_save_last_save_get(void)
{
#ifdef DEBUG
printf("load_save_last_save_get\n");
#endif
#ifdef DEBUG
printf("load_save_last_save_get\n");
#endif
gchar buf[SMALL];
const gchar *home = g_get_home_dir();
FILE *fil = NULL;
@ -399,6 +419,10 @@ load_save_last_save_get(void)
void
load_save_autosave(void)
{
#ifdef DEBUG
printf("load_save_autosave\n");
#endif
gchar buf[SMALL];
const gchar *home = g_get_home_dir();
FILE *fil = NULL;
@ -439,6 +463,10 @@ load_save_autosave(void)
gboolean
load_game_from_command_line(const gchar *filename)
{
#ifdef DEBUG
printf("load_game_from_command_line\n");
#endif
gchar *fullname = NULL,
*support_file_name = NULL;

View File

@ -62,6 +62,10 @@ gboolean load_last_save;
void
main_parse_cl_arguments(gint *argc, gchar ***argv)
{
#ifdef DEBUG
printf("main_parse_cl_arguments\n");
#endif
gboolean testcom = FALSE, calodds = FALSE;
gchar *support_dir = NULL, *lang = NULL,
*testcom_file = NULL, *token_file = NULL,
@ -171,6 +175,10 @@ main_parse_cl_arguments(gint *argc, gchar ***argv)
void
main_init_variables(void)
{
#ifdef DEBUG
printf("main_init_variables\n");
#endif
gint i;
ligs = g_array_new(FALSE, FALSE, sizeof(League));
@ -257,9 +265,12 @@ main_init_variables(void)
void
main_init(gint *argc, gchar ***argv)
{
#ifdef DEBUG
printf("main_init\n");
#endif
gchar buf[SMALL];
gchar *pwd = g_get_current_dir();
#ifdef G_OS_WIN32
os_is_unix = FALSE;
#else
@ -267,7 +278,6 @@ main_init(gint *argc, gchar ***argv)
#endif
support_directories = NULL;
#ifdef G_OS_UNIX
file_add_support_directory_recursive(PACKAGE_DATA_DIR "/" PACKAGE "/support_files");
sprintf(buf, "%s%s%s", g_get_home_dir(), G_DIR_SEPARATOR_S, HOMEDIRNAME);
@ -298,6 +308,9 @@ main_init(gint *argc, gchar ***argv)
gint
main (gint argc, gchar *argv[])
{
#ifdef DEBUG
printf("main\n");
#endif
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
@ -336,6 +349,10 @@ main (gint argc, gchar *argv[])
void
main_exit_program(gint exit_code, gchar *format, ...)
{
#ifdef DEBUG
printf("main_exit_program\n");
#endif
gchar text[SMALL];
va_list args;

View File

@ -35,6 +35,10 @@
gdouble
math_gaussrand(void)
{
#ifdef DEBUG
printf("math_gaussrand\n");
#endif
static gdouble V1, V2, S;
static gint phase = 0;
gdouble X;
@ -70,7 +74,12 @@ math_gaussrand(void)
*/
gdouble
math_gauss_dist(gdouble lower, gdouble upper)
{
{
#ifdef DEBUG
printf("math_gauss_dist\n");
#endif
gdouble result;
result = (upper - lower) / 6 * math_gaussrand()
@ -107,6 +116,10 @@ math_gauss_dist(gdouble lower, gdouble upper)
gint
math_get_place(gint value, gint place)
{
#ifdef DEBUG
printf("math_get_place\n");
#endif
if(place < 10)
return (value % (gint)powf(10, place) -
value % (gint)powf(10, place - 1)) /
@ -141,6 +154,10 @@ math_get_place(gint value, gint place)
gint
math_round_integer(gint number, gint places)
{
#ifdef DEBUG
printf("math_round_integer\n");
#endif
gint length = 0;
gfloat copy = (gfloat)number;
@ -166,6 +183,10 @@ math_round_integer(gint number, gint places)
void
math_generate_permutation(gint *array, gint start, gint end)
{
#ifdef DEBUG
printf("math_generate_permutation\n");
#endif
gint i;
for(i = start; i < end + 1; i++)
@ -180,6 +201,10 @@ math_generate_permutation(gint *array, gint start, gint end)
gint
math_get_bye_len(gint number)
{
#ifdef DEBUG
printf("math_get_bye_len\n");
#endif
gint i;
for(i=0;i<20;i++)
@ -196,6 +221,10 @@ math_get_bye_len(gint number)
gint
math_sum_int_array(const gint *array, gint max)
{
#ifdef DEBUG
printf("math_sum_int_array\n");
#endif
gint i, sum = 0;
for(i=0;i<max;i++)

View File

@ -41,6 +41,10 @@
void
misc_print_error(GError **error, gboolean abort_program)
{
#ifdef DEBUG
printf("misc_print_error\n");
#endif
if(*error == NULL)
return;
@ -58,6 +62,10 @@ misc_print_error(GError **error, gboolean abort_program)
void
misc_swap_int(gint *first, gint *second)
{
#ifdef DEBUG
printf("misc_swap_int\n");
#endif
gint swap = *first;
*first = *second;
@ -70,6 +78,14 @@ misc_swap_int(gint *first, gint *second)
void
misc_swap_gpointer(gpointer *first, gpointer *second)
{
#ifdef DEBUG
printf("\n");
#endif
#ifdef DEBUG
printf("misc_swap_gpointer\n");
#endif
gpointer swap = *first;
*first = *second;
@ -122,6 +138,10 @@ misc_separate_strings(gchar *string)
GPtrArray*
misc_randomise_g_pointer_array(GPtrArray *array)
{
#ifdef DEBUG
printf("misc_randomise_g_pointer_array\n");
#endif
GPtrArray *new = g_ptr_array_new();
gint order[array->len];
gint i;
@ -140,6 +160,10 @@ misc_randomise_g_pointer_array(GPtrArray *array)
GPtrArray*
misc_copy_ptr_array(const GPtrArray *array)
{
#ifdef DEBUG
printf("misc_copy_ptr_array\n");
#endif
gint i;
GPtrArray *copy = NULL;
@ -161,6 +185,10 @@ misc_copy_ptr_array(const GPtrArray *array)
void
misc_print_grouped_int(gint number, gchar *buf)
{
#ifdef DEBUG
printf("misc_print_grouped_int\n");
#endif
gint i;
gchar buf2[SMALL];
gint length = 0;
@ -208,6 +236,10 @@ misc_print_grouped_int(gint number, gchar *buf)
gboolean
query_integer_is_in_array(gint item, gint *array, gint max)
{
#ifdef DEBUG
printf("query_integer_is_in_array\n");
#endif
gint i;
for(i=0;i<max;i++)
@ -221,6 +253,10 @@ query_integer_is_in_array(gint item, gint *array, gint max)
gboolean
query_misc_integer_is_in_g_array(gint item, GArray *array)
{
#ifdef DEBUG
printf("query_misc_integer_is_in_g_array\n");
#endif
gint i;
for(i=0;i<array->len;i++)
@ -234,6 +270,10 @@ query_misc_integer_is_in_g_array(gint item, GArray *array)
gint
misc_int_compare(gint first, gint second)
{
#ifdef DEBUG
printf("misc_int_compare\n");
#endif
if(first > second)
return -1;
else if(first < second)
@ -246,6 +286,10 @@ misc_int_compare(gint first, gint second)
gint
misc_float_compare(gfloat first, gfloat second)
{
#ifdef DEBUG
printf("misc_float_compare\n");
#endif
if(first > second)
return -1;
else if(first < second)
@ -272,6 +316,10 @@ query_misc_string_in_array(const gchar *string, GPtrArray *array)
gfloat
misc_get_age_from_birth(gint birth_year, gint birth_month)
{
#ifdef DEBUG
printf("misc_get_age_from_birth\n");
#endif
GDate *current_date = g_date_new();
GDate *birth_date = g_date_new();
@ -434,6 +482,10 @@ misc_parse(const gchar *s, gint *result)
void
misc_string_assign(gchar **string, const gchar *contents)
{
#ifdef DEBUG
printf("misc_string_assign\n");
#endif
if(contents == NULL)
return;
@ -653,6 +705,7 @@ void
misc_token_add(GPtrArray **token_rep, gint token_idx,
gchar *replacement)
{
g_ptr_array_add(token_rep[0],
(gpointer)g_strdup(g_array_index(tokens.list, Option, token_idx).string_value));
g_ptr_array_add(token_rep[1], (gpointer)replacement);
@ -661,7 +714,7 @@ misc_token_add(GPtrArray **token_rep, gint token_idx,
/** Remove the replacement rule given by the index. */
void
misc_token_remove(GPtrArray **token_rep, gint idx)
{
{
gint i;
for(i=token_rep[0]->len - 1; i >= 0; i--)

View File

@ -49,6 +49,10 @@
void
misc2_callback_transfer_user_player(void)
{
#ifdef DEBUG
printf("misc2_callback_transfer_user_player\n");
#endif
Team *new_team = transoff(stat2, 0).tm;
if (current_user.tm->players->len - 1 < const_int("int_team_min_players"))
@ -113,6 +117,10 @@ misc2_callback_transfer_user_player(void)
void
misc2_callback_transfer_cpu_player(void)
{
#ifdef DEBUG
printf("misc2_callback_transfer_cpu_player\n");
#endif
if(current_user.tm->players->len > const_int("int_team_max_players") ||
BUDGET(cur_user) < transoff(stat2, 0).fee)
{
@ -146,6 +154,10 @@ misc2_callback_transfer_cpu_player(void)
gboolean
misc2_callback_change_structure(gint structure)
{
#ifdef DEBUG
printf("misc2_callback_change_structure\n");
#endif
gint poss_struct = team_find_appropriate_structure(current_user.tm);
if(math_get_place(structure, 1) + math_get_place(structure, 2) +
@ -169,6 +181,10 @@ misc2_callback_change_structure(gint structure)
void
misc2_callback_contract_offer(void)
{
#ifdef DEBUG
printf("misc2_callback_contract_offer\n");
#endif
gint i;
gchar buf[SMALL];
GtkSpinButton *spinbutton;
@ -222,6 +238,10 @@ misc2_callback_contract_offer(void)
void
misc2_callback_add_user(void)
{
#ifdef DEBUG
printf("misc2_callback_add_user\n");
#endif
GtkTreeView *treeview_user_management_teams =
GTK_TREE_VIEW(lookup_widget(window.user_management,
"treeview_user_management_teams"));
@ -264,7 +284,12 @@ misc2_callback_add_user(void)
@param col_num The column number. */
void
misc2_callback_mmatches_button_press(GtkWidget *widget, gint row_num, gint col_num)
{
{
#ifdef DEBUG
printf("misc2_callback_mmatches_button_press\n");
#endif
if(row_num < current_user.mmatches->len)
{
if(col_num == TREEVIEW_MMATCH_COL_REPLAY)
@ -313,6 +338,10 @@ misc2_callback_mmatches_button_press(GtkWidget *widget, gint row_num, gint col_n
gboolean
misc2_callback_evaluate_job_application(Job *job, User *user)
{
#ifdef DEBUG
printf("misc2_callback_evaluate_job_application\n");
#endif
if(!query_job_application_successful(job, user))
{
game_gui_show_warning(

View File

@ -51,6 +51,10 @@ void
on_button_offer_ok_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_offer_ok_clicked\n");
#endif
gboolean changed = TRUE;
gchar *team_name = g_strdup(current_user.tm->name);
@ -86,6 +90,10 @@ void
on_button_offer_cancel_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_offer_cancel_clicked\n");
#endif
if(stat2 != STATUS_JOB_OFFER_SUCCESS &&
stat2 != STATUS_JOB_EXCHANGE_SHOW_TEAM)
{
@ -113,6 +121,10 @@ on_button_warning_clicked (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_warning_clicked\n");
#endif
window_destroy(&window.warning);
if(stat4 == STATUS_SHOW_EVENT)
@ -126,6 +138,10 @@ void
on_button_digits_ok_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_digits_ok_clicked\n");
#endif
GtkSpinButton *spinbutton1 = GTK_SPIN_BUTTON(lookup_widget(window.digits, "spinbutton1")),
*spinbutton2 = GTK_SPIN_BUTTON(lookup_widget(window.digits, "spinbutton2"));
gint values[2] =
@ -178,6 +194,10 @@ void
on_button_digits_alr_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_digits_alr_clicked\n");
#endif
on_button_digits_ok_clicked(NULL, NULL);
on_automatic_loan_repayment_activate(NULL, NULL);
}
@ -186,6 +206,10 @@ void
on_button_digits_cancel_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_digits_cancel_clicked\n");
#endif
window_destroy(&window.digits);
}
@ -194,6 +218,10 @@ on_window_yesno_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_yesno_delete_event\n");
#endif
on_button_yesno_no_clicked(NULL, NULL);
if(stat4 == STATUS_SHOW_EVENT)
@ -205,7 +233,12 @@ on_window_yesno_delete_event (GtkWidget *widget,
void
on_button_yesno_yes_clicked (GtkButton *button,
gpointer user_data)
{
{
#ifdef DEBUG
printf("on_button_yesno_yes_clicked\n");
#endif
window_destroy(&window.yesno);
setsav0;
@ -262,6 +295,10 @@ void
on_button_yesno_no_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_yesno_no_clicked\n");
#endif
window_destroy(&window.yesno);
if(stat4 == STATUS_SHOW_EVENT)
@ -273,6 +310,10 @@ void
on_button_contract_offer_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_contract_offer_clicked\n");
#endif
misc2_callback_contract_offer();
}
@ -280,6 +321,10 @@ void
on_button_contract_cancel_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_contract_cancel_clicked\n");
#endif
window_destroy(&window.contract);
}
@ -289,6 +334,10 @@ on_window_contract_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_contract_delete_event\n");
#endif
if(GTK_WIDGET_IS_SENSITIVE(lookup_widget(window.contract, "button_contract_cancel")))
window_destroy(&window.contract);
@ -301,6 +350,10 @@ void
on_entry_user_management_activate (GtkEntry *entry,
gpointer user_data)
{
#ifdef DEBUG
printf("on_entry_user_management_activate\n");
#endif
on_button_user_management_add_clicked(NULL, NULL);
}
@ -309,6 +362,10 @@ void
on_button_user_management_add_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_user_management_add_clicked\n");
#endif
misc2_callback_add_user();
}
@ -318,6 +375,10 @@ on_button_user_management_close_clicked
(GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_user_management_close_clicked\n");
#endif
window_destroy(&window.user_management);
on_button_back_to_main_clicked(NULL, NULL);
}
@ -329,6 +390,10 @@ on_treeview_user_management_users_button_press_event
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_treeview_user_management_users_button_press_event\n");
#endif
gchar buf[SMALL];
gint idx = -1;
@ -357,6 +422,10 @@ on_treeview_user_management_teams_row_activated
GtkTreeViewColumn *column,
gpointer user_data)
{
#ifdef DEBUG
printf("on_treeview_user_management_teams_row_activated\n");
#endif
on_button_user_management_add_clicked(NULL, NULL);
}
@ -365,6 +434,10 @@ on_window_debug_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_debug_delete_event\n");
#endif
on_button_debug_close_activate(NULL, NULL);
return FALSE;
@ -375,6 +448,10 @@ void
on_button_debug_apply_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_debug_apply_clicked\n");
#endif
GtkEntry *entry_debug =
GTK_ENTRY(lookup_widget(window.wdebug, "entry_debug"));
const gchar *entry_text = gtk_entry_get_text(entry_debug);
@ -389,6 +466,10 @@ void
on_button_debug_close_activate (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_debug_close_activate\n");
#endif
window_destroy(&window.wdebug);
}
@ -397,6 +478,10 @@ void
on_entry_debug_activate (GtkEntry *entry,
gpointer user_data)
{
#ifdef DEBUG
printf("on_entry_debug_activate\n");
#endif
on_button_debug_apply_clicked(NULL, NULL);
}
@ -406,6 +491,10 @@ on_window_job_offer_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_job_offer_delete_event\n");
#endif
on_button_offer_cancel_clicked(NULL, NULL);
return FALSE;
}
@ -416,6 +505,10 @@ on_window_digits_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_digits_delete_event\n");
#endif
on_button_digits_cancel_clicked(NULL, NULL);
return FALSE;
@ -427,6 +520,10 @@ on_window_user_management_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_user_management_delete_event\n");
#endif
on_button_user_management_close_clicked(NULL, NULL);
return FALSE;
}
@ -437,6 +534,10 @@ on_window_help_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_help_delete_event\n");
#endif
on_button_help_close_clicked(NULL, NULL);
return FALSE;
@ -447,6 +548,10 @@ void
on_button_help_close_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_help_close_clicked\n");
#endif
window_destroy(&window.help);
}
@ -454,6 +559,10 @@ void
on_spinbutton1_activate (GtkEntry *entry,
gpointer user_data)
{
#ifdef DEBUG
printf("on_spinbutton1_activate\n");
#endif
gtk_spin_button_update(GTK_SPIN_BUTTON(lookup_widget(window.digits, "spinbutton1")));
on_button_digits_ok_clicked(NULL, NULL);
}
@ -463,6 +572,10 @@ void
on_spinbutton2_activate (GtkEntry *entry,
gpointer user_data)
{
#ifdef DEBUG
printf("on_spinbutton2_activate\n");
#endif
gtk_spin_button_update(GTK_SPIN_BUTTON(lookup_widget(window.digits, "spinbutton2")));
on_button_digits_ok_clicked(NULL, NULL);
}
@ -473,6 +586,10 @@ on_window_transfer_dialog_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_transfer_dialog_delete_event\n");
#endif
on_button_transfer_later_clicked(NULL, NULL);
return FALSE;
}
@ -482,6 +599,10 @@ void
on_button_transfer_yes_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_transfer_yes_clicked\n");
#endif
if(stat1 == STATUS_TRANSFER_OFFER_USER)
misc2_callback_transfer_user_player();
else if(STATUS_TRANSFER_OFFER_CPU)
@ -495,6 +616,10 @@ void
on_button_transfer_no_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_transfer_no_clicked\n");
#endif
gint len = 1;
transoff(stat2, 0).status = TRANSFER_OFFER_REJECTED;
@ -519,6 +644,10 @@ void
on_button_transfer_later_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_transfer_later_clicked\n");
#endif
window_destroy(&window.transfer_dialog);
}
@ -527,6 +656,10 @@ on_window_mmatches_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_mmatches_delete_event\n");
#endif
on_button_mm_reload_close_clicked(NULL, NULL);
return TRUE;
@ -538,6 +671,10 @@ on_treeview_mmatches_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_treeview_mmatches_button_press_event\n");
#endif
GtkTreePath *path = NULL;
GtkTreeViewColumn *col = NULL;
gint col_num = -1, mmidx = -1;
@ -568,6 +705,10 @@ void
on_button_mm_save_close_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_mm_save_close_clicked\n");
#endif
const gchar *filename =
gtk_entry_get_text(GTK_ENTRY(lookup_widget(window.mmatches, "entry_mm_file")));
@ -583,6 +724,10 @@ void
on_button_mm_add_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_mm_add_clicked\n");
#endif
if(current_user.live_game.units->len == 0)
{
game_gui_show_warning(_("No match stored."));
@ -598,6 +743,10 @@ void
on_button_mm_file_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_mm_file_clicked\n");
#endif
stat5 = STATUS_SELECT_MM_FILE_LOAD;
window_show_file_sel();
}
@ -607,6 +756,10 @@ void
on_button_mm_reload_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_mm_reload_clicked\n");
#endif
GtkWidget *treeview = lookup_widget(window.mmatches, "treeview_mmatches");
const gchar *filename =
gtk_entry_get_text(GTK_ENTRY(lookup_widget(window.mmatches, "entry_mm_file")));
@ -621,6 +774,10 @@ void
on_button_mm_reload_close_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_mm_reload_close_clicked\n");
#endif
on_button_mm_reload_clicked(NULL, NULL);
on_button_mm_save_close_clicked(NULL, NULL);
}
@ -629,6 +786,10 @@ void
on_button_mm_import_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_mm_import_clicked\n");
#endif
stat5 = STATUS_SELECT_MM_FILE_IMPORT;
window_show_file_sel();
}

View File

@ -1,7 +1,6 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -46,6 +46,10 @@ on_window_bets_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_bets_delete_event\n");
#endif
on_button_bet_close_clicked(NULL, NULL);
return TRUE;
@ -55,6 +59,10 @@ void
on_button_bet_close_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_bet_close_clicked\n");
#endif
window_destroy(&window.bets);
}
@ -64,6 +72,10 @@ on_checkbutton_bet_all_leagues_button_press_event
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_checkbutton_bet_all_leagues_button_press_event\n");
#endif
opt_user_set_int("int_opt_user_bet_show_all_leagues",
!opt_user_int("int_opt_user_bet_show_all_leagues"));
@ -79,6 +91,10 @@ on_checkbutton_bet_cups_button_press_event
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_checkbutton_bet_cups_button_press_event\n");
#endif
opt_user_set_int("int_opt_user_bet_show_cups",
!opt_user_int("int_opt_user_bet_show_cups"));
@ -93,6 +109,10 @@ on_treeview_bets_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_treeview_bets_button_press_event\n");
#endif
GtkTreePath *path = NULL;
GtkTreeViewColumn *col = NULL;
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
@ -156,6 +176,10 @@ on_checkbutton_bet_user_recent_button_press_event
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_checkbutton_bet_user_recent_button_press_event\n");
#endif
opt_user_set_int("int_opt_user_bet_show_my_recent",
!opt_user_int("int_opt_user_bet_show_my_recent"));
@ -169,6 +193,10 @@ on_window_splash_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_splash_delete_event\n");
#endif
return FALSE;
}
@ -177,7 +205,12 @@ on_window_splash_delete_event (GtkWidget *widget,
void
on_button_splash_new_game_clicked (GtkButton *button,
gpointer user_data)
{
{
#ifdef DEBUG
printf("on_button_splash_new_game_clicked\n");
#endif
window_destroy(&window.splash);
window_show_startup();
@ -189,6 +222,10 @@ void
on_button_splash_load_game_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_splash_load_game_clicked\n");
#endif
stat5 = STATUS_LOAD_GAME_SPLASH;
window_show_file_sel();
}
@ -198,6 +235,10 @@ void
on_button_splash_resume_game_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_splash_resume_game_clicked\n");
#endif
misc_callback_startup_load("last_save");
}
@ -206,6 +247,10 @@ void
on_button_splash_quit_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_splash_quit_clicked\n");
#endif
window_destroy(&window.splash);
main_exit_program(EXIT_OK, NULL);
}
@ -215,6 +260,10 @@ void
on_button_splash_hint_back_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_splash_hint_back_clicked\n");
#endif
counters[COUNT_HINT_NUMBER] = (counters[COUNT_HINT_NUMBER] == 0) ?
hints.list->len - 1 : counters[COUNT_HINT_NUMBER] - 1;
@ -226,6 +275,10 @@ void
on_button_splash_hint_next_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_splash_hint_next_clicked\n");
#endif
counters[COUNT_HINT_NUMBER] =
(counters[COUNT_HINT_NUMBER] + 1) % hints.list->len;
@ -237,6 +290,10 @@ void
on_button_calculate_start_week_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_calculate_start_week_clicked\n");
#endif
gint start_week;
start_week = finance_calculate_alr_start_week(
@ -252,6 +309,10 @@ on_button_calculate_installment_clicked
(GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_calculate_installment_clicked\n");
#endif
gint weekly_installment;
weekly_installment = finance_calculate_alr_weekly_installment(
@ -266,6 +327,10 @@ void
on_button_alr_confirm_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_alr_confirm_clicked\n");
#endif
current_user.alr_start_week =
gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(lookup_widget(window.alr, "spinbutton_start_week")));
@ -284,6 +349,10 @@ void
on_button_alr_cancel_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_alr_cancel_clicked\n");
#endif
window_destroy(&window.alr);
}
@ -292,6 +361,10 @@ on_window_alr_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_alr_delete_event\n");
#endif
on_button_alr_cancel_clicked(NULL, NULL);
return TRUE;

View File

@ -1,7 +1,6 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -51,6 +51,10 @@
void
misc_callback_show_team_list(GtkWidget *widget, const gchar *country_file)
{
#ifdef DEBUG
printf("misc_callback_show_team_list\n");
#endif
GtkWidget *treeview_startup =
lookup_widget(widget, "treeview_startup");
@ -65,6 +69,10 @@ misc_callback_show_team_list(GtkWidget *widget, const gchar *country_file)
void
misc_callback_start_game(void)
{
#ifdef DEBUG
printf("misc_callback_start_game\n");
#endif
gint i;
GtkToggleButton *radio_load =
GTK_TOGGLE_BUTTON(lookup_widget(window.startup, "radiobutton_team_def_load"));
@ -120,6 +128,10 @@ misc_callback_start_game(void)
void
misc_callback_add_player(void)
{
#ifdef DEBUG
printf("misc_callback_add_player\n");
#endif
GtkTreeView *treeview_users =
GTK_TREE_VIEW(lookup_widget(window.startup, "treeview_users"));
GtkTreeView *treeview_startup =
@ -164,6 +176,10 @@ misc_callback_add_player(void)
void
misc_callback_remove_user(GdkEventButton *event)
{
#ifdef DEBUG
printf("misc_callback_remove_user\n");
#endif
GtkTreeView *treeview_users =
GTK_TREE_VIEW(lookup_widget(window.startup, "treeview_users"));
GtkTreeView *treeview_startup =
@ -188,6 +204,10 @@ misc_callback_remove_user(GdkEventButton *event)
void
misc_callback_pause_live_game(void)
{
#ifdef DEBUG
printf("misc_callback_pause_live_game\n");
#endif
GtkWidget *button_resume =
lookup_widget(window.live, "button_resume");
@ -221,6 +241,10 @@ misc_callback_pause_live_game(void)
void
misc_callback_update_stadium_window(gboolean capacity)
{
#ifdef DEBUG
printf("misc_callback_update_stadium_window\n");
#endif
GtkLabel *label_costs_capacity =
GTK_LABEL(lookup_widget(window.stadium, "label_costs_capacity")),
*label_costs_safety =
@ -257,6 +281,10 @@ misc_callback_update_stadium_window(gboolean capacity)
void
misc_callback_improve_stadium(void)
{
#ifdef DEBUG
printf("misc_callback_improve_stadium\n");
#endif
GtkSpinButton *spinbutton_capacity =
GTK_SPIN_BUTTON(lookup_widget(window.stadium, "spinbutton_capacity")),
*spinbutton_safety =
@ -303,6 +331,10 @@ misc_callback_improve_stadium(void)
void
misc_callback_startup_load(const gchar *filename)
{
#ifdef DEBUG
printf("misc_callback_startup_load\n");
#endif
gtk_widget_hide(window.splash);
if(load_save_load_game(filename, TRUE))
@ -316,6 +348,10 @@ misc_callback_startup_load(const gchar *filename)
void
misc_callback_new_sponsor(void)
{
#ifdef DEBUG
printf("misc_callback_new_sponsor\n");
#endif
GtkTreeView *treeview = GTK_TREE_VIEW(lookup_widget(window.sponsors, "treeview_sponsors"));
GtkTreeModel *model;
GtkTreeIter iter;

View File

@ -44,6 +44,10 @@ void
on_button_add_player_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_add_player_clicked\n");
#endif
misc_callback_add_player();
}
@ -52,6 +56,10 @@ void
on_entry_player_name_activate (GtkEntry *entry,
gpointer user_data)
{
#ifdef DEBUG
printf("on_entry_player_name_activate\n");
#endif
on_button_add_player_clicked(NULL, NULL);
}
@ -60,6 +68,10 @@ void
on_team_selection_ok_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_team_selection_ok_clicked\n");
#endif
misc_callback_start_game();
}
@ -67,6 +79,10 @@ void
on_team_selection_cancel_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_team_selection_cancel_clicked\n");
#endif
main_exit_program(EXIT_OK, NULL);
}
@ -75,6 +91,10 @@ on_button_font_sel_cancel_clicked (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_font_sel_cancel_clicked\n");
#endif
window_destroy(&window.font_sel);
return FALSE;
@ -85,6 +105,10 @@ void
on_button_font_sel_ok_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_font_sel_ok_clicked\n");
#endif
gchar *font =
gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(window.font_sel));
@ -102,6 +126,10 @@ void
on_button_font_sel_apply_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_font_sel_apply_clicked\n");
#endif
gchar *font =
gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(window.font_sel));
@ -124,6 +152,10 @@ on_live_window_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_live_window_delete_event\n");
#endif
if(GTK_WIDGET_IS_SENSITIVE(lookup_widget(widget, "button_live_close")))
{
on_button_live_close_clicked(NULL, NULL);
@ -138,6 +170,10 @@ void
on_button_live_close_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_live_close_clicked\n");
#endif
if(stat1 == STATUS_SHOW_LAST_MATCH && stat3 != -1 &&
stat4 != STATUS_SHOW_LAST_MATCH_PAUSE)
stat4 = STATUS_SHOW_LAST_MATCH_ABORT;
@ -155,6 +191,10 @@ void
on_button_pause_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_pause_clicked\n");
#endif
misc_callback_pause_live_game();
}
@ -163,6 +203,10 @@ void
on_button_resume_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_resume_clicked\n");
#endif
GtkWidget *button_pause =
lookup_widget(window.live, "button_pause");
@ -192,6 +236,10 @@ void
on_spinbutton_speed_value_changed (GtkSpinButton *spinbutton,
gpointer user_data)
{
#ifdef DEBUG
printf("on_spinbutton_speed_value_changed\n");
#endif
option_set_int("int_opt_user_live_game_speed",
&usr(stat2).options, gtk_spin_button_get_value_as_int(spinbutton));
}
@ -201,6 +249,10 @@ void
on_spinbutton_verbosity_value_changed (GtkSpinButton *spinbutton,
gpointer user_data)
{
#ifdef DEBUG
printf("on_spinbutton_verbosity_value_changed\n");
#endif
option_set_int("int_opt_user_live_game_verbosity",
&usr(stat2).options, gtk_spin_button_get_value_as_int(spinbutton));
}
@ -211,6 +263,10 @@ on_treeview_users_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_treeview_users_button_press_event\n");
#endif
misc_callback_remove_user(event);
return FALSE;
@ -220,6 +276,10 @@ void
on_spinbutton_capacity_value_changed (GtkSpinButton *spinbutton,
gpointer user_data)
{
#ifdef DEBUG
printf("on_spinbutton_capacity_value_changed\n");
#endif
misc_callback_update_stadium_window(TRUE);
}
@ -228,6 +288,10 @@ void
on_spinbutton_safety_value_changed (GtkSpinButton *spinbutton,
gpointer user_data)
{
#ifdef DEBUG
printf("on_spinbutton_safety_value_changed\n");
#endif
misc_callback_update_stadium_window(FALSE);
}
@ -236,6 +300,10 @@ void
on_button_stadium_ok_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_stadium_ok_clicked\n");
#endif
misc_callback_improve_stadium();
if(stat0 == STATUS_SHOW_FINANCES)
@ -247,6 +315,10 @@ void
on_button_stadium_cancel_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_stadium_cancel_clicked\n");
#endif
window_destroy(&window.stadium);
}
@ -256,6 +328,10 @@ on_spinbutton_capacity_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_spinbutton_capacity_button_press_event\n");
#endif
if(event->button == 3)
{
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), 0);
@ -270,6 +346,10 @@ on_window_stadium_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_stadium_delete_event\n");
#endif
on_button_stadium_cancel_clicked(NULL, NULL);
return TRUE;
@ -279,6 +359,10 @@ void
on_combo_country_changed (GtkComboBox *combobox,
gpointer user_data)
{
#ifdef DEBUG
printf("on_combo_country_changed\n");
#endif
GtkTreeIter iter;
gchar *buf = NULL;
@ -294,6 +378,10 @@ on_spinbutton_speed_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_spinbutton_speed_button_press_event\n");
#endif
if(event->button == 3)
{
if(option_int("int_opt_user_live_game_speed", &usr(stat2).options) ==
@ -324,6 +412,10 @@ void
on_button_sponsors_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_sponsors_clicked\n");
#endif
misc_callback_new_sponsor();
window_destroy(&window.sponsors);
@ -336,6 +428,10 @@ on_treeview_sponsors_row_activated (GtkTreeView *treeview,
GtkTreeViewColumn *column,
gpointer user_data)
{
#ifdef DEBUG
printf("on_treeview_sponsors_row_activated\n");
#endif
on_button_sponsors_clicked(NULL, NULL);
}
@ -345,6 +441,10 @@ on_window_sponsors_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_sponsors_delete_event\n");
#endif
return TRUE;
}
@ -353,6 +453,10 @@ void
on_button_sponsors_wait_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_sponsors_wait_clicked\n");
#endif
if(stat1 != STATUS_SPONSOR_CONTINUE)
{
g_string_printf(current_user.sponsor.name, _("None"));
@ -373,6 +477,10 @@ on_eventbox_lg_style_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_eventbox_lg_style_button_press_event\n");
#endif
gint new_style = -1;
if(stat0 == STATUS_LIVE_GAME_PAUSE)
@ -414,6 +522,10 @@ on_eventbox_lg_boost_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_eventbox_lg_boost_button_press_event\n");
#endif
gint new_boost = -1;
if(stat0 == STATUS_LIVE_GAME_PAUSE)
@ -459,6 +571,10 @@ void
on_button_team_selection_back_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_team_selection_back_clicked\n");
#endif
window_destroy(&window.startup);
stat0 = STATUS_SPLASH;
window_show_splash();

View File

@ -1,7 +1,6 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -36,6 +36,14 @@
gchar*
name_get(const gchar *names_file)
{
#ifdef DEBUG
printf("name_get\n");
#endif
#ifdef DEBUG
printf("name_get\n");
#endif
gint i;
NameList new;
@ -73,6 +81,14 @@ name_get(const gchar *names_file)
gchar*
name_get_from_list(const NameList *namelist)
{
#ifdef DEBUG
printf("name_get_from_list\n");
#endif
#ifdef DEBUG
printf("name_get_from_list\n");
#endif
gchar buf[SMALL];
sprintf(buf, "%s %s", name_get_random_first_name(namelist),
@ -86,6 +102,10 @@ name_get_from_list(const NameList *namelist)
void
name_shorten_list(NameList *namelist)
{
#ifdef DEBUG
printf("name_shorten_list\n");
#endif
gint idx;
while(namelist->first_names->len * namelist->last_names->len >

View File

@ -36,6 +36,14 @@
gchar*
option_string(const gchar *name, OptionList *optionlist)
{
#ifdef DEBUG
printf("option_string\n");
#endif
#ifdef DEBUG
printf("option_string\n");
#endif
gpointer element = g_datalist_get_data(&optionlist->datalist, name);
if(element != NULL)
@ -70,6 +78,10 @@ option_string_pointer(const gchar *name, OptionList *optionlist)
gint
option_int(const gchar *name, OptionList *optionlist)
{
#ifdef DEBUG
printf("option_int\n");
#endif
gpointer element = g_datalist_get_data(&optionlist->datalist, name);
if(element != NULL)
@ -85,6 +97,10 @@ option_int(const gchar *name, OptionList *optionlist)
gint*
option_int_pointer(const gchar *name, OptionList *optionlist)
{
#ifdef DEBUG
printf("option_int_pointer\n");
#endif
gpointer element = g_datalist_get_data(&optionlist->datalist, name);
if(element != NULL)
@ -122,6 +138,10 @@ option_float(const gchar *name, OptionList *optionlist)
void
option_set_string(const gchar *name, OptionList *optionlist, const gchar *new_value)
{
#ifdef DEBUG
printf("option_set_string\n");
#endif
gpointer element = g_datalist_get_data(&optionlist->datalist, name);
if(element == NULL)
@ -137,6 +157,10 @@ option_set_string(const gchar *name, OptionList *optionlist, const gchar *new_va
void
option_set_int(const gchar *name, OptionList *optionlist, gint new_value)
{
#ifdef DEBUG
printf("option_set_int\n");
#endif
gpointer element = g_datalist_get_data(&optionlist->datalist, name);
if(element == NULL)
@ -151,6 +175,10 @@ void
option_add(OptionList *optionlist, const gchar *name,
gint int_value, const gchar *string_value)
{
#ifdef DEBUG
printf("option_add\n");
#endif
gint i;
Option new;
gpointer element = NULL;

View File

@ -106,6 +106,10 @@ enum BooleanOptions
void
option_gui_write_bool_widgets(gint **bool_options, GtkToggleButton **bool_widgets)
{
#ifdef DEBUG
printf("option_gui_write_bool_widgets\n");
#endif
bool_widgets[BOOL_OPT_CONF_QUIT] =
GTK_TOGGLE_BUTTON(lookup_widget(window.options, "checkbutton_conf_quit"));
bool_options[BOOL_OPT_CONF_QUIT] = opt_intp("int_opt_confirm_quit");
@ -359,6 +363,10 @@ enum SpinOptions
void
option_gui_write_spin_widgets(gint **spin_options, GtkSpinButton **spin_widgets)
{
#ifdef DEBUG
printf("option_gui_write_spin_widgets\n");
#endif
gint tmp = 0;
spin_widgets[SPIN_OPT_AUTOSAVE] =
@ -428,6 +436,10 @@ enum EntryOptions
void
option_gui_write_entry_widgets(gchar ***entry_options, GtkEntry **entry_widgets)
{
#ifdef DEBUG
printf("option_gui_write_entry_widgets\n");
#endif
entry_widgets[ENTRY_OPT_CONSTANTS] =
GTK_ENTRY(lookup_widget(window.options, "entry_constants_file"));
entry_options[ENTRY_OPT_CONSTANTS] = opt_strp("string_opt_constants_file");
@ -442,6 +454,10 @@ option_gui_write_entry_widgets(gchar ***entry_options, GtkEntry **entry_widgets)
void
option_gui_set_up_window(void)
{
#ifdef DEBUG
printf("option_gui_set_up_window\n");
#endif
gint i;
gchar buf[SMALL];
GtkToggleButton *bool_widgets[BOOL_OPT_END];
@ -479,6 +495,10 @@ option_gui_set_up_window(void)
void
option_gui_write_options(void)
{
#ifdef DEBUG
printf("option_gui_write_options\n");
#endif
gint i;
gint language_index =
gtk_combo_box_get_active(GTK_COMBO_BOX(lookup_widget(window.options, "combobox_languages")));

View File

@ -37,6 +37,10 @@ void
on_button_options_ok_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_options_ok_clicked\n");
#endif
gboolean save_global =
gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(lookup_widget(window.options, "checkbutton_save_global"))),
@ -72,6 +76,10 @@ void
on_button_options_cancel_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_options_cancel_clicked\n");
#endif
window_destroy(&window.options);
}
@ -80,6 +88,10 @@ void
on_button_font_name_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_font_name_clicked\n");
#endif
window_create(WINDOW_FONT_SEL);
}
@ -88,6 +100,10 @@ void
on_button_reload_constants_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_button_reload_constants_clicked\n");
#endif
const gchar *constants_file =
gtk_entry_get_text(GTK_ENTRY(lookup_widget(window.options, "entry_constants_file")));
@ -101,6 +117,10 @@ on_checkbutton_save_global_button_press_event
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_checkbutton_save_global_button_press_event\n");
#endif
if(event->button == 3)
{
gchar *conf_file = file_find_support_file("bygfoot.conf", TRUE);
@ -122,6 +142,10 @@ on_checkbutton_save_user_button_press_event
GdkEventButton *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_checkbutton_save_user_button_press_event\n");
#endif
if(event->button == 3)
{
@ -139,6 +163,10 @@ on_window_options_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_options_delete_event\n");
#endif
on_button_options_cancel_clicked(NULL, NULL);
return TRUE;
@ -149,6 +177,10 @@ void
on_spinbutton_recreation_value_changed (GtkSpinButton *spinbutton,
gpointer user_data)
{
#ifdef DEBUG
printf("on_spinbutton_recreation_value_changed\n");
#endif
gchar buf[SMALL];
sprintf(buf, "%d", CAMP_SCALE_MAX - gtk_spin_button_get_value_as_int(spinbutton));

View File

@ -1,7 +1,6 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -45,6 +45,10 @@
Player
player_new(Team *tm, gfloat average_talent, gboolean new_id)
{
#ifdef DEBUG
printf("player_new\n");
#endif
gint i;
gfloat skill_factor =
math_rnd(1 - const_float("float_player_average_talent_variance"),
@ -109,6 +113,10 @@ player_new(Team *tm, gfloat average_talent, gboolean new_id)
void
player_complete_def(Player *pl, gfloat average_talent)
{
#ifdef DEBUG
printf("player_complete_def\n");
#endif
gint i;
gfloat skill_factor =
math_rnd(1 - const_float("float_player_average_talent_variance"),
@ -175,6 +183,10 @@ player_complete_def(Player *pl, gfloat average_talent)
gint
player_get_position_from_structure(gint structure, gint player_number)
{
#ifdef DEBUG
printf("player_get_position_from_structure\n");
#endif
gint position = -1;
gint bound[2] =
{math_get_place(structure, 3) + 1,
@ -205,6 +217,10 @@ player_get_position_from_structure(gint structure, gint player_number)
gfloat
player_skill_from_talent(const Player *pl)
{
#ifdef DEBUG
printf("player_skill_from_talent\n");
#endif
gfloat skill = pl->talent, cur_age = pl->peak_age;
if(pl->age < pl->peak_age)
@ -241,6 +257,10 @@ player_skill_from_talent(const Player *pl)
void
player_estimate_talent(Player *pl)
{
#ifdef DEBUG
printf("player_estimate_talent\n");
#endif
gint i, j;
gfloat scout_deviance[QUALITY_END];
@ -269,6 +289,10 @@ player_estimate_talent(Player *pl)
gint
player_assign_value(const Player *pl)
{
#ifdef DEBUG
printf("player_assign_value\n");
#endif
gfloat value;
value = powf((const_float("float_player_value_skill_weight") * pl->skill +
@ -292,6 +316,10 @@ player_assign_value(const Player *pl)
gint
player_assign_wage(const Player *pl)
{
#ifdef DEBUG
printf("player_assign_wage\n");
#endif
gfloat wage;
wage = rint(((gfloat)pl->value * const_float("float_player_wage_value_factor")) *
@ -345,6 +373,10 @@ player_of_idx_team(const Team *tm, gint number)
Player*
player_of_id_team(const Team *tm, gint id)
{
#ifdef DEBUG
printf("player_of_id_team\n");
#endif
gint i;
for(i=0;i<tm->players->len;i++)
@ -362,6 +394,10 @@ player_of_id_team(const Team *tm, gint id)
gboolean
query_player_id_in_team(gint player_id, const Team *tm)
{
#ifdef DEBUG
printf("query_player_id_in_team\n");
#endif
gint i;
for(i=0;i<tm->players->len;i++)
@ -380,6 +416,10 @@ query_player_id_in_team(gint player_id, const Team *tm)
gint
player_all_games_goals(const Player *pl, gint type)
{
#ifdef DEBUG
printf("player_all_games_goals\n");
#endif
gint i, sum = 0;
for(i=0;i<pl->games_goals->len;i++)
@ -400,6 +440,10 @@ player_all_games_goals(const Player *pl, gint type)
gint
player_all_cards(const Player *pl)
{
#ifdef DEBUG
printf("player_all_cards\n");
#endif
gint i, sum = 0;
for(i=0;i<pl->cards->len;i++)
@ -416,6 +460,10 @@ player_all_cards(const Player *pl)
gint
player_compare_func(gconstpointer a, gconstpointer b, gpointer data)
{
#ifdef DEBUG
printf("player_compare_func\n");
#endif
gint data_int = ABS(GPOINTER_TO_INT(data));
gint data_int2 = GPOINTER_TO_INT(data);
gint type = data_int % 100;
@ -481,6 +529,10 @@ player_compare_func(gconstpointer a, gconstpointer b, gpointer data)
gint
player_compare_substitute_func(gconstpointer a, gconstpointer b, gpointer data)
{
#ifdef DEBUG
printf("player_compare_substitute_func\n");
#endif
const Player *pl1 = *(const Player**)a;
const Player *pl2 = *(const Player**)b;
gint position = GPOINTER_TO_INT(data);
@ -535,6 +587,10 @@ player_compare_substitute_func(gconstpointer a, gconstpointer b, gpointer data)
gboolean
player_substitution_good_structure(gint old_structure, gint old_pos, gint player_pos)
{
#ifdef DEBUG
printf("player_substitution_good_structure\n");
#endif
gint accepted_structures[5] = {532, 442, 352, 433, 343};
gint new_structure =
old_structure - (gint)rint(powf(10, PLAYER_POS_FORWARD - old_pos)) +
@ -550,6 +606,10 @@ player_substitution_good_structure(gint old_structure, gint old_pos, gint player
void
player_copy(Player *pl, Team *tm, gint insert_at)
{
#ifdef DEBUG
printf("player_copy\n");
#endif
Player new = *pl;
new.team = tm;
@ -575,6 +635,10 @@ player_copy(Player *pl, Team *tm, gint insert_at)
void
player_move(Team *tm1, gint player_number, Team *tm2, gint insert_at)
{
#ifdef DEBUG
printf("player_move\n");
#endif
Player pl = *player_of_idx_team(tm1, player_number);
pl.team = tm2;
@ -588,6 +652,10 @@ player_move(Team *tm1, gint player_number, Team *tm2, gint insert_at)
void
player_swap(Team *tm1, gint player_number1, Team *tm2, gint player_number2)
{
#ifdef DEBUG
printf("player_swap\n");
#endif
gint move = (tm1 == tm2 && player_number1 < player_number2) ?
-1 : 1;
@ -636,6 +704,10 @@ player_swap(Team *tm1, gint player_number1, Team *tm2, gint player_number2)
gfloat
player_get_cskill(const Player *pl, gint position, gboolean check_health)
{
#ifdef DEBUG
printf("player_get_cskill\n");
#endif
gfloat cskill_factor;
if(check_health &&
@ -668,6 +740,10 @@ player_get_cskill(const Player *pl, gint position, gboolean check_health)
gint
player_is_banned(const Player *pl)
{
#ifdef DEBUG
printf("player_is_banned\n");
#endif
Fixture *fix = team_get_fixture(pl->team, FALSE);
gint yellow_red = -1, yellow, red;
@ -716,6 +792,10 @@ player_get_game_skill(const Player *pl, gboolean skill, gboolean count_special)
void
player_decrease_fitness(Player *pl)
{
#ifdef DEBUG
printf("player_decrease_fitness\n");
#endif
gfloat goalie_factor =
1 - const_float("float_player_fitness_decrease_factor_goalie") *
(pl->cpos == 0);
@ -758,6 +838,10 @@ player_decrease_fitness(Player *pl)
void
player_update_fitness(Player *pl)
{
#ifdef DEBUG
printf("player_update_fitness\n");
#endif
gfloat variance =
math_rnd(1 - const_float("float_player_fitness_increase_variance"),
1 + const_float("float_player_fitness_increase_variance"));
@ -795,6 +879,10 @@ player_update_fitness(Player *pl)
gint
player_card_get(const Player *pl, gint clid, gint card_type)
{
#ifdef DEBUG
printf("player_card_get\n");
#endif
gint i;
gint return_value = 0;
@ -822,6 +910,10 @@ player_card_get(const Player *pl, gint clid, gint card_type)
void
player_card_set(Player *pl, gint clid, gint card_type, gint value, gboolean diff)
{
#ifdef DEBUG
printf("player_card_set\n");
#endif
gint i, *card_value = NULL;
PlayerCard new;
@ -862,6 +954,10 @@ player_card_set(Player *pl, gint clid, gint card_type, gint value, gboolean diff
gint
player_games_goals_get(const Player *pl, gint clid, gint type)
{
#ifdef DEBUG
printf("player_games_goals_get\n");
#endif
gint i, return_value = 0;
for(i=0;i<pl->games_goals->len;i++)
@ -891,6 +987,10 @@ player_games_goals_get(const Player *pl, gint clid, gint type)
void
player_games_goals_set(Player *pl, gint clid, gint type, gint value)
{
#ifdef DEBUG
printf("player_games_goals_set\n");
#endif
gint i, *games_goals_value = NULL;
PlayerGamesGoals new;
@ -928,6 +1028,10 @@ player_games_goals_set(Player *pl, gint clid, gint type, gint value)
void
player_update_skill(Player *pl)
{
#ifdef DEBUG
printf("player_update_skill\n");
#endif
gint i;
if(!query_player_is_youth(pl))
@ -983,6 +1087,10 @@ player_update_skill(Player *pl)
void
player_update_injury(Player *pl)
{
#ifdef DEBUG
printf("player_update_injury\n");
#endif
gint i, j;
gfloat rndom;
gint physio = (query_player_is_cpu(pl)) ?
@ -1026,6 +1134,10 @@ player_update_injury(Player *pl)
void
player_update_streak(Player *pl)
{
#ifdef DEBUG
printf("player_update_streak\n");
#endif
gfloat streak_type, streak_prob,
streak_length, decrease_factor = 0;
gfloat streak_prob_factor =
@ -1100,6 +1212,10 @@ player_update_streak(Player *pl)
void
player_update_weekly(Player *pl)
{
#ifdef DEBUG
printf("player_update_weekly\n");
#endif
// workaround, possibly unnecessary
if(pl->fitness < 0)
pl->fitness = const_float("float_player_fitness_lower");
@ -1141,6 +1257,10 @@ player_update_weekly(Player *pl)
void
player_remove_contract(Player *pl)
{
#ifdef DEBUG
printf("player_remove_contract\n");
#endif
user_event_add(user_from_team(pl->team), EVENT_TYPE_PLAYER_LEFT, -1, -1, NULL,
pl->name);
player_remove_from_team(pl->team, player_id_index(pl->team, pl->id));
@ -1151,6 +1271,10 @@ player_remove_contract(Player *pl)
void
player_remove_from_team(Team *tm, gint idx)
{
#ifdef DEBUG
printf("player_remove_from_team\n");
#endif
gint usr_idx = team_is_user(tm);
if(usr_idx != -1 &&
@ -1170,6 +1294,10 @@ player_remove_from_team(Team *tm, gint idx)
void
player_update_post_match(Player *pl, const Fixture *fix)
{
#ifdef DEBUG
printf("player_update_post_match\n");
#endif
gint yellow_red = league_cup_get_yellow_red(fix->clid);
gint winner = -1;
@ -1210,6 +1338,10 @@ player_update_post_match(Player *pl, const Fixture *fix)
void
player_replace_by_new(Player *pl, gboolean free_player)
{
#ifdef DEBUG
printf("player_replace_by_new\n");
#endif
Team *tm = pl->team;
gint idx = player_id_index(tm, pl->id);
Player new = player_new(tm, team_get_average_talent(tm), FALSE);
@ -1232,6 +1364,10 @@ player_replace_by_new(Player *pl, gboolean free_player)
void
player_update_week_roundly(Team *tm, gint idx)
{
#ifdef DEBUG
printf("player_update_week_roundly\n");
#endif
Player *pl = player_of_idx_team(tm, idx);
if(pl->health == 0 &&
@ -1246,7 +1382,16 @@ player_update_week_roundly(Team *tm, gint idx)
/** Return injury descriptions. */
gchar*
player_injury_to_char(gint injury_type)
{
{
#ifdef DEBUG
printf("player_injury_to_char\n");
#endif
#ifdef DEBUG
printf("player_injury_to_char\n");
#endif
switch(injury_type)
{
default:
@ -1300,6 +1445,10 @@ player_injury_to_char(gint injury_type)
void
player_season_start(Player *pl, gfloat skill_change)
{
#ifdef DEBUG
printf("player_season_start\n");
#endif
gint i;
if(pl->games_goals->len > 0)
@ -1338,6 +1487,14 @@ player_season_start(Player *pl, gfloat skill_change)
gchar*
player_get_last_name(const gchar *name)
{
#ifdef DEBUG
printf("player_get_last_name\n");
#endif
#ifdef DEBUG
printf("player_get_last_name\n");
#endif
gint i;
gchar buf[SMALL];
gchar *rev_name = NULL;
@ -1372,6 +1529,10 @@ player_get_last_name(const gchar *name)
GPtrArray*
player_get_pointers_from_array(const GArray *players_array)
{
#ifdef DEBUG
printf("player_get_pointers_from_array\n");
#endif
gint i;
GPtrArray *players = g_ptr_array_new();
@ -1386,6 +1547,10 @@ player_get_pointers_from_array(const GArray *players_array)
void
player_move_to_ya(gint idx)
{
#ifdef DEBUG
printf("player_move_to_ya\n");
#endif
Player *pl = player_of_idx_team(current_user.tm, idx);
Player player = *pl;
@ -1403,6 +1568,10 @@ player_move_to_ya(gint idx)
void
player_move_from_ya(gint idx)
{
#ifdef DEBUG
printf("player_move_from_ya\n");
#endif
Player *pl = &g_array_index(current_user.youth_academy.players, Player, idx);
Player player = *pl;
@ -1417,6 +1586,10 @@ player_move_from_ya(gint idx)
void
player_streak_add_to_prob(Player *pl, gfloat add)
{
#ifdef DEBUG
printf("player_streak_add_to_prob\n");
#endif
pl->streak_prob += add;
pl->streak_prob = CLAMP(pl->streak_prob, -1, 1);
}
@ -1425,6 +1598,10 @@ player_streak_add_to_prob(Player *pl, gfloat add)
gboolean
query_player_is_in_ya(const Player *pl)
{
#ifdef DEBUG
printf("query_player_is_in_ya\n");
#endif
gint i;
for(i=0;i<pl->team->players->len;i++)
@ -1439,6 +1616,10 @@ query_player_is_in_ya(const Player *pl)
gboolean
query_player_star_balks(const Player *pl, const Team *tm, gboolean transfer)
{
#ifdef DEBUG
printf("query_player_star_balks\n");
#endif
gint i;
gint number_of_stars_field;
gint number_of_stars_goal;

View File

@ -80,6 +80,10 @@ WeekFunc end_week_funcs[] = {stat_update_leagues, end_week_hide_cups, NULL};
void
start_new_game(void)
{
#ifdef DEBUG
printf("start_new_game\n");
#endif
start_write_variables();
start_generate_league_teams();
@ -90,6 +94,10 @@ start_new_game(void)
void
start_new_season(void)
{
#ifdef DEBUG
printf("start_new_season\n");
#endif
gint i, j;
gchar buf[SMALL];
@ -205,6 +213,10 @@ start_new_season(void)
void
start_write_variables(void)
{
#ifdef DEBUG
printf("start_write_variables\n");
#endif
gint i;
season = 1;
@ -218,6 +230,10 @@ start_write_variables(void)
void
start_generate_league_teams(void)
{
#ifdef DEBUG
printf("start_generate_league_teams\n");
#endif
gint i, j;
stat5 = STATUS_GENERATE_TEAMS;
@ -239,6 +255,10 @@ start_generate_league_teams(void)
void
start_new_season_reset_ids(void)
{
#ifdef DEBUG
printf("start_new_season_reset_ids\n");
#endif
gint i, max;
max = -1;
@ -260,6 +280,10 @@ start_new_season_reset_ids(void)
void
end_week_round(void)
{
#ifdef DEBUG
printf("end_week_round\n");
#endif
gint i = 0;
gboolean new_week = TRUE;
WeekFunc *end_func = end_week_round_funcs;
@ -316,6 +340,10 @@ end_week_round(void)
void
end_week_round_results(void)
{
#ifdef DEBUG
printf("end_week_round_results\n");
#endif
gint i, j, done = 0;
gchar buf[SMALL], buf2[SMALL];
gfloat num_matches =
@ -375,6 +403,10 @@ end_week_round_results(void)
void
end_week_round_sort_tables(void)
{
#ifdef DEBUG
printf("end_week_round_sort_tables\n");
#endif
gint i, j, k;
for(i=0;i<ligs->len;i++)
@ -413,6 +445,10 @@ end_week_round_sort_tables(void)
void
end_week_round_update_fixtures(void)
{
#ifdef DEBUG
printf("end_week_round_update_fixtures\n");
#endif
gint i;
for(i=0;i<acps->len;i++)
@ -451,6 +487,10 @@ end_week_round_update_fixtures(void)
void
start_week_round(void)
{
#ifdef DEBUG
printf("start_week_round\n");
#endif
WeekFunc *start_func = start_week_round_funcs;
if(debug > 100)
@ -486,6 +526,10 @@ start_week_round(void)
void
start_week(void)
{
#ifdef DEBUG
printf("start_week\n");
#endif
WeekFunc *start_func = start_week_funcs;
while(*start_func != NULL)
@ -499,6 +543,10 @@ start_week(void)
void
end_week(void)
{
#ifdef DEBUG
printf("end_week\n");
#endif
WeekFunc *end_func = end_week_funcs;
while(*end_func != NULL)
@ -516,6 +564,10 @@ end_week(void)
void
end_week_hide_cups(void)
{
#ifdef DEBUG
printf("end_week_hide_cups\n");
#endif
gint i;
for(i=acps->len - 1; i >= 0; i--)
@ -528,6 +580,10 @@ end_week_hide_cups(void)
void
start_week_add_cups(void)
{
#ifdef DEBUG
printf("start_week_add_cups\n");
#endif
gint i;
for(i=0;i<cps->len;i++)
@ -544,6 +600,10 @@ start_week_add_cups(void)
void
start_week_update_teams(void)
{
#ifdef DEBUG
printf("start_week_update_teams\n");
#endif
gint i, j;
for(i=0;i<ligs->len;i++)
@ -560,6 +620,10 @@ start_week_update_teams(void)
void
start_week_round_update_teams(void)
{
#ifdef DEBUG
printf("start_week_round_update_teams\n");
#endif
gint i, j;
for(i=0;i<ligs->len;i++)
@ -575,6 +639,10 @@ start_week_round_update_teams(void)
void
start_week_update_user_finances(void)
{
#ifdef DEBUG
printf("start_week_update_user_finances\n");
#endif
gint i;
if(sett_int("int_opt_disable_finances"))
@ -588,6 +656,10 @@ start_week_update_user_finances(void)
void
start_week_update_users(void)
{
#ifdef DEBUG
printf("start_week_update_users\n");
#endif
gint i;
for(i=0;i<users->len;i++)
@ -609,6 +681,10 @@ start_week_update_users(void)
void
start_week_update_leagues(void)
{
#ifdef DEBUG
printf("start_week_update_leagues\n");
#endif
gint i;
for(i = 0; i < ligs->len; i++)
@ -619,6 +695,10 @@ start_week_update_leagues(void)
gboolean
query_start_end_season_end(void)
{
#ifdef DEBUG
printf("query_start_end_season_end\n");
#endif
gint i, j;
for(i=0;i<ligs->len;i++)
@ -638,6 +718,10 @@ query_start_end_season_end(void)
void
start_new_season_league_changes(void)
{
#ifdef DEBUG
printf("start_new_season_league_changes\n");
#endif
gint i, j, k;
gint league_size[ligs->len];
GArray *team_movements = g_array_new(FALSE, FALSE, sizeof(TeamMove));
@ -697,5 +781,9 @@ start_new_season_league_changes(void)
void
end_season(void)
{
#ifdef DEBUG
printf("end_season\n");
#endif
stat_create_season_stat();
}

View File

@ -55,6 +55,10 @@ stat_league_new(const gchar *league_name, const gchar *league_symbol)
void
stat_update_leagues(void)
{
#ifdef DEBUG
printf("stat_update_leagues\n");
#endif
gint i;
for(i=0;i<ligs->len;i++)
@ -77,6 +81,10 @@ stat_update_leagues(void)
void
stat_update_league_players(League *league)
{
#ifdef DEBUG
printf("stat_update_league_players\n");
#endif
gint i, j;
GPtrArray *players_sorted[2] = {g_ptr_array_new(),
g_ptr_array_new()};
@ -130,6 +138,10 @@ stat_update_league_players(League *league)
GArray*
stat_update_league_teams(const GArray *teams_array, gint compare_type)
{
#ifdef DEBUG
printf("stat_update_league_teams\n");
#endif
gint i;
GArray *stats = g_array_new(FALSE, FALSE, sizeof(Stat));
GPtrArray *teams = g_ptr_array_new();
@ -165,6 +177,10 @@ stat_update_league_teams(const GArray *teams_array, gint compare_type)
SeasonStat
stat_season_stat_new(gint season_number)
{
#ifdef DEBUG
printf("stat_season_stat_new\n");
#endif
SeasonStat new;
new.season_number = season_number;
@ -179,6 +195,10 @@ stat_season_stat_new(gint season_number)
void
stat_create_season_stat(void)
{
#ifdef DEBUG
printf("stat_create_season_stat\n");
#endif
gint i, j;
SeasonStat new = stat_season_stat_new(season);
ChampStat new_champ;
@ -220,6 +240,10 @@ stat_create_season_stat(void)
void
stat_show_av_goals(GArray *fixtures)
{
#ifdef DEBUG
printf("stat_show_av_goals\n");
#endif
gint i;
gfloat games = 0,
allgoals = 0,
@ -264,6 +288,10 @@ stat_show_av_goals(GArray *fixtures)
void
stat_show_av_league_goals(void)
{
#ifdef DEBUG
printf("stat_show_av_league_goals\n");
#endif
gint i;
g_print("\n\n");

View File

@ -41,6 +41,14 @@ GPtrArray *token_strat[2];
gchar*
strategy_get_random(void)
{
#ifdef DEBUG
printf("strategy_get_random\n");
#endif
#ifdef DEBUG
printf("strategy_get_random\n");
#endif
gint i, rndom =
math_rndi(1, g_array_index(strategies, Strategy, strategies->len - 1).priority);
@ -63,6 +71,10 @@ strategy_compare_players(gconstpointer a,
gconstpointer b,
gpointer user_data)
{
#ifdef DEBUG
printf("strategy_compare_players\n");
#endif
const Player *pl1 = *(const Player**)a;
const Player *pl2 = *(const Player**)b;
const StrategyPrematch *strat = (StrategyPrematch*)user_data;
@ -111,6 +123,10 @@ query_strategy_formation_possible(const GPtrArray *players,
const StrategyPrematch *prematch,
gint formation)
{
#ifdef DEBUG
printf("query_strategy_formation_possible\n");
#endif
gint i, pos[3] = {0, 0, 0};
for(i=0;i<players->len;i++)
@ -134,6 +150,10 @@ void
strategy_update_lineup(Team *tm, const GPtrArray *players,
const StrategyPrematch *prematch, gint formation)
{
#ifdef DEBUG
printf("strategy_update_lineup\n");
#endif
gint i;
GArray *ids = g_array_new(FALSE, FALSE, sizeof(gint));
GArray *new_players = g_array_new(FALSE, FALSE, sizeof(Player));
@ -179,6 +199,10 @@ strategy_update_lineup(Team *tm, const GPtrArray *players,
void
strategy_repair_player(Player *pl)
{
#ifdef DEBUG
printf("strategy_repair_player\n");
#endif
gint i;
for(i=0;i<pl->cards->len;i++)
@ -201,6 +225,10 @@ void
strategy_repair_players(GPtrArray *players,
const StrategyPrematch *prematch)
{
#ifdef DEBUG
printf("strategy_repair_players\n");
#endif
gint i, j;
gint form[3] =
{math_get_place(g_array_index(prematch->formations, gint, 0), 3),
@ -233,6 +261,10 @@ strategy_repair_players(GPtrArray *players,
void
strategy_apply_prematch(Team *tm, const StrategyPrematch *prematch)
{
#ifdef DEBUG
printf("strategy_apply_prematch\n");
#endif
gint i;
GPtrArray *players = player_get_pointers_from_array(tm->players);
@ -269,6 +301,10 @@ strategy_apply_prematch(Team *tm, const StrategyPrematch *prematch)
void
strategy_update_team_pre_match(Team *tm)
{
#ifdef DEBUG
printf("strategy_update_team_pre_match\n");
#endif
gint i;
const GArray *prematches =
strategy_from_sid(tm->strategy_sid)->prematch;
@ -296,6 +332,10 @@ strategy_update_team_pre_match(Team *tm)
Strategy*
strategy_from_sid(const gchar *sid)
{
#ifdef DEBUG
printf("strategy_from_sid\n");
#endif
gint i;
for(i=0;i<strategies->len;i++)
@ -313,6 +353,10 @@ strategy_from_sid(const gchar *sid)
void
strategy_set_tokens(const Team *tm, const Fixture *fixture)
{
#ifdef DEBUG
printf("strategy_set_tokens\n");
#endif
const Fixture *fix = (fixture == NULL) ?
team_get_fixture(tm, FALSE) : fixture;
const Team *opp = (fix == NULL) ? NULL :
@ -358,6 +402,10 @@ strategy_set_tokens(const Team *tm, const Fixture *fixture)
void
strategy_free_tokens(void)
{
#ifdef DEBUG
printf("strategy_free_tokens\n");
#endif
gint i;
for(i=0;i<token_strat[0]->len;i++)
@ -374,6 +422,10 @@ strategy_free_tokens(void)
void
strategy_live_game_set_tokens(const LiveGame *match, gint team_idx)
{
#ifdef DEBUG
printf("strategy_live_game_set_tokens\n");
#endif
gint tmp_int,
current_min = live_game_unit_get_minute(
&g_array_index(match->units, LiveGameUnit, match->units->len - 1));
@ -430,6 +482,10 @@ strategy_compare_players_sub(gconstpointer a,
gconstpointer b,
gpointer user_data)
{
#ifdef DEBUG
printf("strategy_compare_players_sub\n");
#endif
gfloat skill1, skill2;
const Player *pl1 = *(const Player**)a;
const Player *pl2 = *(const Player**)b;
@ -478,6 +534,10 @@ strategy_compare_positions(gconstpointer a,
gconstpointer b,
gpointer user_data)
{
#ifdef DEBUG
printf("strategy_compare_positions\n");
#endif
gint i, pos[4] = {0, 0, 0, 0};
gint pos1 = *(gint*)a,
pos2 = *(gint*)b;
@ -500,6 +560,10 @@ gint
strategy_get_sub(const Team *tm, gint position,
gint property, gboolean sub_in)
{
#ifdef DEBUG
printf("strategy_get_sub\n");
#endif
gint i, start = (sub_in) ? 11 : 0,
stop = (sub_in) ? tm->players->len : 11;
GPtrArray *players = g_ptr_array_new();
@ -552,6 +616,10 @@ void
strategy_live_game_apply_action(LiveGame *match, gint team_idx,
const StrategyMatchAction *action)
{
#ifdef DEBUG
printf("strategy_live_game_apply_action\n");
#endif
gint sub_in_id = -1, sub_out_id = -1;
Team *tm = match->fix->teams[team_idx];
gint old_form = tm->structure;
@ -606,6 +674,10 @@ strategy_live_game_apply_action(LiveGame *match, gint team_idx,
void
strategy_live_game_check(LiveGame *match, gint team_idx)
{
#ifdef DEBUG
printf("strategy_live_game_check\n");
#endif
gint i;
Team *tm = match->fix->teams[team_idx];
const Strategy *strat = strategy_from_sid(tm->strategy_sid);

View File

@ -1,7 +1,6 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@ -50,6 +49,10 @@ static GList *pixmaps_directories = NULL;
void
add_pixmap_directory (const gchar *directory)
{
#ifdef DEBUG
printf("add_pixmap_directory\n");
#endif
pixmaps_directories = g_list_prepend (pixmaps_directories,
g_strdup (directory));
}
@ -58,6 +61,14 @@ add_pixmap_directory (const gchar *directory)
static gchar*
find_pixmap_file (const gchar *filename)
{
#ifdef DEBUG
printf("find_pixmap_file\n");
#endif
#ifdef DEBUG
printf("find_pixmap_file\n");
#endif
GList *elem;
/* We step through each of the pixmaps directory to find it. */
@ -134,6 +145,10 @@ glade_set_atk_action_description (AtkAction *action,
const gchar *action_name,
const gchar *description)
{
#ifdef DEBUG
printf("glade_set_atk_action_description\n");
#endif
gint n_actions, i;
n_actions = atk_action_get_n_actions (action);

View File

@ -33,6 +33,10 @@
Table
table_new(void)
{
#ifdef DEBUG
printf("table_new\n");
#endif
Table new;
new.name = NULL;
@ -50,6 +54,10 @@ table_new(void)
TableElement
table_element_new(Team *team, gint old_rank)
{
#ifdef DEBUG
printf("table_element_new\n");
#endif
gint i;
TableElement new;
@ -69,6 +77,10 @@ table_element_new(Team *team, gint old_rank)
void
table_update(const Fixture *fix)
{
#ifdef DEBUG
printf("table_update\n");
#endif
gint i, j, end;
gint idx = (fix->result[0][0] < fix->result[1][0]);
TableElement *elements[2];
@ -125,6 +137,10 @@ table_update(const Fixture *fix)
void
table_update_get_elements(TableElement **elements, const Fixture *fix, gboolean non_cumulative)
{
#ifdef DEBUG
printf("table_update_get_elements\n");
#endif
gint i, j;
Table *table;
@ -176,6 +192,10 @@ table_element_compare_func(gconstpointer a,
gconstpointer b,
gpointer clid_pointer)
{
#ifdef DEBUG
printf("table_element_compare_func\n");
#endif
gint i;
gint clid, cup_round, value;
TableElement *element1 = (TableElement*)a,
@ -247,6 +267,10 @@ table_element_compare_func(gconstpointer a,
gboolean
query_tables_in_country(void)
{
#ifdef DEBUG
printf("query_tables_in_country\n");
#endif
gint i;
for(i=0;i<ligs->len;i++)
@ -264,6 +288,10 @@ query_tables_in_country(void)
Table
table_copy(const Table *table)
{
#ifdef DEBUG
printf("table_copy\n");
#endif
gint i, j;
Table new_table;
TableElement new_table_element;

View File

@ -50,6 +50,10 @@
Team
team_new(gboolean new_id)
{
#ifdef DEBUG
printf("team_new\n");
#endif
Team new;
new.name = new.names_file =
@ -74,6 +78,10 @@ team_new(gboolean new_id)
void
team_generate_players_stadium(Team *tm, gfloat av_talent)
{
#ifdef DEBUG
printf("team_generate_players_stadium\n");
#endif
gint i;
gfloat skill_factor = math_rnd(1 - const_float("float_team_skill_variance"),
1 + const_float("float_team_skill_variance"));
@ -142,6 +150,10 @@ team_generate_players_stadium(Team *tm, gfloat av_talent)
gboolean
query_team_is_in_cups(const Team *tm, gint group)
{
#ifdef DEBUG
printf("query_team_is_in_cups\n");
#endif
gint i, j;
if(group == -1)
@ -169,6 +181,10 @@ query_team_is_in_cups(const Team *tm, gint group)
gboolean
query_team_is_in_cup(const Team *tm, const Cup *cup)
{
#ifdef DEBUG
printf("query_team_is_in_cup\n");
#endif
gint i;
for(i=0;i<cup->team_names->len;i++)
@ -187,6 +203,10 @@ query_team_is_in_cup(const Team *tm, const Cup *cup)
GPtrArray*
team_get_pointers_from_array(const GArray *teams, GPtrArray *team_ptrs)
{
#ifdef DEBUG
printf("team_get_pointers_from_array\n");
#endif
gint i;
GPtrArray *team_pointers = g_ptr_array_new();
@ -208,7 +228,12 @@ team_get_pointers_from_array(const GArray *teams, GPtrArray *team_ptrs)
the id. */
Team*
team_of_id(gint id)
{
{
#ifdef DEBUG
printf("team_of_id\n");
#endif
gint i, j;
for(i=0;i<ligs->len;i++)
@ -233,6 +258,10 @@ team_of_id(gint id)
Fixture*
team_get_fixture(const Team *tm, gboolean last_fixture)
{
#ifdef DEBUG
printf("team_get_fixture\n");
#endif
gint i, j;
Fixture *fix = NULL;
@ -331,6 +360,10 @@ team_get_fixture(const Team *tm, gboolean last_fixture)
gint
team_is_user(const Team *tm)
{
#ifdef DEBUG
printf("team_is_user\n");
#endif
gint i;
for(i=0;i<users->len;i++)
@ -346,6 +379,10 @@ team_is_user(const Team *tm)
gint
team_name_is_user(const gchar *team_name)
{
#ifdef DEBUG
printf("team_name_is_user\n");
#endif
gint i;
for(i=0;i<users->len;i++)
@ -362,6 +399,10 @@ team_name_is_user(const gchar *team_name)
gfloat
team_get_average_skill(const Team *tm, gboolean cskill)
{
#ifdef DEBUG
printf("team_get_average_skill\n");
#endif
gint i, counter = 0;
gfloat sum = 0;
@ -389,6 +430,10 @@ team_get_average_skill(const Team *tm, gboolean cskill)
gfloat
team_get_average_talent(const Team *tm)
{
#ifdef DEBUG
printf("team_get_average_talent\n");
#endif
gint i;
gfloat sum = 0;
@ -403,6 +448,10 @@ team_get_average_talent(const Team *tm)
gint
team_get_league_rank(const Team *tm)
{
#ifdef DEBUG
printf("team_get_league_rank\n");
#endif
gint i, clid = team_get_table_clid(tm), rank = 0;
GArray *elements = NULL;
@ -437,6 +486,10 @@ team_get_league_rank(const Team *tm)
gint
team_get_cup_rank(const Team *tm, const CupRound *cupround, gboolean abort)
{
#ifdef DEBUG
printf("team_get_cup_rank\n");
#endif
gint i, j;
for(i=0;i<cupround->tables->len;i++)
@ -461,6 +514,10 @@ team_get_cup_rank(const Team *tm, const CupRound *cupround, gboolean abort)
gint
team_find_appropriate_structure(const Team *tm)
{
#ifdef DEBUG
printf("team_find_appropriate_structure\n");
#endif
gint i;
gint structure = 0;
@ -483,6 +540,10 @@ team_find_appropriate_structure(const Team *tm)
void
team_change_structure(Team *tm, gint new_structure)
{
#ifdef DEBUG
printf("team_change_structure\n");
#endif
gint i;
tm->structure = new_structure;
@ -504,6 +565,10 @@ team_change_structure(Team *tm, gint new_structure)
void
team_rearrange(Team *tm)
{
#ifdef DEBUG
printf("team_rearrange\n");
#endif
gint i;
g_array_sort_with_data(tm->players, (GCompareDataFunc)player_compare_func,
@ -526,6 +591,14 @@ team_rearrange(Team *tm)
gchar*
team_attribute_to_char(gint attribute, gint value)
{
#ifdef DEBUG
printf("team_attribute_to_char\n");
#endif
#ifdef DEBUG
printf("team_attribute_to_char\n");
#endif
switch(attribute)
{
default:
@ -573,6 +646,10 @@ team_attribute_to_char(gint attribute, gint value)
void
team_change_attribute_with_message(Team *tm, gint attribute, gint new_value)
{
#ifdef DEBUG
printf("team_change_attribute_with_message\n");
#endif
switch(attribute)
{
default:
@ -602,6 +679,10 @@ team_change_attribute_with_message(Team *tm, gint attribute, gint new_value)
void
team_update_cpu_new_players(Team *tm)
{
#ifdef DEBUG
printf("team_update_cpu_new_players\n");
#endif
gint i;
gint number_of_new = math_rndi(const_int("int_team_new_players_lower"),
const_int("int_team_new_players_upper"));
@ -621,6 +702,10 @@ team_update_cpu_new_players(Team *tm)
void
team_update_team_weekly(Team *tm)
{
#ifdef DEBUG
printf("team_update_team_weekly\n");
#endif
gint i;
for(i=tm->players->len - 1;i>=0;i--)
@ -637,6 +722,10 @@ team_update_team_weekly(Team *tm)
void
team_update_post_match(Team *tm, const Fixture *fix)
{
#ifdef DEBUG
printf("team_update_post_match\n");
#endif
gint i;
for(i=0;i<tm->players->len;i++)
@ -648,6 +737,10 @@ team_update_post_match(Team *tm, const Fixture *fix)
void
team_update_team_week_roundly(Team *tm)
{
#ifdef DEBUG
printf("team_update_team_week_roundly\n");
#endif
gint i;
for(i=0;i<tm->players->len;i++)
@ -662,6 +755,10 @@ team_update_team_week_roundly(Team *tm)
gint
team_get_table_value(const Team *tm, gint type)
{
#ifdef DEBUG
printf("team_get_table_value\n");
#endif
gint i;
const GArray *elements = NULL;
@ -688,6 +785,10 @@ team_get_table_value(const Team *tm, gint type)
gint
team_compare_func(gconstpointer a, gconstpointer b, gpointer data)
{
#ifdef DEBUG
printf("team_compare_func\n");
#endif
gint type = GPOINTER_TO_INT(data) % 100;
const Team *tm1 = (GPOINTER_TO_INT(data) < 100) ?
*(const Team**)a : (const Team*)a;
@ -759,7 +860,12 @@ team_compare_func(gconstpointer a, gconstpointer b, gpointer data)
@param cup Whether we return the international cup teams or league teams. */
GPtrArray*
team_get_sorted(GCompareDataFunc compare_function, gint type, gboolean cup)
{
{
#ifdef DEBUG
printf("team_get_sorted\n");
#endif
gint i, j;
GPtrArray *teams = g_ptr_array_new();
@ -786,6 +892,10 @@ team_get_sorted(GCompareDataFunc compare_function, gint type, gboolean cup)
Team*
team_get_new(const Team *tm, gboolean fire)
{
#ifdef DEBUG
printf("team_get_new\n");
#endif
gint i;
gint lower = 0, upper = 0;
gint bound1 = (fire) ? const_int("int_team_new_bound_upper") :
@ -828,6 +938,10 @@ team_get_new(const Team *tm, gboolean fire)
gint
team_get_index(const Team *tm)
{
#ifdef DEBUG
printf("team_get_index\n");
#endif
gint i;
gpointer *teams = league_cup_get_teams(tm->clid);
@ -854,6 +968,10 @@ team_get_index(const Team *tm)
gfloat
team_get_average_talents(const GArray *teams)
{
#ifdef DEBUG
printf("team_get_average_talents\n");
#endif
gint i, j, cnt = 0;
gfloat sum = 0;
@ -875,6 +993,10 @@ team_get_average_talents(const GArray *teams)
gboolean
query_team_plays(const Team *tm, gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("query_team_plays\n");
#endif
gint i, j;
if(tm->clid < ID_CUP_START)
@ -907,6 +1029,10 @@ query_team_plays(const Team *tm, gint week_number, gint week_round_number)
void
team_write_own_results(const Team *tm, gchar *buf, gboolean sort, gboolean cup_matches)
{
#ifdef DEBUG
printf("team_write_own_results\n");
#endif
gint i, res[2];
gchar buf2[SMALL], buf3[SMALL], buf4[SMALL], neutral[SMALL];
gint place;
@ -990,6 +1116,10 @@ team_write_own_results(const Team *tm, gchar *buf, gboolean sort, gboolean cup_m
void
team_write_results(const Team *tm, gchar *result_buf, gchar *goals_buf)
{
#ifdef DEBUG
printf("team_write_results\n");
#endif
gint i;
GPtrArray *latest_fixtures = fixture_get_latest(tm);
gint res[2], goals[2] = {0, 0};
@ -1029,6 +1159,10 @@ team_write_results(const Team *tm, gchar *result_buf, gchar *goals_buf)
gboolean
query_team_is_in_teams_array(const Team *tm, const GPtrArray *teams)
{
#ifdef DEBUG
printf("query_team_is_in_teams_array\n");
#endif
gint i;
for(i=0;i<teams->len;i++)
@ -1043,6 +1177,14 @@ query_team_is_in_teams_array(const Team *tm, const GPtrArray *teams)
gchar*
team_has_def_file(const Team *tm)
{
#ifdef DEBUG
printf("team_has_def_file\n");
#endif
#ifdef DEBUG
printf("team_has_def_file\n");
#endif
gchar *return_value = NULL;
gchar buf[SMALL];
@ -1060,6 +1202,10 @@ team_has_def_file(const Team *tm)
void
team_complete_def(Team *tm)
{
#ifdef DEBUG
printf("team_complete_def\n");
#endif
gint i, new_pos, pos_sum;
gint positions[4] = {0, 0, 0, 0};
Player new_player;
@ -1108,6 +1254,10 @@ team_complete_def(Team *tm)
void
team_complete_def_sort(Team *tm)
{
#ifdef DEBUG
printf("team_complete_def_sort\n");
#endif
gint i, j;
gint positions[4] = {0, 0, 0, 0};
gint structure[4] = {1,
@ -1197,6 +1347,10 @@ team_complete_def_sort(Team *tm)
gint
team_get_table_clid(const Team *tm)
{
#ifdef DEBUG
printf("team_get_table_clid\n");
#endif
gint i;
if(tm->clid >= ID_CUP_START ||

View File

@ -36,6 +36,10 @@ calculateTrainingCamp(Team *current_team,
gdouble value_recreation,
gint number_camp)
{
#ifdef DEBUG
printf("calculateTrainingCamp\n");
#endif
gint count, i;
Player *player;
gfloat skill_points=0.0;
@ -112,6 +116,10 @@ calculate_skill_points(gint value_training,
gfloat fitness,
gfloat lsu)
{
#ifdef DEBUG
printf("calculate_skill_points\n");
#endif
gint training_points=0;
gfloat skill_points=0.0;
gint random=0;
@ -165,6 +173,10 @@ calculate_fitness_points(gint value_training,
gint number_camp,
gfloat age)
{
#ifdef DEBUG
printf("calculate_fitness_points\n");
#endif
gint training_points=0;
gfloat fitness_points=0.0;
gint random=0;
@ -224,6 +236,10 @@ calculate_recovery_points(gint value_recreation,
gint number_camp,
gfloat age)
{
#ifdef DEBUG
printf("calculate_recovery_points\n");
#endif
gint training_points=0;
gint recovery_points=0;
gint random=0;
@ -260,6 +276,10 @@ calculate_recovery_points(gint value_recreation,
gint
random_int(gint min, gint max)
{
#ifdef DEBUG
printf("random_int\n");
#endif
gint random=0;
GRand *grand = NULL;
@ -271,6 +291,10 @@ random_int(gint min, gint max)
void
calculateCostsTrainingCamp(gint number_camp)
{
#ifdef DEBUG
printf("calculateCostsTrainingCamp\n");
#endif
gint *money_out = current_user.money_out[0];
gint *money = &current_user.money;
gfloat factor = finance_wage_unit(current_user.tm);

View File

@ -22,7 +22,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@ -49,6 +48,10 @@ void
on_b_cancel_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_b_cancel_clicked\n");
#endif
window_destroy(&window.training_camp);
}
@ -56,6 +59,10 @@ void
on_b_ok_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_b_ok_clicked\n");
#endif
GtkWidget *rb_camp1;
GtkWidget *rb_camp2;
GtkHScale *hs_recreation;
@ -119,6 +126,10 @@ void
on_rb_camp3_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_rb_camp3_clicked\n");
#endif
GtkEntry *tfCosts;
gchar buf[SMALL];
@ -134,6 +145,10 @@ void
on_rb_camp2_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_rb_camp2_clicked\n");
#endif
GtkEntry *tfCosts;
gchar buf[SMALL];
@ -149,6 +164,10 @@ void
on_rb_camp1_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_rb_camp1_clicked\n");
#endif
GtkEntry *tfCosts;
gchar buf[SMALL];
@ -163,6 +182,10 @@ void
on_b_dec_recreation_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_b_dec_recreation_clicked\n");
#endif
GtkHScale *hs_camp_points;
GtkHScale *hs_recreation;
gdouble value_camp_points;
@ -187,6 +210,10 @@ void
on_b_inc_recreation_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_b_inc_recreation_clicked\n");
#endif
GtkHScale *hs_camp_points;
GtkHScale *hs_recreation;
gdouble value_camp_points;
@ -211,6 +238,10 @@ void
on_b_dec_training_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_b_dec_training_clicked\n");
#endif
GtkHScale *hs_camp_points;
GtkHScale *hs_training;
gdouble value_camp_points;
@ -235,6 +266,10 @@ void
on_b_inc_training_clicked (GtkButton *button,
gpointer user_data)
{
#ifdef DEBUG
printf("on_b_inc_training_clicked\n");
#endif
GtkHScale *hs_camp_points;
GtkHScale *hs_training;
gdouble value_camp_points;
@ -260,6 +295,10 @@ on_window_training_camp_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
#ifdef DEBUG
printf("on_window_training_camp_delete_event\n");
#endif
on_b_cancel_clicked(NULL, NULL);
return TRUE;

View File

@ -1,7 +1,6 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -44,6 +44,10 @@
void
transfer_update(void)
{
#ifdef DEBUG
printf("transfer_update\n");
#endif
gint i, j;
if((week > transfer_get_deadline() ||
@ -94,6 +98,10 @@ transfer_update(void)
void
transfer_add_cpu_offers(void)
{
#ifdef DEBUG
printf("transfer_add_cpu_offers\n");
#endif
gint i;
gfloat scout_factor_bounds[4][2] =
{{const_float("float_transfer_offer_fee_best_lower"),
@ -127,6 +135,10 @@ transfer_add_cpu_offers(void)
Team*
transfer_team_get_new(void)
{
#ifdef DEBUG
printf("transfer_team_get_new\n");
#endif
gint rndom;
GPtrArray *league_teams = team_get_sorted(team_compare_func,
TEAM_COMPARE_UNSORTED, FALSE),
@ -150,6 +162,10 @@ transfer_team_get_new(void)
gint
transfer_offer_compare_func(gconstpointer a, gconstpointer b)
{
#ifdef DEBUG
printf("transfer_offer_compare_func\n");
#endif
const TransferOffer *tr1 = (const TransferOffer*)a,
*tr2 = (const TransferOffer*)b;
gint return_value;
@ -174,6 +190,10 @@ transfer_offer_compare_func(gconstpointer a, gconstpointer b)
void
transfer_offers_notify(Transfer *tr, gboolean sort)
{
#ifdef DEBUG
printf("transfer_offers_notify\n");
#endif
TransferOffer *off = NULL;
if(sort)
@ -200,6 +220,10 @@ transfer_offers_notify(Transfer *tr, gboolean sort)
void
transfer_evaluate_offers(void)
{
#ifdef DEBUG
printf("transfer_evaluate_offers\n");
#endif
gint i, j;
gboolean notify;
@ -277,6 +301,10 @@ transfer_evaluate_offers(void)
void
transfer_add_new_players(void)
{
#ifdef DEBUG
printf("transfer_add_new_players\n");
#endif
gint i;
gint number_of_new = math_rndi(const_int("int_transfer_new_players_lower"),
const_int("int_transfer_new_players_upper"));
@ -296,6 +324,10 @@ transfer_add_new_players(void)
Player*
transfer_player_get_new(gboolean cup)
{
#ifdef DEBUG
printf("transfer_player_get_new\n");
#endif
GPtrArray *teams = team_get_sorted(team_compare_func, TEAM_COMPARE_UNSORTED, cup);
Player *pl = NULL;
Team *tm = NULL;
@ -320,6 +352,10 @@ transfer_player_get_new(gboolean cup)
void
transfer_add_player(Player *pl, gint time)
{
#ifdef DEBUG
printf("transfer_add_player\n");
#endif
gint i;
Transfer new;
gfloat deviance_value, deviance_wage;
@ -350,6 +386,10 @@ transfer_add_player(Player *pl, gint time)
gint
transfer_get_deadline(void)
{
#ifdef DEBUG
printf("transfer_get_deadline\n");
#endif
gint i;
gint length = 0;
@ -372,6 +412,10 @@ transfer_get_deadline(void)
void
transfer_remove_player(gint idx)
{
#ifdef DEBUG
printf("transfer_remove_player\n");
#endif
free_g_array(&trans(idx).offers);
g_array_remove_index(transfer_list, idx);
}
@ -380,6 +424,10 @@ transfer_remove_player(gint idx)
void
transfer_remove_player_ptr(const Player *pl)
{
#ifdef DEBUG
printf("transfer_remove_player_ptr\n");
#endif
gint i;
for(i=0;i<transfer_list->len;i++)
@ -394,6 +442,10 @@ transfer_remove_player_ptr(const Player *pl)
gboolean
query_transfer_player_is_on_list(const Player *pl)
{
#ifdef DEBUG
printf("query_transfer_player_is_on_list\n");
#endif
gint i;
for(i=0;i<transfer_list->len;i++)
@ -409,6 +461,10 @@ query_transfer_player_is_on_list(const Player *pl)
gboolean
query_transfer_current_team_offer(const Player *pl)
{
#ifdef DEBUG
printf("query_transfer_current_team_offer\n");
#endif
gint i, j;
for(i=0;i<transfer_list->len;i++)
@ -445,6 +501,10 @@ transfer_player_has_offer(const Player *pl)
gboolean
transfer_add_offer(gint idx, Team *tm, gint fee, gint wage)
{
#ifdef DEBUG
printf("transfer_add_offer\n");
#endif
gint i;
TransferOffer new;
@ -471,6 +531,10 @@ transfer_add_offer(gint idx, Team *tm, gint fee, gint wage)
gboolean
transfer_remove_offer(gint idx, const Team *tm)
{
#ifdef DEBUG
printf("transfer_remove_offer\n");
#endif
gint i;
for(i=0;i<trans(idx).offers->len;i++)
@ -487,6 +551,10 @@ transfer_remove_offer(gint idx, const Team *tm)
void
transfer_add_remove_user_player(Player *pl)
{
#ifdef DEBUG
printf("transfer_add_remove_user_player\n");
#endif
if(!query_transfer_player_is_on_list(pl))
{
if(week < transfer_get_deadline())
@ -519,6 +587,10 @@ transfer_add_remove_user_player(Player *pl)
gboolean
transfer_offers_pending(void)
{
#ifdef DEBUG
printf("transfer_offers_pending\n");
#endif
gint i;
for(i=0;i<transfer_list->len;i++)
@ -539,6 +611,10 @@ transfer_offers_pending(void)
void
transfer_get_previous_offer(const Transfer *tr, const Team *tm, gint *fee, gint *wage)
{
#ifdef DEBUG
printf("transfer_get_previous_offer\n");
#endif
gint i;
for(i=0;i<tr->offers->len;i++)
@ -554,6 +630,10 @@ transfer_get_previous_offer(const Transfer *tr, const Team *tm, gint *fee, gint
gboolean
transfer_new_star_balks(const Transfer *tr, const TransferOffer *troff)
{
#ifdef DEBUG
printf("transfer_new_star_balks\n");
#endif
gint i;
gint number_of_stars;

View File

@ -57,6 +57,10 @@
GtkTreeModel*
treeview_create_team_selection_list(gboolean show_cup_teams, gboolean show_user_teams)
{
#ifdef DEBUG
printf("treeview_create_team_selection_list\n");
#endif
gint i, j, cnt = 1;
GtkListStore *ls;
GtkTreeIter iter;
@ -118,6 +122,10 @@ treeview_create_team_selection_list(gboolean show_cup_teams, gboolean show_user_
void
treeview_set_up_team_selection_treeview(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_set_up_team_selection_treeview\n");
#endif
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -191,6 +199,10 @@ void
treeview_show_team_list(GtkTreeView *treeview, gboolean show_cup_teams,
gboolean show_user_teams)
{
#ifdef DEBUG
printf("treeview_show_team_list\n");
#endif
GtkTreeModel *team_list =
treeview_create_team_selection_list(show_cup_teams, show_user_teams);
GtkTreeSelection *selection;
@ -218,6 +230,10 @@ GtkTreeModel*
treeview_create_player_list(GPtrArray *players, gint *attributes, gint max,
gboolean show_separator, gboolean sortable, gboolean status)
{
#ifdef DEBUG
printf("treeview_create_player_list\n");
#endif
gint i, j;
GtkListStore *ls;
GtkTreeIter iter;
@ -276,6 +292,10 @@ void
treeview_set_up_player_list(GtkTreeView *treeview, gint *attributes, gint max,
gboolean show_separator, gboolean sortable)
{
#ifdef DEBUG
printf("treeview_set_up_player_list\n");
#endif
gint i, cnt = 1;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -390,6 +410,10 @@ treeview_show_player_list(GtkTreeView *treeview, GPtrArray *players,
PlayerListAttribute attribute,
gboolean show_separator)
{
#ifdef DEBUG
printf("treeview_show_player_list\n");
#endif
gint i, cnt = 0;
gint columns = math_sum_int_array(attribute.on_off, PLAYER_LIST_ATTRIBUTE_END);
gint attributes[columns];
@ -422,6 +446,10 @@ treeview_show_player_list(GtkTreeView *treeview, GPtrArray *players,
void
treeview_show_user_player_list(void)
{
#ifdef DEBUG
printf("treeview_show_user_player_list\n");
#endif
gint i;
GPtrArray *players = NULL;
PlayerListAttribute attribute;
@ -442,6 +470,10 @@ treeview_show_user_player_list(void)
void
treeview_show_player_list_team(GtkTreeView *treeview, const Team *tm, gint scout)
{
#ifdef DEBUG
printf("treeview_show_player_list_team\n");
#endif
GPtrArray *players = player_get_pointers_from_array(tm->players);
treeview_show_player_list(treeview, players,
@ -453,6 +485,10 @@ treeview_show_player_list_team(GtkTreeView *treeview, const Team *tm, gint scout
void
treeview_live_game_show_commentary(const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("treeview_live_game_show_commentary\n");
#endif
GtkTreeView *treeview =
GTK_TREE_VIEW(lookup_widget(window.live, "treeview_commentary"));
GtkListStore *ls =
@ -497,6 +533,10 @@ treeview_live_game_show_commentary(const LiveGameUnit *unit)
GtkTreeModel*
treeview_live_game_create_init_commentary(const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("treeview_live_game_create_init_commentary\n");
#endif
GtkListStore *ls;
GtkTreeIter iter;
gchar buf[SMALL];
@ -519,6 +559,10 @@ treeview_live_game_create_init_commentary(const LiveGameUnit *unit)
void
treeview_live_game_set_up_commentary(void)
{
#ifdef DEBUG
printf("treeview_live_game_set_up_commentary\n");
#endif
GtkTreeView *treeview =
GTK_TREE_VIEW(lookup_widget(window.live, "treeview_commentary"));
GtkTreeViewColumn *col;
@ -555,6 +599,10 @@ treeview_live_game_set_up_commentary(void)
void
treeview_live_game_show_initial_commentary(const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("treeview_live_game_show_initial_commentary\n");
#endif
GtkTreeView *treeview =
GTK_TREE_VIEW(lookup_widget(window.live, "treeview_commentary"));
GtkTreeModel *model = NULL;
@ -575,6 +623,10 @@ treeview_live_game_show_initial_commentary(const LiveGameUnit *unit)
GtkTreeModel*
treeview_live_game_create_result(const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("treeview_live_game_create_result\n");
#endif
GtkListStore *ls;
GtkTreeIter iter;
gchar buf[SMALL];
@ -598,6 +650,10 @@ treeview_live_game_create_result(const LiveGameUnit *unit)
void
treeview_live_game_set_up_result(void)
{
#ifdef DEBUG
printf("treeview_live_game_set_up_result\n");
#endif
gint i;
GtkTreeView *treeview =
GTK_TREE_VIEW(lookup_widget(window.live, "treeview_result"));
@ -626,6 +682,10 @@ treeview_live_game_set_up_result(void)
void
treeview_live_game_show_result(const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("treeview_live_game_show_result\n");
#endif
GtkTreeView *treeview =
GTK_TREE_VIEW(lookup_widget(window.live, "treeview_result"));
GtkTreeModel *model = NULL;
@ -644,6 +704,10 @@ treeview_live_game_show_result(const LiveGameUnit *unit)
GtkTreeModel*
treeview_create_users(void)
{
#ifdef DEBUG
printf("treeview_create_users\n");
#endif
gint i;
GtkListStore *ls;
GtkTreeIter iter;
@ -683,6 +747,10 @@ treeview_create_users(void)
void
treeview_set_up_users(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_set_up_users\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -714,6 +782,10 @@ treeview_set_up_users(GtkTreeView *treeview)
void
treeview_show_users(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_show_users\n");
#endif
GtkTreeModel *model = NULL;
treeview_helper_clear(treeview);
@ -729,6 +801,10 @@ treeview_show_users(GtkTreeView *treeview)
GtkTreeModel*
treeview_create_game_stats(LiveGame *live_game)
{
#ifdef DEBUG
printf("treeview_create_game_stats\n");
#endif
gint i, j, k;
LiveGameStats *stats = &live_game->stats;
GtkListStore *ls;
@ -855,6 +931,10 @@ treeview_create_game_stats(LiveGame *live_game)
void
treeview_set_up_game_stats(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_set_up_game_stats\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -883,6 +963,10 @@ treeview_set_up_game_stats(GtkTreeView *treeview)
void
treeview_show_game_stats(GtkTreeView *treeview, LiveGame *live_game)
{
#ifdef DEBUG
printf("treeview_show_game_stats\n");
#endif
GtkTreeModel *model = NULL;
treeview_helper_clear(treeview);
@ -901,6 +985,10 @@ treeview_show_game_stats(GtkTreeView *treeview, LiveGame *live_game)
void
treeview_create_fixtures_header(const Fixture *fix, GtkListStore *ls, gboolean blank_line)
{
#ifdef DEBUG
printf("treeview_create_fixtures_header\n");
#endif
GtkTreeIter iter;
gchar buf[SMALL], buf2[SMALL], buf3[SMALL],
round_name[SMALL];
@ -948,6 +1036,10 @@ treeview_create_fixtures_header(const Fixture *fix, GtkListStore *ls, gboolean b
void
treeview_create_fixture(const Fixture *fix, GtkListStore *ls)
{
#ifdef DEBUG
printf("treeview_create_fixture\n");
#endif
gint i, rank;
GtkTreeIter iter;
gchar *symbol[2] = {NULL, NULL};
@ -1005,6 +1097,10 @@ treeview_create_fixture(const Fixture *fix, GtkListStore *ls)
GtkTreeModel*
treeview_create_fixtures(gint clid, gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("treeview_create_fixtures\n");
#endif
gint i;
GtkListStore *ls;
GPtrArray *fixtures = fixture_get_week_list_clid(clid, week_number, week_round_number);
@ -1036,6 +1132,10 @@ treeview_create_fixtures(gint clid, gint week_number, gint week_round_number)
void
treeview_set_up_fixtures(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_set_up_fixtures\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -1086,6 +1186,10 @@ void
treeview_show_fixtures(GtkTreeView *treeview, gint clid,
gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("treeview_show_fixtures\n");
#endif
GtkTreeModel *model = NULL;
treeview_helper_clear(treeview);
@ -1102,6 +1206,10 @@ treeview_show_fixtures(GtkTreeView *treeview, gint clid,
void
treeview_table_write_header(GtkListStore *ls, const Table *table, gint table_index)
{
#ifdef DEBUG
printf("treeview_table_write_header\n");
#endif
gint i;
gchar buf[SMALL];
gchar *symbol = NULL;
@ -1137,6 +1245,10 @@ treeview_table_write_header(GtkListStore *ls, const Table *table, gint table_ind
void
treeview_create_single_table(GtkListStore *ls, const Table *table, gint table_index)
{
#ifdef DEBUG
printf("treeview_create_single_table\n");
#endif
gint i, j;
GtkTreeIter iter;
TableElement *elem = NULL;
@ -1199,6 +1311,10 @@ treeview_create_single_table(GtkListStore *ls, const Table *table, gint table_in
GtkTreeModel*
treeview_create_table(gint clid)
{
#ifdef DEBUG
printf("treeview_create_table\n");
#endif
gint i;
GArray *tables;
GtkListStore *ls =
@ -1235,6 +1351,10 @@ treeview_create_table(gint clid)
void
treeview_set_up_table(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_set_up_table\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -1304,6 +1424,10 @@ treeview_set_up_table(GtkTreeView *treeview)
void
treeview_show_table(GtkTreeView *treeview, gint clid)
{
#ifdef DEBUG
printf("treeview_show_table\n");
#endif
GtkTreeModel *model = NULL;
treeview_helper_clear(treeview);
@ -1318,6 +1442,10 @@ treeview_show_table(GtkTreeView *treeview, gint clid)
void
treeview_create_stadium_summary(GtkListStore *ls)
{
#ifdef DEBUG
printf("treeview_create_stadium_summary\n");
#endif
gchar buf[SMALL];
GtkTreeIter iter;
@ -1355,6 +1483,10 @@ treeview_create_stadium_summary(GtkListStore *ls)
GtkTreeModel*
treeview_create_finances(const User* user)
{
#ifdef DEBUG
printf("treeview_create_finances\n");
#endif
gint i, balance = 0;
gchar buf[SMALL], buf2[SMALL], buf3[SMALL];
gint *in = user->money_in[0],
@ -1537,6 +1669,10 @@ treeview_create_finances(const User* user)
void
treeview_set_up_finances(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_set_up_finances\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -1569,6 +1705,10 @@ treeview_set_up_finances(GtkTreeView *treeview)
void
treeview_show_finances(GtkTreeView *treeview, const User* user)
{
#ifdef DEBUG
printf("treeview_show_finances\n");
#endif
GtkTreeModel *model = NULL;
treeview_helper_clear(treeview);
@ -1583,6 +1723,10 @@ treeview_show_finances(GtkTreeView *treeview, const User* user)
void
treeview_show_transfer_list(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_show_transfer_list\n");
#endif
gint i;
GPtrArray *players = g_ptr_array_new();
@ -1597,6 +1741,10 @@ treeview_show_transfer_list(GtkTreeView *treeview)
void
treeview_create_next_opponent_values(GtkListStore *ls, const Fixture *fix)
{
#ifdef DEBUG
printf("treeview_create_next_opponent_values\n");
#endif
gint i, j;
gchar buf[SMALL], buf2[SMALL];
gfloat max_values[4],
@ -1633,6 +1781,10 @@ treeview_create_next_opponent_values(GtkListStore *ls, const Fixture *fix)
GtkTreeModel*
treeview_create_next_opponent(void)
{
#ifdef DEBUG
printf("treeview_create_next_opponent\n");
#endif
gchar buf[SMALL], buf2[SMALL];
const Fixture *fix = team_get_fixture(current_user.tm, FALSE);
const Team *opp = (fix == NULL) ? NULL :
@ -1735,6 +1887,10 @@ treeview_create_next_opponent(void)
void
treeview_set_up_next_opponent(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_set_up_next_opponent\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -1759,6 +1915,10 @@ treeview_set_up_next_opponent(GtkTreeView *treeview)
void
treeview_show_next_opponent(void)
{
#ifdef DEBUG
printf("treeview_show_next_opponent\n");
#endif
GtkTreeView *treeview =
GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right"));
GtkTreeModel *model = NULL;
@ -1775,6 +1935,10 @@ treeview_show_next_opponent(void)
GtkTreeModel*
treeview_create_league_results(void)
{
#ifdef DEBUG
printf("treeview_create_league_results\n");
#endif
gint i;
gchar name[SMALL], results[SMALL];
GArray *table_elements =
@ -1808,6 +1972,10 @@ treeview_create_league_results(void)
void
treeview_set_up_league_results(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_set_up_league_results\n");
#endif
gint i;
gchar *titles[2] =
{_("Team"),
@ -1837,6 +2005,10 @@ treeview_set_up_league_results(GtkTreeView *treeview)
void
treeview_show_league_results(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_show_league_results\n");
#endif
GtkTreeModel *model = NULL;
treeview_helper_clear(treeview);
@ -1851,6 +2023,10 @@ treeview_show_league_results(GtkTreeView *treeview)
void
treeview_show_all_players(gint clid)
{
#ifdef DEBUG
printf("treeview_show_all_players\n");
#endif
gint i, j;
GPtrArray *players = g_ptr_array_new();
const GArray *teams = NULL;
@ -1883,6 +2059,10 @@ treeview_show_all_players(gint clid)
GtkTreeModel*
treeview_create_preview(void)
{
#ifdef DEBUG
printf("treeview_create_preview\n");
#endif
gint i;
GtkListStore *ls;
GPtrArray *fixtures = fixture_get_coming(current_user.tm);
@ -1921,6 +2101,10 @@ treeview_create_preview(void)
void
treeview_show_preview(void)
{
#ifdef DEBUG
printf("treeview_show_preview\n");
#endif
GtkTreeView *treeview = GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right"));
GtkTreeModel *model = NULL;
@ -1935,6 +2119,10 @@ treeview_show_preview(void)
GtkTreeModel*
treeview_create_player_info(const Player *pl)
{
#ifdef DEBUG
printf("treeview_create_player_info\n");
#endif
gint i;
GtkListStore *ls = gtk_list_store_new(2,
G_TYPE_STRING,
@ -1975,6 +2163,10 @@ treeview_create_player_info(const Player *pl)
void
treeview_set_up_player_info(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_set_up_player_info\n");
#endif
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -2003,6 +2195,10 @@ treeview_set_up_player_info(GtkTreeView *treeview)
void
treeview_show_player_info(const Player *pl)
{
#ifdef DEBUG
printf("treeview_show_player_info\n");
#endif
GtkTreeView *treeview = GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right"));
GtkTreeModel *model = NULL;
@ -2018,6 +2214,10 @@ treeview_show_player_info(const Player *pl)
GtkTreeModel*
treeview_create_fixtures_week(gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("treeview_create_fixtures_week\n");
#endif
gint i;
GPtrArray *fixtures = fixture_get_week_list(week_number, week_round_number);
GtkListStore *ls = gtk_list_store_new(5,
@ -2057,6 +2257,10 @@ treeview_create_fixtures_week(gint week_number, gint week_round_number)
void
treeview_show_fixtures_week(gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("treeview_show_fixtures_week\n");
#endif
GtkTreeView *treeview = GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right"));
GtkTreeModel *model = NULL;
@ -2071,6 +2275,10 @@ treeview_show_fixtures_week(gint week_number, gint week_round_number)
GtkTreeModel*
treeview_create_user_history(void)
{
#ifdef DEBUG
printf("treeview_create_user_history\n");
#endif
gint i;
gchar buf[SMALL];
GtkListStore *ls =
@ -2099,6 +2307,10 @@ treeview_create_user_history(void)
void
treeview_set_up_user_history(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_set_up_user_history\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -2145,6 +2357,10 @@ treeview_set_up_user_history(GtkTreeView *treeview)
void
treeview_show_user_history(void)
{
#ifdef DEBUG
printf("treeview_show_user_history\n");
#endif
GtkTreeView *treeview = GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right"));
GtkTreeModel *model = NULL;
@ -2159,6 +2375,10 @@ treeview_show_user_history(void)
void
treeview_create_league_stats(GtkListStore *ls, const LeagueStat *league_stat)
{
#ifdef DEBUG
printf("treeview_create_league_stats\n");
#endif
gint i, j;
gchar buf[SMALL], buf2[SMALL], buf3[SMALL], buf4[SMALL];
GtkTreeIter iter;
@ -2263,6 +2483,10 @@ treeview_create_league_stats(GtkListStore *ls, const LeagueStat *league_stat)
void
treeview_set_up_league_stats(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_set_up_league_stats\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -2304,6 +2528,10 @@ treeview_set_up_league_stats(GtkTreeView *treeview)
void
treeview_show_league_stats(gint clid)
{
#ifdef DEBUG
printf("treeview_show_league_stats\n");
#endif
GtkTreeView *treeview = GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right"));
GtkListStore *model =
gtk_list_store_new(6, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING,
@ -2321,6 +2549,10 @@ void
treeview_create_season_history_champions(GtkListStore *ls, const GArray* league_champs,
const GArray *cup_champs)
{
#ifdef DEBUG
printf("treeview_create_season_history_champions\n");
#endif
gint i, j;
GtkTreeIter iter;
const GArray *champs[2] = {league_champs, cup_champs};
@ -2359,6 +2591,10 @@ treeview_create_season_history_champions(GtkListStore *ls, const GArray* league_
void
treeview_show_season_history(gint page, gint idx)
{
#ifdef DEBUG
printf("treeview_show_season_history\n");
#endif
gchar buf[SMALL];
GtkTreeView *treeview = GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right"));
GtkListStore *model =
@ -2393,6 +2629,10 @@ treeview_show_season_history(gint page, gint idx)
GtkTreeModel*
treeview_create_country_list(const GPtrArray *country_list)
{
#ifdef DEBUG
printf("treeview_create_country_list\n");
#endif
gint i;
GtkListStore *ls = gtk_list_store_new(2, GDK_TYPE_PIXBUF, G_TYPE_STRING);
GtkTreeIter iter;
@ -2417,6 +2657,10 @@ treeview_create_country_list(const GPtrArray *country_list)
void
treeview_show_contributors(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_show_contributors\n");
#endif
gchar *help_file = file_find_support_file("bygfoot_help", TRUE);
OptionList help_list;
GtkListStore *ls = gtk_list_store_new(1, G_TYPE_STRING);
@ -2480,6 +2724,10 @@ treeview_show_contributors(GtkTreeView *treeview)
GtkTreeModel*
treeview_create_league_list(void)
{
#ifdef DEBUG
printf("treeview_create_league_list\n");
#endif
gint i;
GtkListStore *ls = gtk_list_store_new(1, G_TYPE_STRING);
GtkTreeIter iter;
@ -2501,6 +2749,10 @@ treeview_create_league_list(void)
void
treeview_show_leagues_combo(void)
{
#ifdef DEBUG
printf("treeview_show_leagues_combo\n");
#endif
GtkTreeModel *model = treeview_create_league_list();
GtkComboBox *combo_leagues =
GTK_COMBO_BOX(lookup_widget(window.startup, "combobox_start_league"));
@ -2521,6 +2773,10 @@ treeview_show_leagues_combo(void)
GtkTreeModel*
treeview_create_language_list(void)
{
#ifdef DEBUG
printf("treeview_create_language_list\n");
#endif
gint i;
GtkListStore *ls = gtk_list_store_new(2, GDK_TYPE_PIXBUF, G_TYPE_STRING);
GtkTreeIter iter;
@ -2551,6 +2807,10 @@ treeview_create_language_list(void)
void
treeview_show_language_combo(void)
{
#ifdef DEBUG
printf("treeview_show_language_combo\n");
#endif
GtkTreeModel *model = treeview_create_language_list();
GtkComboBox *combo_languages =
GTK_COMBO_BOX(lookup_widget(window.options, "combobox_languages"));
@ -2576,6 +2836,10 @@ treeview_show_language_combo(void)
GtkTreeModel*
treeview_create_training_hotel_list(void)
{
#ifdef DEBUG
printf("treeview_create_training_hotel_list\n");
#endif
GtkListStore *ls = gtk_list_store_new(1, G_TYPE_STRING);
GtkTreeIter iter;
@ -2595,6 +2859,10 @@ treeview_create_training_hotel_list(void)
void
treeview_show_training_hotels_combo(void)
{
#ifdef DEBUG
printf("treeview_show_training_hotels_combo\n");
#endif
GtkTreeModel *model = treeview_create_training_hotel_list();
GtkComboBox *combo_hotel =
GTK_COMBO_BOX(lookup_widget(window.options, "combobox_hotel"));
@ -2616,6 +2884,10 @@ treeview_show_training_hotels_combo(void)
GtkTreeModel*
treeview_create_sponsors(const GArray *sponsors)
{
#ifdef DEBUG
printf("treeview_create_sponsors\n");
#endif
gint i;
GtkListStore *ls = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_INT,
G_TYPE_INT);
@ -2641,6 +2913,10 @@ treeview_create_sponsors(const GArray *sponsors)
void
treeview_set_up_sponsors(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_set_up_sponsors\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -2676,6 +2952,10 @@ treeview_set_up_sponsors(GtkTreeView *treeview)
void
treeview_show_sponsors(const GArray *sponsors)
{
#ifdef DEBUG
printf("treeview_show_sponsors\n");
#endif
GtkTreeView *treeview = GTK_TREE_VIEW(lookup_widget(window.sponsors,
"treeview_sponsors"));
GtkTreeModel *model = treeview_create_sponsors(sponsors);

View File

@ -39,6 +39,10 @@
void
treeview2_create_mmatches(GtkListStore *ls)
{
#ifdef DEBUG
printf("treeview2_create_mmatches\n");
#endif
gint i;
GtkTreeIter iter;
gchar result[SMALL];
@ -75,6 +79,10 @@ treeview2_create_mmatches(GtkListStore *ls)
void
treeview2_set_up_mmatches(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview2_set_up_mmatches\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -137,6 +145,10 @@ treeview2_set_up_mmatches(GtkTreeView *treeview)
void
treeview2_show_mmatches(void)
{
#ifdef DEBUG
printf("treeview2_show_mmatches\n");
#endif
GtkTreeView *treeview =
GTK_TREE_VIEW(lookup_widget(window.mmatches, "treeview_mmatches"));
GtkListStore *model =
@ -156,6 +168,10 @@ treeview2_show_mmatches(void)
void
treeview2_create_season_results(GtkListStore *ls)
{
#ifdef DEBUG
printf("treeview2_create_season_results\n");
#endif
gint i;
GtkTreeIter iter;
GPtrArray *results = fixture_get_season_results();
@ -180,6 +196,10 @@ treeview2_create_season_results(GtkListStore *ls)
void
treeview2_set_up_season_results(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview2_set_up_season_results\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -235,6 +255,10 @@ treeview2_set_up_season_results(GtkTreeView *treeview)
void
treeview2_show_season_results(void)
{
#ifdef DEBUG
printf("treeview2_show_season_results\n");
#endif
GtkTreeView *treeview =
GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right"));
GtkListStore *model =
@ -253,6 +277,10 @@ treeview2_show_season_results(void)
void
treeview2_create_bets(GtkListStore *ls)
{
#ifdef DEBUG
printf("treeview2_create_bets\n");
#endif
gint i, j, k, rank;
GtkTreeIter iter;
gchar buf[SMALL], buf2[SMALL],
@ -354,6 +382,10 @@ treeview2_create_bets(GtkListStore *ls)
void
treeview2_set_up_bets(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview2_set_up_bets\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -418,6 +450,10 @@ treeview2_set_up_bets(GtkTreeView *treeview)
void
treeview2_show_bets(void)
{
#ifdef DEBUG
printf("treeview2_show_bets\n");
#endif
GtkTreeView *treeview =
GTK_TREE_VIEW(lookup_widget(window.bets, "treeview_bets"));
GtkListStore *model =
@ -436,6 +472,10 @@ treeview2_show_bets(void)
void
treeview2_create_job_exchange(GtkListStore *ls)
{
#ifdef DEBUG
printf("treeview2_create_job_exchange\n");
#endif
gint i;
GtkTreeIter iter;
gchar buf[SMALL];
@ -461,6 +501,10 @@ treeview2_create_job_exchange(GtkListStore *ls)
void
treeview2_set_up_job_exchange(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview2_set_up_job_exchange\n");
#endif
gint i;
GtkTreeViewColumn *col;
GtkCellRenderer *renderer;
@ -517,6 +561,10 @@ treeview2_set_up_job_exchange(GtkTreeView *treeview)
void
treeview2_show_job_exchange(void)
{
#ifdef DEBUG
printf("treeview2_show_job_exchange\n");
#endif
GtkTreeView *treeview =
GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right"));
GtkListStore *model =

View File

@ -46,6 +46,10 @@
gboolean
treeview_helper_select_row(GtkTreeView *treeview, GdkEventButton *event)
{
#ifdef DEBUG
printf("treeview_helper_select_row\n");
#endif
GtkTreeSelection *selection =
gtk_tree_view_get_selection(treeview);
GtkTreePath *path;
@ -70,6 +74,10 @@ treeview_helper_select_row(GtkTreeView *treeview, GdkEventButton *event)
gint
treeview_helper_get_index(GtkTreeView *treeview, gint column)
{
#ifdef DEBUG
printf("treeview_helper_get_index\n");
#endif
gint value;
GtkTreeSelection *selection =
gtk_tree_view_get_selection(treeview);
@ -93,6 +101,10 @@ treeview_helper_get_index(GtkTreeView *treeview, gint column)
gpointer
treeview_helper_get_pointer(GtkTreeView *treeview, gint column)
{
#ifdef DEBUG
printf("treeview_helper_get_pointer\n");
#endif
gpointer ptr;
GtkTreeSelection *selection =
gtk_tree_view_get_selection(treeview);
@ -115,6 +127,10 @@ treeview_helper_get_pointer(GtkTreeView *treeview, gint column)
void
treeview_helper_clear(GtkTreeView *treeview)
{
#ifdef DEBUG
printf("treeview_helper_clear\n");
#endif
gint i;
gint number_of_columns;
GtkTreeView *list = (treeview == NULL) ?
@ -142,6 +158,10 @@ treeview_helper_clear(GtkTreeView *treeview)
gint
treeview_helper_get_col_number_column (GtkTreeViewColumn *col)
{
#ifdef DEBUG
printf("treeview_helper_get_col_number_column\n");
#endif
GList *cols;
gint num;
@ -161,6 +181,10 @@ treeview_helper_get_col_number_column (GtkTreeViewColumn *col)
gint
treeview_helper_iter_get_row(GtkTreeModel *model, GtkTreeIter *iter)
{
#ifdef DEBUG
printf("treeview_helper_iter_get_row\n");
#endif
gchar *path = gtk_tree_model_get_string_from_iter(model, iter);
gint row_idx = (gint)g_ascii_strtod(path, NULL);
@ -189,6 +213,14 @@ treeview_helper_cell_renderer_text_new(void)
gchar*
treeview_helper_live_game_icon(gint event_type)
{
#ifdef DEBUG
printf("treeview_helper_live_game_icon\n");
#endif
#ifdef DEBUG
printf("treeview_helper_live_game_icon\n");
#endif
if(event_type == LIVE_GAME_EVENT_START_MATCH ||
event_type == LIVE_GAME_EVENT_END_MATCH ||
event_type == LIVE_GAME_EVENT_HALF_TIME ||
@ -263,6 +295,14 @@ treeview_helper_live_game_icon(gint event_type)
gchar*
treeview_helper_get_user_history_icon(gint history_type)
{
#ifdef DEBUG
printf("treeview_helper_get_user_history_icon\n");
#endif
#ifdef DEBUG
printf("treeview_helper_get_user_history_icon\n");
#endif
switch(history_type)
{
default:
@ -325,6 +365,10 @@ treeview_helper_pixbuf_from_filename(gchar *filename)
void
treeview_helper_unref(GObject *object)
{
#ifdef DEBUG
printf("treeview_helper_unref\n");
#endif
if(object == NULL)
return;
@ -339,6 +383,10 @@ void
treeview_helper_insert_icon(GtkListStore *ls, GtkTreeIter *iter, gint column_nr,
gchar *icon_name)
{
#ifdef DEBUG
printf("treeview_helper_insert_icon\n");
#endif
GdkPixbuf *symbol = treeview_helper_pixbuf_from_filename(icon_name);
gtk_list_store_set(ls, iter, column_nr, symbol, -1);
@ -353,6 +401,10 @@ treeview_helper_team_compare(GtkTreeModel *model,
GtkTreeIter *b,
gpointer user_data)
{
#ifdef DEBUG
printf("treeview_helper_team_compare\n");
#endif
gint type = GPOINTER_TO_INT(user_data);
Team *tm1, *tm2;
gint return_value = 0;
@ -381,6 +433,10 @@ treeview_helper_player_compare(GtkTreeModel *model,
GtkTreeIter *b,
gpointer user_data)
{
#ifdef DEBUG
printf("treeview_helper_player_compare\n");
#endif
gint type = GPOINTER_TO_INT(user_data);
Player *pl1, *pl2;
gint return_value = 0;
@ -452,6 +508,10 @@ gboolean
treeview_helper_get_table_element_colour_cups(const League *league, gint table_index,
gint idx, gchar **colour_bg)
{
#ifdef DEBUG
printf("treeview_helper_get_table_element_colour_cups\n");
#endif
gint i, j, k;
const CupRound *cup_round = NULL;
gint league_idx = league_cup_get_index_from_clid(league->id) + 1;
@ -508,6 +568,10 @@ gboolean
treeview_helper_get_table_element_colour_cups_cup(const Cup *cup,
const Team *tm, gchar **colour_bg)
{
#ifdef DEBUG
printf("treeview_helper_get_table_element_colour_cups_cup\n");
#endif
gint i, j, k, idx = -1;
const CupRound *cup_round = NULL;
gchar *cup_highlight_colour = NULL;
@ -567,6 +631,10 @@ treeview_helper_get_table_element_colours(const Table *table, gint table_index,
gchar **colour_fg, gchar **colour_bg,
gboolean user)
{
#ifdef DEBUG
printf("treeview_helper_get_table_element_colours\n");
#endif
gint i;
const TableElement *elem = &g_array_index(table->elements, TableElement, idx);
const PromRelElement *pelem = NULL;
@ -635,6 +703,10 @@ void
treeview_helper_set_user_colours(const gchar *team_name,
gchar **colour_bg, gchar **colour_fg)
{
#ifdef DEBUG
printf("treeview_helper_set_user_colours\n");
#endif
if(strcmp(team_name, current_user.tm->name) == 0)
{
*colour_fg = const_app("string_treeview_current_user_fg");
@ -691,6 +763,10 @@ treeview_helper_team_selection(GtkTreeViewColumn *col,
GtkTreeIter *iter,
gpointer user_data)
{
#ifdef DEBUG
printf("treeview_helper_team_selection\n");
#endif
gchar buf[SMALL];
gint column = treeview_helper_get_col_number_column(col);
gpointer team_pointer;
@ -719,6 +795,10 @@ treeview_helper_int_to_cell(GtkTreeViewColumn *col,
GtkTreeIter *iter,
gpointer user_data)
{
#ifdef DEBUG
printf("treeview_helper_int_to_cell\n");
#endif
gint column = treeview_helper_get_col_number_column(col);
gint value;
gchar buf[SMALL];
@ -741,6 +821,10 @@ treeview_helper_player_ext_info_to_cell(GtkTreeViewColumn *col,
GtkTreeIter *iter,
gpointer user_data)
{
#ifdef DEBUG
printf("treeview_helper_player_ext_info_to_cell\n");
#endif
gint column = treeview_helper_get_col_number_column(col);
gint row_idx = treeview_helper_iter_get_row(model, iter);
const Player *pl;
@ -835,6 +919,10 @@ treeview_helper_player_ext_info_to_cell(GtkTreeViewColumn *col,
void
treeview_helper_player_info_career_to_cell(GtkCellRenderer *renderer, const Player *pl)
{
#ifdef DEBUG
printf("treeview_helper_player_info_career_to_cell\n");
#endif
gint i;
gfloat goals_game = 0,
shot_perc = 0;
@ -881,6 +969,10 @@ treeview_helper_player_info_career_to_cell(GtkCellRenderer *renderer, const Play
void
treeview_helper_player_info_banned_to_cell(GtkCellRenderer *renderer, const GArray *cards)
{
#ifdef DEBUG
printf("treeview_helper_player_info_banned_to_cell\n");
#endif
gint i;
gchar buf[SMALL], buf2[SMALL];
@ -907,6 +999,10 @@ treeview_helper_player_info_banned_to_cell(GtkCellRenderer *renderer, const GArr
void
treeview_helper_player_info_yellow_to_cell(GtkCellRenderer *renderer, const GArray *cards)
{
#ifdef DEBUG
printf("treeview_helper_player_info_yellow_to_cell\n");
#endif
gint i;
gint yellow_red = -1;
gchar buf[SMALL], buf2[SMALL];
@ -942,6 +1038,10 @@ treeview_helper_player_info_yellow_to_cell(GtkCellRenderer *renderer, const GArr
void
treeview_helper_player_info_games_goals_to_cell(GtkCellRenderer *renderer, const GArray *games_goals)
{
#ifdef DEBUG
printf("treeview_helper_player_info_games_goals_to_cell\n");
#endif
gint i;
gchar buf[SMALL], buf2[SMALL];
@ -962,6 +1062,10 @@ treeview_helper_player_info_games_goals_to_cell(GtkCellRenderer *renderer, const
void
treeview_helper_player_info_streak_to_cell(GtkCellRenderer *renderer, gint streak)
{
#ifdef DEBUG
printf("treeview_helper_player_info_streak_to_cell\n");
#endif
if(streak == PLAYER_STREAK_HOT)
g_object_set(renderer, "text", _("The player is on a hot streak"), NULL);
else if(streak == PLAYER_STREAK_COLD)
@ -971,6 +1075,10 @@ treeview_helper_player_info_streak_to_cell(GtkCellRenderer *renderer, gint strea
void
treeview_helper_player_info_health_to_cell(GtkCellRenderer *renderer, const Player *pl)
{
#ifdef DEBUG
printf("treeview_helper_player_info_health_to_cell\n");
#endif
gchar buf[SMALL];
if(pl->health != 0)
@ -995,6 +1103,10 @@ treeview_helper_player_to_cell(GtkTreeViewColumn *col,
GtkTreeIter *iter,
gpointer user_data)
{
#ifdef DEBUG
printf("treeview_helper_player_to_cell\n");
#endif
gint column = treeview_helper_get_col_number_column(col);
gint attribute = GPOINTER_TO_INT(user_data), idx = -1;
gchar buf[SMALL];
@ -1090,6 +1202,10 @@ treeview_helper_player_to_cell(GtkTreeViewColumn *col,
void
treeview_helper_player_name_to_cell(GtkCellRenderer *renderer, gchar *buf, const Player *pl)
{
#ifdef DEBUG
printf("treeview_helper_player_name_to_cell\n");
#endif
const TransferOffer *off = transfer_player_has_offer(pl);
const gchar *colour_fg = const_app("string_treeview_helper_color_default_foreground"),
*colour_bg = const_app("string_treeview_helper_color_default_background");
@ -1135,6 +1251,10 @@ treeview_helper_player_name_to_cell(GtkCellRenderer *renderer, gchar *buf, const
void
treeview_helper_player_contract_to_cell(GtkCellRenderer *renderer, gchar *buf, gfloat contract_time)
{
#ifdef DEBUG
printf("treeview_helper_player_contract_to_cell\n");
#endif
sprintf(buf, "%.*f", 1 + opt_int("int_opt_player_precision"),
contract_time);
@ -1158,6 +1278,10 @@ treeview_helper_player_contract_to_cell(GtkCellRenderer *renderer, gchar *buf, g
void
treeview_helper_player_cards_to_cell(gchar *buf, const Player *pl)
{
#ifdef DEBUG
printf("treeview_helper_player_cards_to_cell\n");
#endif
gint yellow;
Fixture *fix =
team_get_fixture(pl->team, FALSE);
@ -1203,6 +1327,10 @@ treeview_helper_player_status_to_cell(GtkTreeViewColumn *col,
GtkTreeIter *iter,
gpointer user_data)
{
#ifdef DEBUG
printf("treeview_helper_player_status_to_cell\n");
#endif
const Player *pl = NULL;
gchar buf[SMALL];
gint ban = 0, column = -1;
@ -1296,6 +1424,10 @@ treeview_helper_player_status_to_cell(GtkTreeViewColumn *col,
void
treeview_helper_player_games_goals_to_cell(gchar *buf, const Player *pl, gint type)
{
#ifdef DEBUG
printf("treeview_helper_player_games_goals_to_cell\n");
#endif
Fixture *fix = team_get_fixture(pl->team, FALSE);
gint clid = pl->team->clid;
@ -1322,6 +1454,10 @@ treeview_helper_player_games_goals_to_cell(gchar *buf, const Player *pl, gint ty
void
treeview_helper_player_fitness_to_cell(GtkCellRenderer *renderer, gchar *buf, gfloat fitness)
{
#ifdef DEBUG
printf("treeview_helper_player_fitness_to_cell\n");
#endif
sprintf(buf, "%.*f%%", opt_int("int_opt_player_precision"),
fitness * 100);
@ -1347,6 +1483,10 @@ void
treeview_helper_player_pos_to_cell(GtkCellRenderer *renderer, gchar *buf,
const Player *pl, gint type)
{
#ifdef DEBUG
printf("treeview_helper_player_pos_to_cell\n");
#endif
gint pos = (type == PLAYER_LIST_ATTRIBUTE_POS) ?
pl->pos : pl->cpos;
@ -1400,6 +1540,10 @@ treeview_helper_player_pos_to_cell(GtkCellRenderer *renderer, gchar *buf,
void
treeview_helper_player_cskill_to_cell(GtkCellRenderer *renderer, gchar *buf, const Player *pl)
{
#ifdef DEBUG
printf("treeview_helper_player_cskill_to_cell\n");
#endif
sprintf(buf, "%.*f", opt_int("int_opt_player_precision"),
player_get_game_skill(pl, FALSE, FALSE));
@ -1423,7 +1567,12 @@ treeview_helper_live_game_result(GtkTreeViewColumn *col,
GtkTreeModel *model,
GtkTreeIter *iter,
gpointer user_data)
{
{
#ifdef DEBUG
printf("treeview_helper_live_game_result\n");
#endif
gint column = treeview_helper_get_col_number_column(col);
gchar buf[SMALL];
gchar *data = NULL;
@ -1444,6 +1593,10 @@ treeview_helper_int_compare(GtkTreeModel *model,
GtkTreeIter *b,
gpointer user_data)
{
#ifdef DEBUG
printf("treeview_helper_int_compare\n");
#endif
gint column = GPOINTER_TO_INT(user_data);
gint value1, value2;
@ -1460,6 +1613,10 @@ treeview_helper_mm_teams(GtkTreeViewColumn *col,
GtkTreeIter *iter,
gpointer user_data)
{
#ifdef DEBUG
printf("treeview_helper_mm_teams\n");
#endif
gint column = treeview_helper_get_col_number_column(col);
const MemMatch *mm = NULL;
const gchar *text = NULL;
@ -1536,6 +1693,10 @@ treeview_helper_season_results(GtkTreeViewColumn *col,
GtkTreeIter *iter,
gpointer user_data)
{
#ifdef DEBUG
printf("treeview_helper_season_results\n");
#endif
gint column = treeview_helper_get_col_number_column(col);
gchar buf[SMALL];
const Fixture *fix = NULL;
@ -1609,6 +1770,10 @@ treeview_helper_bet_odds(GtkTreeViewColumn *col,
GtkTreeIter *iter,
gpointer user_data)
{
#ifdef DEBUG
printf("treeview_helper_bet_odds\n");
#endif
gint column = treeview_helper_get_col_number_column(col);
gchar buf[SMALL];
const Fixture *fix = NULL;
@ -1654,6 +1819,10 @@ treeview_helper_search_equal(GtkTreeModel *model,
GtkTreeIter *iter,
gpointer search_data)
{
#ifdef DEBUG
printf("treeview_helper_search_equal\n");
#endif
const Team *tm = NULL;
gchar *name_lower = NULL;
gboolean return_value = TRUE;
@ -1674,6 +1843,10 @@ treeview_helper_job_exchange(GtkTreeViewColumn *col,
GtkTreeIter *iter,
gpointer user_data)
{
#ifdef DEBUG
printf("treeview_helper_job_exchange\n");
#endif
gint column = treeview_helper_get_col_number_column(col);
gchar buf[SMALL];
const Job *job = NULL;

View File

@ -51,6 +51,10 @@
User
user_new(void)
{
#ifdef DEBUG
printf("user_new\n");
#endif
User new;
new.name = g_strdup("NONAME");
@ -85,6 +89,10 @@ user_new(void)
void
user_set_up_team_new_game(User *user)
{
#ifdef DEBUG
printf("user_set_up_team_new_game\n");
#endif
gchar buf[SMALL];
gint rndom;
@ -125,6 +133,10 @@ user_set_up_team_new_game(User *user)
void
user_set_up_team(User *user, gboolean remove_players)
{
#ifdef DEBUG
printf("user_set_up_team\n");
#endif
gint i, j;
if(remove_players)
@ -166,6 +178,10 @@ user_set_up_team(User *user, gboolean remove_players)
void
user_set_up_counters(User *user)
{
#ifdef DEBUG
printf("user_set_up_counters\n");
#endif
gint i;
for(i=0;i<COUNT_USER_END;i++)
@ -182,6 +198,10 @@ user_set_up_counters(User *user)
void
user_set_up_finances(User *user)
{
#ifdef DEBUG
printf("user_set_up_finances\n");
#endif
gint i;
for(i=0; i<MON_OUT_END;i++)
@ -205,6 +225,10 @@ user_set_up_finances(User *user)
void
user_remove(gint idx, gboolean regenerate_team)
{
#ifdef DEBUG
printf("user_remove\n");
#endif
gint i;
if(regenerate_team)
@ -234,6 +258,10 @@ user_remove(gint idx, gboolean regenerate_team)
void
user_set_player_list_attributes(const User *user, PlayerListAttribute *attribute, gint list_number)
{
#ifdef DEBUG
printf("user_set_player_list_attributes\n");
#endif
gint i, cnt = 0;
gchar prefix[SMALL];
@ -251,6 +279,10 @@ user_set_player_list_attributes(const User *user, PlayerListAttribute *attribute
gboolean
query_user_events()
{
#ifdef DEBUG
printf("query_user_events\n");
#endif
gint i;
for(i=0;i<users->len;i++)
@ -264,6 +296,10 @@ query_user_events()
gboolean
query_user_games_in_week_round(gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("query_user_games_in_week_round\n");
#endif
gint i;
for(i=0;i<users->len;i++)
@ -277,6 +313,10 @@ query_user_games_in_week_round(gint week_number, gint week_round_number)
gboolean
query_user_game_in_week_round(gint usr_idx, gint week_number, gint week_round_number)
{
#ifdef DEBUG
printf("query_user_game_in_week_round\n");
#endif
gint i, j;
for(i=0;i<ligs->len;i++)
@ -321,6 +361,10 @@ user_from_team(const Team *tm)
void
user_job_offer(User *user)
{
#ifdef DEBUG
printf("user_job_offer\n");
#endif
Team *new_team = NULL;
if(math_rnd(0, 1) > const_float("float_user_success_counter_check") ||
@ -359,6 +403,10 @@ user_job_offer(User *user)
void
user_weekly_update_counters(User *user)
{
#ifdef DEBUG
printf("user_weekly_update_counters\n");
#endif
gint rank = team_get_league_rank(user->tm);
gint teamslen = ((GArray*)(league_cup_get_teams(user->tm->clid)))->len;
gint rank_bounds[2] =
@ -418,6 +466,10 @@ user_weekly_update_counters(User *user)
Event
user_event_new(void)
{
#ifdef DEBUG
printf("user_event_new\n");
#endif
Event new;
new.user = NULL;
@ -434,6 +486,10 @@ void
user_event_add(User *user, gint type, gint value1, gint value2,
gpointer value_pointer, gchar *format, ...)
{
#ifdef DEBUG
printf("user_event_add\n");
#endif
Event new = user_event_new();
gchar text[SMALL];
va_list args;
@ -463,6 +519,10 @@ user_event_add(User *user, gint type, gint value1, gint value2,
void
user_event_remove(User *user, gint idx)
{
#ifdef DEBUG
printf("user_event_remove\n");
#endif
free_event(&g_array_index(user->events, Event, idx));
g_array_remove_index(user->events, idx);
}
@ -470,7 +530,12 @@ user_event_remove(User *user, gint idx)
/** Show the next event for the current user. */
void
user_event_show_next(void)
{
{
#ifdef DEBUG
printf("user_event_show_next\n");
#endif
Event *event = NULL;
gchar buf[SMALL],
buf2[SMALL], buf3[SMALL];
@ -583,6 +648,10 @@ user_event_show_next(void)
void
user_change_team(User *user, Team *tm)
{
#ifdef DEBUG
printf("user_change_team\n");
#endif
gint i;
gint success = user->counters[COUNT_USER_SUCCESS];
@ -610,6 +679,10 @@ user_change_team(User *user, Team *tm)
gboolean
query_user_teams_have_unfit(void)
{
#ifdef DEBUG
printf("query_user_teams_have_unfit\n");
#endif
gint i, j;
for(i=0;i<users->len;i++)
@ -630,6 +703,10 @@ query_user_teams_have_unfit(void)
gint
user_history_compare(gconstpointer a, gconstpointer b)
{
#ifdef DEBUG
printf("user_history_compare\n");
#endif
gint return_value = 0;
const UserHistory *his1 = (const UserHistory*)a,
*his2 = (const UserHistory*)b;
@ -652,6 +729,10 @@ user_history_add(User *user, gint type, const gchar *team_name,
const gchar* string0, const gchar *string1,
const gchar *string2)
{
#ifdef DEBUG
printf("user_history_add\n");
#endif
gint i;
UserHistory new_history;
UserHistory *his = &new_history;
@ -731,6 +812,10 @@ user_history_add(User *user, gint type, const gchar *team_name,
void
user_history_to_string(const UserHistory *history, gchar *buf)
{
#ifdef DEBUG
printf("user_history_to_string\n");
#endif
switch(history->type)
{
default:
@ -811,6 +896,10 @@ user_history_to_string(const UserHistory *history, gchar *buf)
void
user_add_cup_success(User *user, const Cup *cup, gint round, gint type)
{
#ifdef DEBUG
printf("user_add_cup_success\n");
#endif
gboolean international, national;
international = query_league_cup_has_property(cup->id, "international");
@ -863,6 +952,10 @@ user_add_cup_success(User *user, const Cup *cup, gint round, gint type)
gboolean
query_user_no_turn(void)
{
#ifdef DEBUG
printf("query_user_no_turn\n");
#endif
gint i;
for(i=0;i<users->len;i++)
@ -876,6 +969,10 @@ query_user_no_turn(void)
UserSponsor
user_get_sponsor(const User *user)
{
#ifdef DEBUG
printf("user_get_sponsor\n");
#endif
UserSponsor new;
gint suc_factor = (current_user.counters[COUNT_USER_SUCCESS] < 0) ? -1 : 1;
gchar *names[18] =
@ -964,6 +1061,10 @@ user_get_sponsor(const User *user)
void
user_show_sponsors(void)
{
#ifdef DEBUG
printf("user_show_sponsors\n");
#endif
gint i, num_offers;
GArray *sponsors = g_array_new(FALSE, FALSE, sizeof(UserSponsor));
UserSponsor sponsor;
@ -1004,6 +1105,10 @@ user_show_sponsors(void)
void
user_show_sponsor_continue(void)
{
#ifdef DEBUG
printf("user_show_sponsor_continue\n");
#endif
GArray *sponsors = g_array_new(FALSE, FALSE, sizeof(UserSponsor));
UserSponsor sponsor;
gchar buf[SMALL];
@ -1031,6 +1136,10 @@ user_show_sponsor_continue(void)
void
user_mm_load_file(const gchar *filename, GArray *mmatches)
{
#ifdef DEBUG
printf("user_mm_load_file\n");
#endif
GString *prefix = g_string_new("");
gchar filename_local[SMALL],
matches_file[SMALL];
@ -1066,6 +1175,10 @@ user_mm_load_file(const gchar *filename, GArray *mmatches)
void
user_mm_add_last_match(gboolean load_file, gboolean save_file)
{
#ifdef DEBUG
printf("user_mm_add_last_match\n");
#endif
MemMatch new;
const Fixture *fix = current_user.live_game.fix;
gchar buf[SMALL];
@ -1107,6 +1220,10 @@ user_mm_add_last_match(gboolean load_file, gboolean save_file)
void
user_mm_save_file(const gchar *filename, const GArray *mmatches)
{
#ifdef DEBUG
printf("user_mm_save_file\n");
#endif
gchar prefix[SMALL];
strncpy(prefix, filename, strlen(filename) - 8);
@ -1124,6 +1241,10 @@ user_mm_save_file(const gchar *filename, const GArray *mmatches)
void
user_mm_set_filename(const gchar *filename, gchar *dest)
{
#ifdef DEBUG
printf("user_mm_set_filename\n");
#endif
gchar buf[SMALL];
if(g_str_has_suffix(filename, ".bmm.zip"))
@ -1154,6 +1275,10 @@ user_mm_set_filename(const gchar *filename, gchar *dest)
void
user_mm_import_file(const gchar *filename)
{
#ifdef DEBUG
printf("user_mm_import_file\n");
#endif
GArray *mm_array = g_array_new(FALSE, FALSE, sizeof(MemMatch));
gint i;
@ -1169,6 +1294,10 @@ user_mm_import_file(const gchar *filename)
void
user_mm_export_file(const gchar *filename)
{
#ifdef DEBUG
printf("user_mm_export_file\n");
#endif
gchar buf[SMALL];
GArray *mmatches = g_array_new(FALSE, FALSE, sizeof(MemMatch));

View File

@ -60,6 +60,10 @@
void
window_show_splash(void)
{
#ifdef DEBUG
printf("window_show_splash\n");
#endif
window_create(WINDOW_SPLASH);
treeview_show_contributors(
@ -73,6 +77,10 @@ window_show_splash(void)
void
window_splash_show_hint(void)
{
#ifdef DEBUG
printf("window_splash_show_hint\n");
#endif
gchar buf[SMALL];
gtk_label_set_text(
@ -91,6 +99,10 @@ window_splash_show_hint(void)
void
window_load_hint_number(void)
{
#ifdef DEBUG
printf("window_load_hint_number\n");
#endif
gchar filename[SMALL];
gchar dir[SMALL];
FILE *fil;
@ -125,6 +137,10 @@ window_load_hint_number(void)
void
window_save_hint_number(void)
{
#ifdef DEBUG
printf("window_save_hint_number\n");
#endif
gchar filename[SMALL];
gchar dir[SMALL];
FILE *fil;
@ -149,6 +165,10 @@ window_save_hint_number(void)
void
window_show_progress(gint pictype)
{
#ifdef DEBUG
printf("window_show_progress\n");
#endif
GPtrArray *pics = NULL;
const gchar *picdir = NULL;
gchar buf[SMALL];
@ -214,6 +234,10 @@ window_show_progress(gint pictype)
void
window_show_bets(void)
{
#ifdef DEBUG
printf("window_show_bets\n");
#endif
window_create(WINDOW_BETS);
gtk_toggle_button_set_active(
@ -234,6 +258,10 @@ window_show_bets(void)
void
window_show_help(gint page)
{
#ifdef DEBUG
printf("window_show_help\n");
#endif
gchar buf[SMALL];
window_create(WINDOW_HELP);
@ -256,6 +284,10 @@ window_show_help(gint page)
void
window_show_startup(void)
{
#ifdef DEBUG
printf("window_show_startup\n");
#endif
GtkWidget *window_startup =
window_create(WINDOW_STARTUP);
GtkWidget *combo_country =
@ -294,6 +326,10 @@ window_show_startup(void)
void
window_show_file_sel(void)
{
#ifdef DEBUG
printf("window_show_file_sel\n");
#endif
gchar buf[SMALL];
const gchar *home = g_get_home_dir();
gchar *filename = NULL;
@ -414,6 +450,10 @@ window_show_file_sel(void)
void
window_show_mmatches(void)
{
#ifdef DEBUG
printf("window_show_mmatches\n");
#endif
if(window.mmatches == NULL)
window_create(WINDOW_MMATCHES);
treeview2_show_mmatches();
@ -426,6 +466,10 @@ window_show_mmatches(void)
void
window_show_options(void)
{
#ifdef DEBUG
printf("window_show_options\n");
#endif
window_create(WINDOW_OPTIONS);
option_gui_set_up_window();
@ -435,6 +479,10 @@ window_show_options(void)
void
window_show_menu_player(GdkEvent *event)
{
#ifdef DEBUG
printf("window_show_menu_player\n");
#endif
if(window.menu_player != NULL)
window_destroy(&window.menu_player);
@ -448,6 +496,10 @@ window_show_menu_player(GdkEvent *event)
void
window_show_menu_youth(GdkEvent *event)
{
#ifdef DEBUG
printf("window_show_menu_youth\n");
#endif
if(window.menu_youth != NULL)
window_destroy(&window.menu_youth);
@ -463,6 +515,10 @@ void
window_show_digits(const gchar *text_main, const gchar* text1, gint value1,
const gchar* text2, gint value2, gboolean show_alr)
{
#ifdef DEBUG
printf("window_show_digits\n");
#endif
GtkLabel *label_main, *label_1, *label_2;
GtkSpinButton *spinbutton1, *spinbutton2;
@ -505,6 +561,10 @@ window_show_digits(const gchar *text_main, const gchar* text1, gint value1,
void
window_show_stadium(void)
{
#ifdef DEBUG
printf("window_show_stadium\n");
#endif
gchar buf[SMALL];
const Team *tm = current_user.tm;
GtkLabel *label_capacity,
@ -574,6 +634,10 @@ window_show_stadium(void)
gboolean
window_show(gpointer window)
{
#ifdef DEBUG
printf("window_show\n");
#endif
gtk_widget_show((GtkWidget*)window);
return FALSE;
@ -584,6 +648,10 @@ window_show(gpointer window)
void
window_show_yesno(const gchar *text)
{
#ifdef DEBUG
printf("window_show_yesno\n");
#endif
window_create(WINDOW_YESNO);
gtk_label_set_text(GTK_LABEL(lookup_widget(window.yesno, "label_yesno")), text);
}
@ -593,6 +661,10 @@ window_show_yesno(const gchar *text)
void
window_show_transfer_dialog(const gchar *text)
{
#ifdef DEBUG
printf("window_show_transfer_dialog\n");
#endif
window_create(WINDOW_TRANSFER_DIALOG);
gtk_label_set_text(GTK_LABEL(lookup_widget(window.transfer_dialog, "label_transfer_dialog")), text);
}
@ -602,6 +674,10 @@ window_show_transfer_dialog(const gchar *text)
void
window_live_set_up(void)
{
#ifdef DEBUG
printf("window_live_set_up\n");
#endif
GtkSpinButton *sb_speed =
GTK_SPIN_BUTTON(lookup_widget(window.live, "spinbutton_speed"));
gfloat user_option = (gfloat)option_int("int_opt_user_live_game_speed",
@ -624,6 +700,10 @@ window_live_set_up(void)
void
window_main_save_geometry(void)
{
#ifdef DEBUG
printf("window_main_save_geometry\n");
#endif
gchar filename[SMALL];
gchar dir[SMALL];
FILE *fil = NULL;
@ -656,6 +736,10 @@ window_main_save_geometry(void)
void
window_main_load_geometry(void)
{
#ifdef DEBUG
printf("window_main_load_geometry\n");
#endif
gchar filename[SMALL];
gchar dir[SMALL];
OptionList optionlist;
@ -918,6 +1002,10 @@ window_create(gint window_type)
void
window_destroy(GtkWidget **wind)
{
#ifdef DEBUG
printf("window_destroy\n");
#endif
if(*wind == NULL)
return;
@ -938,6 +1026,10 @@ window_destroy(GtkWidget **wind)
void
window_show_training_camp(void)
{
#ifdef DEBUG
printf("window_show_training_camp\n");
#endif
GtkEntry *tfCosts;
GtkWidget *rb_camp1;
GtkWidget *rb_camp2;
@ -1018,6 +1110,10 @@ window_show_training_camp(void)
void
window_show_alr(void)
{
#ifdef DEBUG
printf("window_show_alr\n");
#endif
gchar weekly_installment[SMALL],
debt[SMALL];

View File

@ -49,6 +49,10 @@
void
xml_load_users(const gchar *dirname, const gchar *basename)
{
#ifdef DEBUG
printf("xml_load_users\n");
#endif
gint i;
gchar buf[SMALL];
@ -71,6 +75,10 @@ xml_load_users(const gchar *dirname, const gchar *basename)
void
xml_load_league(const gchar *dirname, const gchar *basename)
{
#ifdef DEBUG
printf("xml_load_league\n");
#endif
gchar buf[SMALL], team_file[SMALL];
League new = league_new(FALSE);
gchar *prefix = g_strndup(basename, strlen(basename) - 4);
@ -104,6 +112,10 @@ xml_load_league(const gchar *dirname, const gchar *basename)
void
xml_load_cup(Cup *cup, const gchar *dirname, const gchar *basename)
{
#ifdef DEBUG
printf("xml_load_cup\n");
#endif
gchar buf[SMALL];
gchar *prefix = g_strndup(basename, strlen(basename) - 4);
@ -129,6 +141,10 @@ xml_load_cup(Cup *cup, const gchar *dirname, const gchar *basename)
void
xml_load_transfers(const gchar *dirname, const gchar *basename)
{
#ifdef DEBUG
printf("xml_load_transfers\n");
#endif
gchar buf[SMALL];
sprintf(buf, "%s%s%s___transfer_list.xml", dirname, G_DIR_SEPARATOR_S, basename);
@ -142,6 +158,10 @@ xml_load_transfers(const gchar *dirname, const gchar *basename)
void
xml_write_string(FILE *fil, const gchar *string, gint tag, const gchar* indent)
{
#ifdef DEBUG
printf("xml_write_string\n");
#endif
if(string == NULL)
return;

View File

@ -84,6 +84,10 @@ xml_country_read_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_country_read_start_element\n");
#endif
if(strcmp(element_name, TAG_NAME) == 0)
state = STATE_NAME;
else if(strcmp(element_name, TAG_RATING) == 0)
@ -126,6 +130,10 @@ xml_country_read_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_country_read_end_element\n");
#endif
if(strcmp(element_name, TAG_NAME) == 0 ||
strcmp(element_name, TAG_RATING) == 0 ||
strcmp(element_name, TAG_SYMBOL) == 0 ||
@ -157,6 +165,10 @@ xml_country_read_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_country_read_text\n");
#endif
gchar buf[text_len + 1];
gint int_value;
@ -201,6 +213,10 @@ xml_country_read_text (GMarkupParseContext *context,
void
xml_country_read(const gchar *country_name, Country *cntry_arg)
{
#ifdef DEBUG
printf("xml_country_read\n");
#endif
gchar *file_name = file_find_support_file(country_name, FALSE);
GMarkupParser parser = {xml_country_read_start_element,
xml_country_read_end_element,

View File

@ -141,6 +141,10 @@ xml_cup_read_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_cup_read_start_element\n");
#endif
if(strcmp(element_name, TAG_CUP) == 0)
{
new_cup = cup_new(FALSE);
@ -240,6 +244,10 @@ xml_cup_read_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_cup_read_end_element\n");
#endif
if(strcmp(element_name, TAG_NAME) == 0 ||
strcmp(element_name, TAG_SHORT_NAME) == 0 ||
strcmp(element_name, TAG_SYMBOL) == 0 ||
@ -305,6 +313,10 @@ xml_cup_read_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_cup_read_text\n");
#endif
gchar buf[text_len + 1];
gint int_value;
gfloat float_value;
@ -393,6 +405,10 @@ xml_cup_read_text (GMarkupParseContext *context,
void
xml_cup_read(const gchar *cup_name, GArray *cups)
{
#ifdef DEBUG
printf("xml_cup_read\n");
#endif
gchar *file_name = file_find_support_file(cup_name, FALSE);
GMarkupParser parser = {xml_cup_read_start_element,
xml_cup_read_end_element,

View File

@ -146,6 +146,10 @@ xml_league_read_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_league_read_start_element\n");
#endif
PromRelElement new_element;
Team new_team;
JoinedLeague new_joined_league;
@ -273,6 +277,10 @@ xml_league_read_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_league_read_end_element\n");
#endif
if(strcmp(element_name, TAG_NAME) == 0 ||
strcmp(element_name, TAG_SHORT_NAME) == 0 ||
strcmp(element_name, TAG_SID) == 0 ||
@ -333,6 +341,10 @@ xml_league_read_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_league_read_text\n");
#endif
gchar buf[text_len + 1];
gint int_value;
gfloat float_value;
@ -446,6 +458,10 @@ xml_league_read_text (GMarkupParseContext *context,
void
xml_league_read(const gchar *league_name, GArray *leagues)
{
#ifdef DEBUG
printf("xml_league_read\n");
#endif
gchar *file_name = file_find_support_file(league_name, FALSE);
GMarkupParser parser = {xml_league_read_start_element,
xml_league_read_end_element,

View File

@ -87,6 +87,10 @@ gchar *condition;
gint
xml_lg_commentary_event_name_to_int(const gchar *event_string)
{
#ifdef DEBUG
printf("xml_lg_commentary_event_name_to_int\n");
#endif
gint return_value = -1;
if(strcmp(event_string, EVENT_NAME_GENERAL) == 0)
@ -172,6 +176,10 @@ xml_lg_commentary_read_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_lg_commentary_read_start_element\n");
#endif
gint atidx = 0;
if(strcmp(element_name, TAG_EVENT) == 0)
@ -212,6 +220,10 @@ xml_lg_commentary_read_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_lg_commentary_read_end_element\n");
#endif
if(strcmp(element_name, TAG_EVENT) == 0)
state = STATE_LG_COMMENTARY;
else if(strcmp(element_name, TAG_EVENT_NAME) == 0 ||
@ -235,6 +247,10 @@ xml_lg_commentary_read_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_lg_commentary_read_text\n");
#endif
gchar buf[text_len + 1];
LGCommentary commentary;
@ -267,6 +283,10 @@ xml_lg_commentary_read_text (GMarkupParseContext *context,
void
xml_lg_commentary_read(const gchar *commentary_file)
{
#ifdef DEBUG
printf("xml_lg_commentary_read\n");
#endif
GMarkupParser parser = {xml_lg_commentary_read_start_element,
xml_lg_commentary_read_end_element,
xml_lg_commentary_read_text, NULL, NULL};

View File

@ -88,6 +88,10 @@ xml_loadsave_cup_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_cup_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -122,6 +126,10 @@ xml_loadsave_cup_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_cup_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_NAME ||
@ -189,6 +197,10 @@ xml_loadsave_cup_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_cup_text\n");
#endif
gint i;
gchar buf[SMALL], buf2[SMALL];
gint int_value = -1;
@ -300,6 +312,10 @@ xml_loadsave_cup_text (GMarkupParseContext *context,
void
xml_loadsave_cup_read(const gchar *filename, Cup *cup)
{
#ifdef DEBUG
printf("xml_loadsave_cup_read\n");
#endif
GMarkupParser parser = {xml_loadsave_cup_start_element,
xml_loadsave_cup_end_element,
xml_loadsave_cup_text, NULL, NULL};
@ -338,6 +354,10 @@ xml_loadsave_cup_read(const gchar *filename, Cup *cup)
void
xml_loadsave_cup_write(const gchar *prefix, const Cup *cup)
{
#ifdef DEBUG
printf("xml_loadsave_cup_write\n");
#endif
gint i;
gchar buf[SMALL];
FILE *fil = NULL;
@ -391,6 +411,10 @@ xml_loadsave_cup_write(const gchar *prefix, const Cup *cup)
void
xml_loadsave_cup_write_round(FILE *fil, const gchar *prefix, const Cup *cup, gint round)
{
#ifdef DEBUG
printf("xml_loadsave_cup_write_round\n");
#endif
gint i;
gchar buf[SMALL];
const CupRound *cup_round = &g_array_index(cup->rounds, CupRound, round);
@ -466,6 +490,10 @@ xml_loadsave_cup_write_round(FILE *fil, const gchar *prefix, const Cup *cup, gin
void
xml_loadsave_cup_write_choose_team(FILE *fil, const CupChooseTeam *choose_team)
{
#ifdef DEBUG
printf("xml_loadsave_cup_write_choose_team\n");
#endif
fprintf(fil, "%s<_%d>\n", I1, TAG_CUP_CHOOSE_TEAM);
xml_write_string(fil, choose_team->sid, TAG_CUP_CHOOSE_TEAM_SID, I2);

View File

@ -58,6 +58,10 @@ xml_loadsave_fixtures_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_fixtures_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -90,6 +94,10 @@ xml_loadsave_fixtures_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_fixtures_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_FIXTURE)
@ -132,6 +140,10 @@ xml_loadsave_fixtures_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_fixtures_text\n");
#endif
gchar buf[SMALL];
gint int_value = -1;
@ -172,6 +184,10 @@ xml_loadsave_fixtures_text (GMarkupParseContext *context,
void
xml_loadsave_fixtures_read(const gchar *filename, GArray *fixtures)
{
#ifdef DEBUG
printf("xml_loadsave_fixtures_read\n");
#endif
GMarkupParser parser = {xml_loadsave_fixtures_start_element,
xml_loadsave_fixtures_end_element,
xml_loadsave_fixtures_text, NULL, NULL};
@ -207,6 +223,10 @@ xml_loadsave_fixtures_read(const gchar *filename, GArray *fixtures)
void
xml_loadsave_fixtures_write(const gchar *filename, const GArray *fixtures)
{
#ifdef DEBUG
printf("xml_loadsave_fixtures_write\n");
#endif
gint i, j;
FILE *fil = NULL;

View File

@ -59,6 +59,10 @@ xml_loadsave_jobs_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_jobs_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -85,6 +89,10 @@ xml_loadsave_jobs_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_jobs_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_JOB)
@ -114,6 +122,10 @@ xml_loadsave_jobs_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_jobs_text\n");
#endif
gchar buf[SMALL];
gint int_value = -1;
gfloat float_value = -1;
@ -147,6 +159,10 @@ xml_loadsave_jobs_text (GMarkupParseContext *context,
void
xml_loadsave_jobs_read(const gchar *dirname, const gchar *basename)
{
#ifdef DEBUG
printf("xml_loadsave_jobs_read\n");
#endif
GMarkupParser parser = {xml_loadsave_jobs_start_element,
xml_loadsave_jobs_end_element,
xml_loadsave_jobs_text, NULL, NULL};
@ -188,6 +204,10 @@ xml_loadsave_jobs_read(const gchar *dirname, const gchar *basename)
void
xml_loadsave_jobs_write(const gchar *prefix)
{
#ifdef DEBUG
printf("xml_loadsave_jobs_write\n");
#endif
gint i;
gchar buf[SMALL];
FILE *fil = NULL;

View File

@ -80,6 +80,10 @@ xml_loadsave_league_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_league_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -126,6 +130,10 @@ xml_loadsave_league_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_league_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_LEAGUE_FIRST_WEEK ||
@ -184,6 +192,10 @@ xml_loadsave_league_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_league_text\n");
#endif
gchar buf[SMALL], buf2[SMALL];
gint int_value = -1;
gfloat float_value = -1;
@ -272,6 +284,10 @@ xml_loadsave_league_text (GMarkupParseContext *context,
void
xml_loadsave_league_read(const gchar *filename, const gchar *team_file, League *league)
{
#ifdef DEBUG
printf("xml_loadsave_league_read\n");
#endif
GMarkupParser parser = {xml_loadsave_league_start_element,
xml_loadsave_league_end_element,
xml_loadsave_league_text, NULL, NULL};
@ -312,6 +328,10 @@ xml_loadsave_league_read(const gchar *filename, const gchar *team_file, League *
void
xml_loadsave_league_write(const gchar *prefix, const League *league)
{
#ifdef DEBUG
printf("xml_loadsave_league_write\n");
#endif
gint i;
gchar buf[SMALL];
FILE *fil = NULL;

View File

@ -58,6 +58,10 @@ xml_loadsave_league_stat_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_league_stat_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -93,6 +97,10 @@ xml_loadsave_league_stat_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_league_stat_end_element\n");
#endif
GArray *stat_array = NULL;
gint tag = xml_get_tag_from_name(element_name);
@ -145,6 +153,10 @@ xml_loadsave_league_stat_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_league_stat_text\n");
#endif
gchar buf[SMALL];
gint int_value = -1;
@ -175,6 +187,10 @@ xml_loadsave_league_stat_text (GMarkupParseContext *context,
void
xml_loadsave_league_stat_read(const gchar *filename, LeagueStat *league_stat)
{
#ifdef DEBUG
printf("xml_loadsave_league_stat_read\n");
#endif
GMarkupParser parser = {xml_loadsave_league_stat_start_element,
xml_loadsave_league_stat_end_element,
xml_loadsave_league_stat_text, NULL, NULL};
@ -210,6 +226,10 @@ xml_loadsave_league_stat_read(const gchar *filename, LeagueStat *league_stat)
void
xml_loadsave_league_stat_write(const gchar *filename, const LeagueStat *league_stat)
{
#ifdef DEBUG
printf("xml_loadsave_league_stat_write\n");
#endif
gint i;
FILE *fil = NULL;
@ -252,6 +272,10 @@ xml_loadsave_league_stat_write(const gchar *filename, const LeagueStat *league_s
void
xml_loadsave_league_stat_write_stat(FILE *fil, const Stat *stat)
{
#ifdef DEBUG
printf("xml_loadsave_league_stat_write_stat\n");
#endif
fprintf(fil, "%s<_%d>\n", I1, TAG_STAT);
xml_write_string(fil, stat->team_name, TAG_STAT_TEAM_NAME, I1);

View File

@ -52,6 +52,10 @@ xml_loadsave_leagues_cups_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_leagues_cups_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -74,6 +78,10 @@ xml_loadsave_leagues_cups_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_leagues_cups_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_LEAGUE_FILE ||
@ -91,6 +99,10 @@ xml_loadsave_leagues_cups_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_leagues_cups_text\n");
#endif
gchar buf[SMALL];
Cup new_cup;
@ -111,6 +123,10 @@ xml_loadsave_leagues_cups_text (GMarkupParseContext *context,
void
xml_loadsave_leagues_cups_read(const gchar *dirname, const gchar *prefix)
{
#ifdef DEBUG
printf("xml_loadsave_leagues_cups_read\n");
#endif
gchar file[SMALL];
GMarkupParser parser = {xml_loadsave_leagues_cups_start_element,
xml_loadsave_leagues_cups_end_element,
@ -153,6 +169,10 @@ xml_loadsave_leagues_cups_read(const gchar *dirname, const gchar *prefix)
void
xml_loadsave_leagues_cups_write(const gchar *prefix)
{
#ifdef DEBUG
printf("xml_loadsave_leagues_cups_write\n");
#endif
gint i;
gchar buf[SMALL],
*basename = g_path_get_basename(prefix);

View File

@ -77,6 +77,10 @@ xml_loadsave_live_game_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_live_game_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -110,6 +114,10 @@ xml_loadsave_live_game_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_live_game_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_LIVE_GAME_FIX_ID ||
@ -177,6 +185,10 @@ xml_loadsave_live_game_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_live_game_text\n");
#endif
gchar buf[SMALL];
gint int_value = -1;
gfloat float_value = -1;
@ -230,6 +242,10 @@ xml_loadsave_live_game_text (GMarkupParseContext *context,
void
xml_loadsave_live_game_read(const gchar *filename, LiveGame *live_game)
{
#ifdef DEBUG
printf("xml_loadsave_live_game_read\n");
#endif
GMarkupParser parser = {xml_loadsave_live_game_start_element,
xml_loadsave_live_game_end_element,
xml_loadsave_live_game_text, NULL, NULL};
@ -267,6 +283,10 @@ xml_loadsave_live_game_read(const gchar *filename, LiveGame *live_game)
void
xml_loadsave_live_game_write(const gchar *filename, const LiveGame *live_game)
{
#ifdef DEBUG
printf("xml_loadsave_live_game_write\n");
#endif
gint i;
FILE *fil = NULL;
@ -305,6 +325,10 @@ xml_loadsave_live_game_write(const gchar *filename, const LiveGame *live_game)
void
xml_loadsave_live_game_write_unit(FILE *fil, const LiveGameUnit *unit)
{
#ifdef DEBUG
printf("xml_loadsave_live_game_write_unit\n");
#endif
fprintf(fil, "<_%d>\n", TAG_LIVE_GAME_UNIT);
xml_write_int(fil, unit->possession,
@ -345,6 +369,10 @@ xml_loadsave_live_game_write_unit(FILE *fil, const LiveGameUnit *unit)
void
xml_loadsave_live_game_write_stats(FILE *fil, const LiveGameStats *stats)
{
#ifdef DEBUG
printf("xml_loadsave_live_game_write_stats\n");
#endif
gint i, j, k;
fprintf(fil, "<_%d>\n", TAG_LIVE_GAME_STAT);

View File

@ -64,6 +64,10 @@ xml_loadsave_misc_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_misc_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -103,6 +107,10 @@ xml_loadsave_misc_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_misc_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_NAME ||
@ -145,6 +153,10 @@ xml_loadsave_misc_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_misc_text\n");
#endif
gchar buf[SMALL];
gint int_value = -1;
gfloat float_value = -1;
@ -186,6 +198,10 @@ xml_loadsave_misc_text (GMarkupParseContext *context,
void
xml_loadsave_misc_read(const gchar *dirname, const gchar *basename)
{
#ifdef DEBUG
printf("xml_loadsave_misc_read\n");
#endif
gchar file[SMALL];
GMarkupParser parser = {xml_loadsave_misc_start_element,
xml_loadsave_misc_end_element,
@ -228,6 +244,10 @@ xml_loadsave_misc_read(const gchar *dirname, const gchar *basename)
void
xml_loadsave_misc_write(const gchar *prefix)
{
#ifdef DEBUG
printf("xml_loadsave_misc_write\n");
#endif
gint i;
gchar buf[SMALL];
FILE *fil = NULL;
@ -264,6 +284,10 @@ xml_loadsave_misc_write(const gchar *prefix)
void
xml_loadsave_misc_write_bets(FILE *fil)
{
#ifdef DEBUG
printf("xml_loadsave_misc_write_bets\n");
#endif
gint i, j, k;
for(i=0;i<2;i++)

View File

@ -77,6 +77,10 @@ PlayerCard new_card;
void
xml_loadsave_players_start_element(gint tag, Team *tm)
{
#ifdef DEBUG
printf("xml_loadsave_players_start_element\n");
#endif
gint i;
gboolean valid_tag = FALSE;
@ -101,6 +105,10 @@ xml_loadsave_players_start_element(gint tag, Team *tm)
void
xml_loadsave_players_end_element(gint tag, GArray *players)
{
#ifdef DEBUG
printf("xml_loadsave_players_end_element\n");
#endif
if(tag == TAG_PLAYER)
g_array_append_val(players, new_player);
else if(tag == TAG_PLAYER_NAME ||
@ -157,6 +165,10 @@ xml_loadsave_players_end_element(gint tag, GArray *players)
void
xml_loadsave_players_text(gchar *text)
{
#ifdef DEBUG
printf("xml_loadsave_players_text\n");
#endif
gint int_value = -1;
gfloat float_value = -1;
@ -230,6 +242,10 @@ xml_loadsave_players_text(gchar *text)
void
xml_loadsave_players_write(FILE *fil, const GArray *players)
{
#ifdef DEBUG
printf("xml_loadsave_players_write\n");
#endif
gint i;
fprintf(fil, "%s<_%d>\n", I1, TAG_PLAYERS);
@ -243,6 +259,10 @@ xml_loadsave_players_write(FILE *fil, const GArray *players)
void
xml_loadsave_players_write_player(FILE *fil, const Player *pl)
{
#ifdef DEBUG
printf("xml_loadsave_players_write_player\n");
#endif
gint i;
fprintf(fil, "%s<_%d>\n", I1, TAG_PLAYER);

View File

@ -59,6 +59,10 @@ xml_loadsave_season_stats_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_season_stats_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -95,6 +99,10 @@ xml_loadsave_season_stats_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_season_stats_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_SEASON_STAT)
@ -132,6 +140,10 @@ xml_loadsave_season_stats_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_season_stats_text\n");
#endif
gchar buf[SMALL], buf2[SMALL];
LeagueStat new_league_stat;
gint int_value = -1;
@ -159,6 +171,10 @@ xml_loadsave_season_stats_text (GMarkupParseContext *context,
void
xml_loadsave_season_stats_read(const gchar *dirname, const gchar *prefix)
{
#ifdef DEBUG
printf("xml_loadsave_season_stats_read\n");
#endif
gchar filename[SMALL];
GMarkupParser parser = {xml_loadsave_season_stats_start_element,
xml_loadsave_season_stats_end_element,
@ -198,6 +214,10 @@ xml_loadsave_season_stats_read(const gchar *dirname, const gchar *prefix)
void
xml_loadsave_season_stats_write(const gchar *prefix)
{
#ifdef DEBUG
printf("xml_loadsave_season_stats_write\n");
#endif
gint i, j;
gchar buf[SMALL];
FILE *fil = NULL;

View File

@ -50,6 +50,10 @@ xml_loadsave_table_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_table_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -82,6 +86,10 @@ xml_loadsave_table_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_table_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_NAME ||
@ -113,6 +121,10 @@ xml_loadsave_table_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_table_text\n");
#endif
gchar buf[SMALL];
gint int_value = -1;
@ -141,6 +153,10 @@ xml_loadsave_table_text (GMarkupParseContext *context,
void
xml_loadsave_table_read(const gchar *filename, Table *table)
{
#ifdef DEBUG
printf("xml_loadsave_table_read\n");
#endif
GMarkupParser parser = {xml_loadsave_table_start_element,
xml_loadsave_table_end_element,
xml_loadsave_table_text, NULL, NULL};
@ -176,6 +192,10 @@ xml_loadsave_table_read(const gchar *filename, Table *table)
void
xml_loadsave_table_write(const gchar *filename, const Table *table)
{
#ifdef DEBUG
printf("xml_loadsave_table_write\n");
#endif
gint i, j;
FILE *fil = NULL;

View File

@ -68,6 +68,10 @@ xml_loadsave_teams_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_teams_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -106,6 +110,10 @@ xml_loadsave_teams_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_teams_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_TEAM)
@ -151,6 +159,10 @@ xml_loadsave_teams_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_teams_text\n");
#endif
gchar buf[SMALL];
gint int_value = -1;
gfloat float_value = -1;
@ -202,6 +214,10 @@ xml_loadsave_teams_text (GMarkupParseContext *context,
void
xml_loadsave_teams_read(const gchar *filename, GArray *teams)
{
#ifdef DEBUG
printf("xml_loadsave_teams_read\n");
#endif
gint i, j;
GMarkupParser parser = {xml_loadsave_teams_start_element,
xml_loadsave_teams_end_element,
@ -243,6 +259,10 @@ xml_loadsave_teams_read(const gchar *filename, GArray *teams)
void
xml_loadsave_teams_write(const gchar *filename, const GArray *teams)
{
#ifdef DEBUG
printf("xml_loadsave_teams_write\n");
#endif
gint i;
FILE *fil = NULL;
@ -260,6 +280,10 @@ xml_loadsave_teams_write(const gchar *filename, const GArray *teams)
void
xml_loadsave_teams_write_team(FILE *fil, const Team* team)
{
#ifdef DEBUG
printf("xml_loadsave_teams_write_team\n");
#endif
fprintf(fil, "<_%d>\n", TAG_TEAM);
xml_write_string(fil, team->name, TAG_NAME, I1);

View File

@ -58,6 +58,10 @@ xml_loadsave_transfers_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_transfers_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -93,6 +97,10 @@ xml_loadsave_transfers_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_transfers_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_TRANSFER)
@ -132,6 +140,10 @@ xml_loadsave_transfers_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_transfers_text\n");
#endif
gchar buf[SMALL];
gint int_value = -1;
@ -163,6 +175,10 @@ xml_loadsave_transfers_text (GMarkupParseContext *context,
void
xml_loadsave_transfers_read(const gchar *filename)
{
#ifdef DEBUG
printf("xml_loadsave_transfers_read\n");
#endif
GMarkupParser parser = {xml_loadsave_transfers_start_element,
xml_loadsave_transfers_end_element,
xml_loadsave_transfers_text, NULL, NULL};
@ -196,6 +212,10 @@ xml_loadsave_transfers_read(const gchar *filename)
void
xml_loadsave_transfers_write(const gchar *prefix)
{
#ifdef DEBUG
printf("xml_loadsave_transfers_write\n");
#endif
gint i, j;
gchar buf[SMALL];
FILE *fil = NULL;

View File

@ -94,6 +94,10 @@ xml_loadsave_users_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_users_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -156,6 +160,10 @@ xml_loadsave_users_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_users_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_USER)
@ -252,6 +260,10 @@ xml_loadsave_users_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_loadsave_users_text\n");
#endif
gchar buf[SMALL];
gint int_value = -1;
gfloat float_value = -1;
@ -342,6 +354,10 @@ xml_loadsave_users_text (GMarkupParseContext *context,
void
xml_loadsave_users_read(const gchar *dirname, const gchar *basename)
{
#ifdef DEBUG
printf("xml_loadsave_users_read\n");
#endif
GMarkupParser parser = {xml_loadsave_users_start_element,
xml_loadsave_users_end_element,
xml_loadsave_users_text, NULL, NULL};
@ -378,6 +394,10 @@ xml_loadsave_users_read(const gchar *dirname, const gchar *basename)
void
xml_loadsave_users_write(const gchar *prefix)
{
#ifdef DEBUG
printf("xml_loadsave_users_write\n");
#endif
gint i, j, k;
gchar buf[SMALL];
FILE *fil = NULL;
@ -461,6 +481,10 @@ xml_loadsave_users_write(const gchar *prefix)
void
xml_user_write_history(FILE *fil, const GArray *history)
{
#ifdef DEBUG
printf("xml_user_write_history\n");
#endif
gint i, j;
for(i=0;i<history->len;i++)
@ -490,6 +514,10 @@ xml_user_write_history(FILE *fil, const GArray *history)
void
xml_user_write_events(FILE *fil, const GArray *events)
{
#ifdef DEBUG
printf("xml_user_write_events\n");
#endif
gint i;
for(i=0;i<events->len;i++)
@ -513,6 +541,10 @@ xml_user_write_events(FILE *fil, const GArray *events)
void
xml_user_write_bets(FILE *fil, GArray **bets)
{
#ifdef DEBUG
printf("xml_user_write_bets\n");
#endif
gint i, j;
for(i=0;i<2;i++)

View File

@ -60,6 +60,10 @@ xml_mmatches_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_mmatches_start_element\n");
#endif
gint i;
gint tag = xml_get_tag_from_name(element_name);
gboolean valid_tag = FALSE;
@ -85,6 +89,10 @@ xml_mmatches_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_mmatches_end_element\n");
#endif
gint tag = xml_get_tag_from_name(element_name);
if(tag == TAG_MMATCH)
@ -110,6 +118,10 @@ xml_mmatches_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_mmatches_text\n");
#endif
gchar buf[SMALL], lg_file[SMALL];
gint int_value = -1;
@ -139,6 +151,10 @@ xml_mmatches_text (GMarkupParseContext *context,
void
xml_mmatches_read(const gchar *filename, GArray *mmatches)
{
#ifdef DEBUG
printf("xml_mmatches_read\n");
#endif
GMarkupParser parser = {xml_mmatches_start_element,
xml_mmatches_end_element,
xml_mmatches_text, NULL, NULL};
@ -178,6 +194,10 @@ xml_mmatches_read(const gchar *filename, GArray *mmatches)
void
xml_mmatches_write(const gchar *prefix, const GArray *mmatches)
{
#ifdef DEBUG
printf("xml_mmatches_write\n");
#endif
FILE *fil;
gint i;
gchar buf[SMALL];

View File

@ -56,6 +56,10 @@ xml_name_read_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_name_read_start_element\n");
#endif
if(strcmp(element_name, TAG_NAMES) == 0)
state = STATE_NAMES;
else if(strcmp(element_name, TAG_FIRST_NAME) == 0)
@ -74,6 +78,10 @@ xml_name_read_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_name_read_end_element\n");
#endif
if(strcmp(element_name, TAG_FIRST_NAME) == 0 ||
strcmp(element_name, TAG_LAST_NAME) == 0)
state = STATE_NAMES;
@ -90,6 +98,10 @@ xml_name_read_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_name_read_text\n");
#endif
gchar buf[text_len + 1];
strncpy(buf, text, text_len);
@ -108,6 +120,10 @@ xml_name_read_text (GMarkupParseContext *context,
void
xml_name_read(const gchar *sid, NameList *namelist)
{
#ifdef DEBUG
printf("xml_name_read\n");
#endif
gchar *file_name = NULL;
GMarkupParser parser = {xml_name_read_start_element,
xml_name_read_end_element,

View File

@ -105,6 +105,10 @@ xml_strategy_read_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_strategy_read_start_element\n");
#endif
gint atidx = 0;
if(strcmp(element_name, TAG_STRATEGY) == 0)
@ -283,6 +287,10 @@ xml_strategy_read_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_strategy_read_end_element\n");
#endif
if(strcmp(element_name, TAG_STRATEGY_SID) == 0 ||
strcmp(element_name, TAG_STRATEGY_DESC) == 0 ||
strcmp(element_name, TAG_STRATEGY_PRIORITY) == 0 ||
@ -319,6 +327,10 @@ xml_strategy_read_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_strategy_read_text\n");
#endif
gchar buf[text_len + 1];
gint int_value;
@ -463,6 +475,10 @@ xml_strategy_read_text (GMarkupParseContext *context,
void
xml_strategy_read(const gchar *filename)
{
#ifdef DEBUG
printf("xml_strategy_read\n");
#endif
gint i;
Strategy new_strat;
GMarkupParser parser = {xml_strategy_read_start_element,
@ -516,6 +532,10 @@ xml_strategy_read(const gchar *filename)
void
xml_strategy_load_strategies(void)
{
#ifdef DEBUG
printf("xml_strategy_load_strategies\n");
#endif
gint i, j, k;
const gchar *strategydir = file_get_first_support_dir_suffix("strategy");
GPtrArray *files = NULL;

View File

@ -83,6 +83,10 @@ xml_team_read_start_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_team_read_start_element\n");
#endif
if(strcmp(element_name, TAG_TEAM) == 0)
state = STATE_TEAM;
else if(strcmp(element_name, TAG_TEAM_NAME) == 0)
@ -131,6 +135,10 @@ xml_team_read_end_element (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_team_read_end_element\n");
#endif
if(strcmp(element_name, TAG_TEAM_NAME) == 0 ||
strcmp(element_name, TAG_STADIUM_NAME) == 0 ||
strcmp(element_name, TAG_SYMBOL) == 0 ||
@ -178,6 +186,10 @@ xml_team_read_text (GMarkupParseContext *context,
gpointer user_data,
GError **error)
{
#ifdef DEBUG
printf("xml_team_read_text\n");
#endif
gchar buf[text_len + 1];
gint int_value;
gfloat float_value;
@ -224,6 +236,10 @@ xml_team_read_text (GMarkupParseContext *context,
void
xml_team_read(Team *tm, const gchar *def_file)
{
#ifdef DEBUG
printf("xml_team_read\n");
#endif
GMarkupParser parser = {xml_team_read_start_element,
xml_team_read_end_element,
xml_team_read_text, NULL, NULL};

View File

@ -37,6 +37,10 @@
void
youth_academy_new(User *user)
{
#ifdef DEBUG
printf("youth_academy_new\n");
#endif
gint i;
gint num_of_youths = math_rndi(const_int("int_youth_academy_youths_lower"),
const_int("int_youth_academy_youths_upper"));
@ -67,6 +71,10 @@ youth_academy_new(User *user)
void
youth_academy_add_new_player(YouthAcademy *youth_academy)
{
#ifdef DEBUG
printf("youth_academy_add_new_player\n");
#endif
gint i;
gfloat pos_probs[4] =
{const_float("float_youth_academy_pos_goalie"),
@ -171,6 +179,10 @@ youth_academy_add_new_player(YouthAcademy *youth_academy)
void
youth_academy_update_weekly(void)
{
#ifdef DEBUG
printf("youth_academy_update_weekly\n");
#endif
gint i, j;
YouthAcademy *ya = NULL;