The last pass for the cleanup, covering function declarations. This is (hopefully) also the last big post for this topic.
Any of the functions listed below is only used in the corresponding .c file. I haven't touched any function declaration that is called from more than one file.
For each file affected, I list the functions that will be removed from the header file (in bold-face) and after that all the other functions in the resp. C file, that use (call) the particular function. Some functions are currently unused, they are marked with [uNUSED] after their name, other don't even have an implementation, they will be marked with [uNUSED/NO-IMPL]. For those functions that are unused, I have commented the implementation in the corresponding .c file as well. For some functions I had to add a forward declaration to the .c file to keep the compiler happy, those have an additional mark [FW].
I have omitted the file books.h for now.
2d_objects.h:
void draw_2d_object(): display_2d_objects()
obj_2d_def* load_obj_2d_def(): load_obj_2d_def_cache()
obj_2d_def* load_obj_def_cache(): add_2d_obj()
3d_objects.h:
e3d_object* load_e3d()[FW]: load_e3d_cache()
e3d_object* load_e3d_cache(): add_e3d()
void compute_clouds_map()[FW]: draw_3d_object()
actor_scripts.h:
float unwindAngle_Degrees(): next_command()
float get_rotation_vector(): next_command()
void update_all_actors(): add_command_to_actor()
actors.h:
int add_actor(): add_actor_from_server()
void draw_actor(): display_actors()
void end_actors_list()[uNUSED]: commented implementation in actors.c
draw_actor_overtext()[FW]: draw_actor_banner()
asc.h:
Sint32 get_string_after_string()[uNUSED]: commented implemenation in asc.c
void get_file_digest()[uNUSED]: commented implementation in asc.c
void get_string_digest()[uNUSED]: commented implemenation in asc.c
void my_UTF8Toisolat1()[FW]: my_xmlStrncpy()
buddy.h:
int compare2(): display_buddy_handler()
int click_buddy_handler(): display_buddy()
int display_buddy_handler(): display_buddy()
int drag_buddy_handler(): display_buddy()
cache.h:
void cache_system_shutdown()[uNUSED]: commented implemenation in cache.c
Uint32 cache_system_clean()[FW]: cache_system_maint()
Uint32 cache_system_compact(): cache_system_maint()
void cache_set_free()[uNUSED]: commented implementation in cache.c
Uint32 cache_clean()[FW]: cache_system_clean()
Uint32 cache_compact()[FW]: cache_system_compact()
void cache_delete()[FW]: cache_system_init(), cache_system_shutdown()
void cache_clear_counter()[uNUSED]: commented implementation in cache.c
void cache_set_size()[uNUSED]: commented implementation in cache.c
void cache_use_item()[uNUSED]: commented implementation in cache.c
cache_item_struct* cache_find(): cache_find_item(), cache_remove_item()
cache_item_struct* cache_find_ptr()[FW]: cache_adj_size(), cache_delete(), cache_set_name(), cache_set_size() and cache_use_item()
void cache_remove()[FW]: cache_clean(), cache_delete(), cache_remove_all(), cache_remove_item() and cache_remove_unused()
void cache_remove_item()[uNUSED]: commented implemenation in cache.c
void cache_remove_all()[FW]: cache_delete()
void cache_remove_unused()[uNUSED]: commented implementation in cache.c
console.h:
void cls(): test_for_console_command()
void print_log()[uNUSED]: commented implementation in console.c
cursors.h:
void assign_cursor(): build_cursors()
void change_cursor_show()[uNUSED]: commented implemenation in cursors.c
draw_scene.h:
void get_tmp_actor_data()[FW]: draw_scene()
elwindows.h:
int find_window()[uNUSED]: commented implementation in elwindows.c
void* get_window_handler()[uNUSED]: commented implementation in elwindows.c
int display_window()[FW]: display_windows()
int drag_in_window()[FW]: drag_in_windows()
int mouseover_window()[FW]: draw_window()
int keypress_in_window()[FW]: keypress_in_windows()
int draw_window(): display_window()
int draw_window_title(): draw_window()
int draw_window_base()[uNUSED/NO-IMPL]:
Note, there's a function called draw_window_border() implemented in elwindows.c, maybe this is a typo? But even then, it will be commented, because it is only used by draw_window()
encyclopedia.h:
int encyclopedia_mouse_over()[uNUSED/NO-IMPL]
void ReadCategoryXML(): ReadIndexXML()
void ReadIndexXML(): ReadXML()
events.h:
Uint32 event_timer()[uNUSED/NO-IMPL]
filter.h:
int check_if_filtered(): filter_text()
void load_filters_list(): load_filters()
void clear_filter_list(): load_filters()
font.h:
int draw_char_scaled(): draw_string_small(), draw_string_zoomed() and draw_string_zoomed_clipped()
int get_font_char()[FW]: find_font_char() and get_char_width()
int find_font_char(): draw_char_scaled() and draw_ingame_string()
int get_font_width()[FW]: draw_char_scaled(), draw_ingame_string(), get_char_width() and reset_soft_breaks()
int get_nstring_width()[FW]: get_string_width()
int set_font_parameters()[FW]: init_fonts()
void remove_font()[uNUSED]: commented implementation in font.c
gl_init.h:
void check_gl_mode(): init_video()
help.h:
int display_help_handler(): fill_help_win()
int click_help_handler(): fill_help_win()
hud.h:
void init_hud_frame()[FW]: init_hud_interface()
void init_peace_icons()[FW]: init_hud_interface()
int check_peace_icons()[uNUSED]: commented implementation in hud.c
void add_icon()[FW]: init_peace_icons()
void set_icon_order()[uNUSED/NO-IMPL]
void reset_states()[uNUSED/NO-IMPL]
int translate_win_id()[uNUSED]: commented implementation in hud.c
void switch_action_mode()[FW]: init_peace_icons()
void init_stats_display()[FW]: init_hud_interface()
int check_stats_display()[uNUSED]: commented implementation in hud.c
void draw_exp_display()[FW]: display_stats_bar_handler()
void draw_stats()[FW]: display_misc_handler()
void init_misc_display()[FW]: init_hud_interface()
int check_misc_display()[uNUSED]: commented implementation in hud.c
void init_quickbar()[FW]: init_hud_interface()
void draw_quickbar()[uNUSED]: commented implementation in hud.c
int check_quickbar()[uNUSED]: commented implementation in hud.c
void flip_quickbar()[FW]: click_quickbar_handler()
void reset_quickbar()[FW]: click_quickbar_handler()
void change_flags()[FW]: click_quickbar_handler(), draw_quickbar() and reset_quickbar()
Uint32 get_flags()[FW]: click_quickbar_handler()
ignore.h:
int check_if_ignored(): pre_check_if_ignored()
void load_ignores_list(): load_ignores()
void clear_ignore_list(): load_ignores()
init.h:
void load_harvestable_list(), void load_entrable_list(), void read_config(), void read_bin_cfg(), void init_md2_cache(), void init_texture_cache(), void init_e3d_cache(), void init_2d_obj_cache(), void load_e3d_list(), void read_command_line[FW]: init_stuff()
interface.h:
void draw_menu_title_bar()[uNUSED]: commented implementation in interface.c
items.h:
void draw_pick_up_menu()[FW]: get_bags_items_list()
keys.h:
unsigned int CRC32()[FW]: get_key_code()
unsigned short get_key_code()[FW]: parse_key_string()
unsigned int parse_key_string()[FW]: read_key_config()
void add_key()[FW]: parse_key_string()
lights.h:
void draw_test_light()[uNUSED]: commented implementation in lights.c
void enable_local_lights(): new_minute()
void make_gradient_light(): build_global_lights_table()
map_io.h:
void destroy_map(): load_map() and new_map()
int save_map()[uNUSED]: commented implementation in map_io.c
void new_map()[uNUSED]: commented implementation in map_io.c
md2.h:
md2* load_md2()[FW]: load_md2_cache() {md2loader.c}
void free_md2(): destory_md2() {md2loader.c}
misc.h:
void project_ortho(): mouse_in_sphere()
multiplayer.h:
void send_version_to_server(): connect_to_server()
void process_message_from_server(): process_data_from_server()
int recvpacket()[uNUSED/NO-IMPL]
void get_update()[uNUSED]: commented implementation in multiplayer.c
new_actors.h:
void draw_body_part()[uNUSED/NO-IMPL]
int add_enhanced_actor(): add_enhanced_actor_from_server()
new_character.h:
void check_for_input(): draw_new_char_screen()
void add_char_2_pass(), void add_char_2_un(), void add_char_2_conf(): add_char_to_new_character()
options.h:
void init_display_options_menu()[FW]: display_options_menu()
void add_option()[FW], void change_option()[FW], void move_to_full_screen()[FW] void switch_video_modes()[FW], void change_sound()[FW], void change_music()[FW]: init_display_options_menu()
particles.h:
void destroy_all_particle_defs()[FW]: end_particles_list()
int create_particle_sys()[FW]: add_particles_sys()
void create_particle(): create_particles_sys(), update_bag_part_sys(), update_fire_sys(), update_fountain_sys(), update_teleport_sys() and update_teleporter_sys()
void update_teleporter_sys(), void update_fire_sys(), void update_teleport_sys(), void update_bag_part_sys(), void update_burst_sys(), void update_fountain_sys(): update_particles()
void dump_part_sys_info()[uNUSED]: commented implementation in particles.c
int save_particle_def(): added conditional compilation directive MAP_EDITOR. Seems to be only used by mapeditor.(?)
pathfinder.h:
PF_TILE* pf_get_tile(): pf_find_path() and pf_move()
PF_TILE* pf_get_next_open_tile(): pf_find_path()
void pf_add_tile_to_open_list(): pf_find_path()
int pf_is_tile_occupied()[FW]: pf_move()
Uint32 pf_movement_timer_callback()[FW]: pf_find_path()
pm_log.h:
void add_name_to_pm_log(): add_message_to_pm_log() and send_afk_message()
void print_return_message()[FW]: go_ifk()
int have_name(): add_message_to_pm_log() and send_afk_message()
questlog.h:
void add_questlog_line()[FW]: add_questlog() and load_questlog()
void string_fix(): add_questlog()
reflection.h
float mrandom(): make_lake_water_noise()
void draw_body_part_reflection()[uNUSED/NO-IMPL]
void draw_actor_reflection(), void draw_enhanced_actor_reflection(), void draw_3d_reflection(), int find_local_reflection: display_3d_reflection()
void draw_lake_water_tile(): draw_lake_tiles()
rules.h:
void free_rules()[FW]: cleanup_rules(), init_rules_interface() and toggle_rules_window()
rule_string* get_interface_rules()[FW]: init_rules_interface() and toggle_rules_window()
void check_mouse_rules_interface()[FW]: draw_rules_interface() and mouseover_rules_handler()
int draw_rules()[FW]: display_rules_handler() and draw_rules_interface()
void reset_rules(): get_interface_rules() and highlight_rule()
sector.h:
int sector_add_2do(): sector_add_map()
int sector_add_light()[uNUSED]: commented implementation in sector.c
shadows.h:
void draw_3d_object_shadow(): display_shadows()
void draw_body_part_shadow()[uNUSED/NO-IMPL]
void draw_enhanced_actor_shadow(), void draw_actor_shadow(): display_actors_shadow()
void display_actors_shadow(): display_shadows()
void display_shadows(): draw_sun_shadowed_scene() and render_light_view()
void display_3d_ground_objects(), display_3d_non_ground_objects(): draw_sun_shadowed_scene()
sound.h:
int realloc_sources[FW]: add_sound_object() and kill_local_sounds()
ALuint get_loaded_buffer(): add_sound_object()
void play_ogg_file(): play_music() and update_music()
void load_ogg_file()[FW]: play_ogg_file()
void stream_music()[FW]: play_ogg_file() and update_music()
void ogg_error()[FW]: stream_music()
text.h:
void put_small_colored_text_in_box()[FW]: put_small_text_in_box()
int find_last_console_lines(): display_console_text()
textures.h
char* load_bmp8_color_key_no_texture()[uNUSED]: commented implementation in textures.c
char* load_bmp8_alpha_map()[uNUSED]: commented implementation in textures.c
void load_bmp8_to_coordinates(): load_bmp8_enhanced_actor()
translate.h:
void init_console()[FW], void init_help()[FW], void init_options()[FW], void init_spells()[FW], void init_stats()[FW], void init_titles()[FW], void init_errors()[FW]: init_translatables()
void* add_xml_group()[FW]: init_groups()
void add_xml_distringid(): init_options() and init_spells()
void add_xml_statid(): init_stats()
void add_xml_identifier(): init_console(), init_errors(), init_help(), init_stats() and init_titles()
void free_xml_parser()[FW]: load_translatables()
void parse_errors()[FW], void parse_console()[FW], void parse_help()[FW], void parse_options()[FW], void parse_spells()[FW], void parse_stats()[FW], void parse_titles()[FW]: load_translatables()
void save_string(): load_translatables()
struct xml_struct load_string()[FW]: load_translatables()
struct xml_struct load_strings_file()[FW]: load_string()
void copy_strings(): parse_distrings()
void copy_stats(): parse_statstrings()
void parse_statstrings(), void parse_distrings(), void parse_strings(): parse_groups()
void parse_groups(): parse_console(), parse_errors(), parse_help(), parse_options(), parse_spells(), parse_stats() and parse_titles()
widgets.h:
int ReadXMLWindow()[FW]: AddXMLWindow()
int ParseWindow()[FW]: ReadXMLWindow()
int ParseWidget()[FW]: ParseTab() and ParseWindow()
int ParseTab()[FW]: ParseWidget()
int GetWidgetType()[FW]: ParseWidget()
I have omitted the rest of widgets.h, although most of the functions declared there are currently not used. But they are under heavy development completing the window manager. So I was thinking we should wait until this is finished, then we can have a look at this file once more and see what can be changed.
I marked any function with an "OBSOLETE declaration" comment to show the queued removal of those declarations.
There are quite some unused functions. Although I have commented the implementation of them in the C files, I think we should keep them at least for another 6 month, until they might be considered for removal. Some of them could already be implemented for future extensions.
Any objections or comments about this?