Change Windows startup

remove the safeproc pseudo-windowport routines from
almost a decade ago.

A very early pass is made through the config file,
seeking out just the interface-related OPTIONS=windowport
and OPTIONS=soundlib and ignoring all other options in the
config file during that early pass, so the windowport
can be activated without the NetHack core initialization
in place that some of the other rcfile OPTIONS require.

Bundles the existing rcfile processing code into rcfile().

New functions to control which rcfile options will be
disregarded in the early config file pass, and which will be
processed:

    set_all_options_disregarded();
    set_all_options_heeded();
    disregard_this_option(opt_xx);
    heed_this_option(opt_xx);

Windows calls rcfile_interface_options(), which is
a bundling of a series of function calls to achieve
the desired result.

    void
    rcfile_interface_options(void)
    {
        allopt_array_init();
        set_all_options_disregarded();
        heed_this_option(opt_windowtype);
        heed_this_option(opt_soundlib);
        rcfile();
        set_all_options_heeded();
        disregard_this_option(opt_windowtype);
        disregard_this_option(opt_soundlib);
    }
This commit is contained in:
nhmall
2026-04-05 11:36:19 -04:00
parent 92340a6827
commit acb85b18cf
23 changed files with 450 additions and 959 deletions

View File

@@ -415,79 +415,4 @@ struct chain_procs {
};
#endif /* WINCHAIN */
#ifdef SAFEPROCS
/*
* window port routines available in sys/share/safeproc.c
*/
extern struct window_procs *get_safe_procs(int);
extern void safe_init_nhwindows(int *, char **);
extern void safe_player_selection(void);
extern void safe_askname(void);
extern void safe_get_nh_event(void);
extern void safe_exit_nhwindows(const char *);
extern void safe_suspend_nhwindows(const char *);
extern void safe_resume_nhwindows(void);
extern winid safe_create_nhwindow(int);
extern void safe_clear_nhwindow(winid);
extern void safe_display_nhwindow(winid, boolean);
extern void safe_destroy_nhwindow(winid);
extern void safe_curs(winid, int, int);
extern void safe_putstr(winid, int, const char *);
extern void safe_putmixed(winid, int, const char *);
extern void safe_display_file(const char *, boolean);
extern void safe_start_menu(winid, unsigned long);
extern void safe_add_menu(winid, const glyph_info *, const ANY_P *,
char, char, int, int, const char *,
unsigned int);
extern void safe_end_menu(winid, const char *);
extern int safe_select_menu(winid, int, MENU_ITEM_P **);
extern char safe_message_menu(char, int, const char *);
extern void safe_mark_synch(void);
extern void safe_wait_synch(void);
#ifdef CLIPPING
extern void safe_cliparound(int, int);
#endif
#ifdef POSITIONBAR
extern void safe_update_positionbar(char *);
#endif
extern void safe_print_glyph(winid, coordxy, coordxy,
const glyph_info *, const glyph_info *);
extern void safe_raw_print(const char *);
extern void safe_raw_print_bold(const char *);
extern int safe_nhgetch(void);
extern int safe_nh_poskey(coordxy *, coordxy *, int *);
extern void safe_nhbell(void);
extern int safe_doprev_message(void);
extern char safe_yn_function(const char *, const char *, char);
extern void safe_getlin(const char *, char *);
extern int safe_get_ext_cmd(void);
extern void safe_number_pad(int);
extern void safe_delay_output(void);
#ifdef CHANGE_COLOR
extern void safe_change_color(int, long, int);
#ifdef MAC
extern void safe_change_background(int);
extern short safe_set_font_name(winid, char *);
#endif
extern char *safe_get_color_string(void);
#endif
extern void safe_outrip(winid, int, time_t);
extern void safe_preference_update(const char *);
extern char *safe_getmsghistory(boolean);
extern void safe_putmsghistory(const char *, boolean);
extern void safe_status_init(void);
extern void safe_status_finish(void);
extern void safe_status_enablefield(int, const char *, const char *,
boolean);
extern void safe_status_update(int, genericptr_t, int, int, int,
unsigned long *);
extern boolean safe_can_suspend(void);
extern void stdio_raw_print(const char *);
extern void stdio_nonl_raw_print(const char *);
extern void stdio_raw_print_bold(const char *);
extern void stdio_wait_synch(void);
extern void safe_update_inventory(int);
extern win_request_info *safe_ctrl_nhwindow(winid, int, win_request_info *);
extern int stdio_nhgetch(void);
#endif /* SAFEPROCS */
#endif /* WINPROCS_H */