Core game initialisation for UNIX (and other) machines. More...
|static int||init_sound_dummy (int argc, char *argv)|
|static void||quit_hook (const char *s)|
|A hook for "quit()". |
|static void||init_stuff (void)|
|SDL needs a look-in. |
|static void||change_path (const char *info)|
|Handle a "-d<dir>=<path>" option. |
|static void||user_name (char *buf, size_t len, int id)|
|Find a default user name from the system. |
|static void||list_saves (void)|
|List all savefiles this player can access. |
|static void||debug_opt (const char *arg)|
|int||main (int argc, char *argv)|
|Simple "main" function for multiple platforms. |
|static struct module||modules |
|locale junk |
|static struct module||sound_modules |
|List of sound modules in the order they should be tried. |
|const char * name|
|char ** path|
Core game initialisation for UNIX (and other) machines.
Copyright (c) 1997 Ben Harrison, and others
This work is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation, version 2, or
b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.
Handle a "-d<dir>=<path>" option.
Sets any of angband's special directories to <path>.
The "<path>" can be any legal path for the given system, and should not end in any special path separator (i.e. "/tmp" or "~/.ang-info").
Referenced by main().
SDL needs a look-in.
Initialize and verify the file paths, and the score file.
Use the ANGBAND_PATH environment var if possible, else use DEFAULT_PATH, and in either case, branch off appropriately.
First, we'll look for the ANGBAND_PATH environment variable, and then look for the files in there. If that doesn't work, we'll try the DEFAULT_PATH constants. So be sure that one of these two things works...
We must ensure that the path ends with "PATH_SEP" if needed, since the "init_file_paths()" function will simply append the relevant "sub-directory names" to the given path.
Make sure that the path doesn't overflow the buffer. We have to leave enough space for the path separator, directory, and filenames.
Referenced by main().
Simple "main" function for multiple platforms.
Note the special "–" option which terminates the processing of standard options. All non-standard options (if any) are passed directly to the "init_xxx()" function.
References ANGBAND_SYS, arg_graphics, arg_power, arg_rebalance, arg_wizard, argv0, change_path(), change_path_values, cleanup_angband(), cmd_get_hook, create_needed_dirs(), debug_opt(), FALSE, player_other::full_name, i, init_angband(), init_display(), init_stuff(), int, list_saves(), my_strcpy(), N_ELEMENTS, module::name, new_game, op_ptr, path, pause_line(), play_game(), player_egid, player_safe_name(), player_uid, quit(), quit_aux, quit_hook(), safe_setuid_drop(), savefile_set_name(), setgid_ok, signals_init(), streq, Term, textui_cleanup(), textui_get_cmd(), textui_init(), TRUE, user_name(), and void().
Some machines have a "main()" function in their "main-xxx.c" file, all the others use this file for their "main()" function. List of the available modules in the order they are tried.