there was some left-over k&r code in win/chain

This commit is contained in:
nhmall
2022-02-07 14:58:16 -05:00
parent 96c71660c6
commit 5ac860bdc7
5 changed files with 695 additions and 514 deletions
+4 -3
View File
@@ -318,6 +318,7 @@ struct chain_procs {
* '+' are reserved for processors. */ * '+' are reserved for processors. */
unsigned long wincap; /* window port capability options supported */ unsigned long wincap; /* window port capability options supported */
unsigned long wincap2; /* additional window port capability options */ unsigned long wincap2; /* additional window port capability options */
boolean has_color[CLR_MAX];
void (*win_init_nhwindows)(CARGS, int *, char **); void (*win_init_nhwindows)(CARGS, int *, char **);
void (*win_player_selection)(CARGS); void (*win_player_selection)(CARGS);
void (*win_askname)(CARGS); void (*win_askname)(CARGS);
@@ -340,7 +341,7 @@ struct chain_procs {
void (*win_end_menu)(CARGS, winid, const char *); void (*win_end_menu)(CARGS, winid, const char *);
int (*win_select_menu)(CARGS, winid, int, MENU_ITEM_P **); int (*win_select_menu)(CARGS, winid, int, MENU_ITEM_P **);
char (*win_message_menu)(CARGS, char, int, const char *); char (*win_message_menu)(CARGS, char, int, const char *);
void (*win_update_inventory)(CARGS); void (*win_update_inventory)(CARGS, int);
void (*win_mark_synch)(CARGS); void (*win_mark_synch)(CARGS);
void (*win_wait_synch)(CARGS); void (*win_wait_synch)(CARGS);
#ifdef CLIPPING #ifdef CLIPPING
@@ -358,7 +359,7 @@ struct chain_procs {
int (*win_nh_poskey)(CARGS, int *, int *, int *); int (*win_nh_poskey)(CARGS, int *, int *, int *);
void (*win_nhbell)(CARGS); void (*win_nhbell)(CARGS);
int (*win_doprev_message)(CARGS); int (*win_doprev_message)(CARGS);
char (*win_yn_function), char (*win_yn_function)
(CARGS, const char *, const char *, char); (CARGS, const char *, const char *, char);
void (*win_getlin)(CARGS, const char *, char *); void (*win_getlin)(CARGS, const char *, char *);
int (*win_get_ext_cmd)(CARGS); int (*win_get_ext_cmd)(CARGS);
@@ -383,7 +384,7 @@ struct chain_procs {
void (*win_putmsghistory)(CARGS, const char *, boolean); void (*win_putmsghistory)(CARGS, const char *, boolean);
void (*win_status_init)(CARGS); void (*win_status_init)(CARGS);
void (*win_status_finish)(CARGS); void (*win_status_finish)(CARGS);
void (*win_status_enablefield), void (*win_status_enablefield)
(CARGS, int, const char *, const char *, boolean); (CARGS, int, const char *, const char *, boolean);
void (*win_status_update)(CARGS, int, genericptr_t, int, int, int, void (*win_status_update)(CARGS, int, genericptr_t, int, int, int,
unsigned long *); unsigned long *);
+1 -1
View File
@@ -3724,7 +3724,7 @@ optfn_windowborders(
#ifdef WINCHAIN #ifdef WINCHAIN
static int static int
optfn_windowchain(int optidx, int req, boolean negated, char *opts, char *op) optfn_windowchain(int optidx, int req, boolean negated UNUSED, char *opts, char *op)
{ {
if (req == do_init) { if (req == do_init) {
return optn_ok; return optn_ok;
+201 -135
View File
@@ -7,6 +7,78 @@
#include "hack.h" #include "hack.h"
void chainin_init_nhwindows(int *, char **);
void chainin_player_selection(void);
void chainin_askname(void);
void chainin_get_nh_event(void);
void chainin_exit_nhwindows(const char *);
void chainin_suspend_nhwindows(const char *);
void chainin_resume_nhwindows(void);
winid chainin_create_nhwindow(int);
void chainin_clear_nhwindow(winid);
void chainin_display_nhwindow(winid, boolean);
void chainin_destroy_nhwindow(winid);
void chainin_curs(winid, int, int);
void chainin_putstr(winid, int, const char *);
void chainin_putmixed(winid, int, const char *);
void chainin_display_file(const char *, boolean);
void chainin_start_menu(winid, unsigned long);
void chainin_add_menu(winid, const glyph_info *, const ANY_P *,
char, char, int,
const char *, unsigned int);
void chainin_end_menu(winid, const char *);
int chainin_select_menu(winid, int, MENU_ITEM_P **);
char chainin_message_menu(char, int, const char *);
void chainin_update_inventory(int);
void chainin_mark_synch(void);
void chainin_wait_synch(void);
#ifdef CLIPPING
void chainin_cliparound(int, int);
#endif
#ifdef POSITIONBAR
void chainin_update_positionbar(char *);
#endif
void chainin_print_glyph(winid, xchar, xchar,
const glyph_info *, const glyph_info *);
void chainin_raw_print(const char *);
void chainin_raw_print_bold(const char *);
int chainin_nhgetch(void);
int chainin_nh_poskey(int *, int *, int *);
void chainin_nhbell(void);
int chainin_doprev_message(void);
char chainin_yn_function(const char *, const char *, char);
void chainin_getlin(const char *, char *);
int chainin_get_ext_cmd(void);
void chainin_number_pad(int);
void chainin_delay_output(void);
#ifdef CHANGE_COLOR
void chainin_change_color(int, long, int);
#ifdef MAC
void chainin_change_background(int);
short chainin_set_font_name(winid, char *);
#endif
char *chainin_get_color_string(void);
#endif
/* other defs that really should go away (they're tty specific) */
void chainin_start_screen(void);
void chainin_end_screen(void);
void chainin_outrip(winid, int, time_t);
void chainin_preference_update(const char *);
char *chainin_getmsghistory(boolean);
void chainin_putmsghistory(const char *, boolean);
void chainin_status_init(void);
void chainin_status_finish(void);
void chainin_status_enablefield(int, const char *, const char *,
boolean);
void chainin_status_update(int, genericptr_t, int, int, int,
unsigned long *);
boolean chainin_can_suspend(void);
void *chainin_procs_chain(int cmd, int n, void *me, void *nextprocs, void *nextdata);
void chainin_procs_init(int dir);
struct chainin_data { struct chainin_data {
struct chain_procs *nprocs; struct chain_procs *nprocs;
void *ndata; void *ndata;
@@ -20,12 +92,12 @@ struct chainin_data {
static struct chainin_data *cibase; static struct chainin_data *cibase;
void * void *
chainin_procs_chain(cmd, n, me, nextprocs, nextdata) chainin_procs_chain(
int cmd; int cmd,
int n; int n,
void *me; void *me,
void *nextprocs; void *nextprocs,
void *nextdata; void *nextdata)
{ {
struct chainin_data *tdp = 0; struct chainin_data *tdp = 0;
@@ -51,8 +123,8 @@ void *nextdata;
/* XXX if we don't need this, take it out of the table */ /* XXX if we don't need this, take it out of the table */
void void
chainin_procs_init(dir) chainin_procs_init(
int dir UNUSED; int dir UNUSED)
{ {
} }
@@ -61,54 +133,54 @@ int dir UNUSED;
***/ ***/
void void
chainin_init_nhwindows(argcp, argv) chainin_init_nhwindows(
int *argcp; int *argcp,
char **argv; char **argv)
{ {
(*cibase->nprocs->win_init_nhwindows)(cibase->ndata, argcp, argv); (*cibase->nprocs->win_init_nhwindows)(cibase->ndata, argcp, argv);
} }
void void
chainin_player_selection() chainin_player_selection(void)
{ {
(*cibase->nprocs->win_player_selection)(cibase->ndata); (*cibase->nprocs->win_player_selection)(cibase->ndata);
} }
void void
chainin_askname() chainin_askname(void)
{ {
(*cibase->nprocs->win_askname)(cibase->ndata); (*cibase->nprocs->win_askname)(cibase->ndata);
} }
void void
chainin_get_nh_event() chainin_get_nh_event(void)
{ {
(*cibase->nprocs->win_get_nh_event)(cibase->ndata); (*cibase->nprocs->win_get_nh_event)(cibase->ndata);
} }
void void
chainin_exit_nhwindows(str) chainin_exit_nhwindows(
const char *str; const char *str)
{ {
(*cibase->nprocs->win_exit_nhwindows)(cibase->ndata, str); (*cibase->nprocs->win_exit_nhwindows)(cibase->ndata, str);
} }
void void
chainin_suspend_nhwindows(str) chainin_suspend_nhwindows(
const char *str; const char *str)
{ {
(*cibase->nprocs->win_suspend_nhwindows)(cibase->ndata, str); (*cibase->nprocs->win_suspend_nhwindows)(cibase->ndata, str);
} }
void void
chainin_resume_nhwindows() chainin_resume_nhwindows(void)
{ {
(*cibase->nprocs->win_resume_nhwindows)(cibase->ndata); (*cibase->nprocs->win_resume_nhwindows)(cibase->ndata);
} }
winid winid
chainin_create_nhwindow(type) chainin_create_nhwindow(
int type; int type)
{ {
winid rv; winid rv;
@@ -118,80 +190,80 @@ int type;
} }
void void
chainin_clear_nhwindow(window) chainin_clear_nhwindow(
winid window; winid window)
{ {
(*cibase->nprocs->win_clear_nhwindow)(cibase->ndata, window); (*cibase->nprocs->win_clear_nhwindow)(cibase->ndata, window);
} }
void void
chainin_display_nhwindow(window, blocking) chainin_display_nhwindow(
winid window; winid window,
boolean blocking; boolean blocking)
{ {
(*cibase->nprocs->win_display_nhwindow)(cibase->ndata, window, blocking); (*cibase->nprocs->win_display_nhwindow)(cibase->ndata, window, blocking);
} }
void void
chainin_destroy_nhwindow(window) chainin_destroy_nhwindow(
winid window; winid window)
{ {
(*cibase->nprocs->win_destroy_nhwindow)(cibase->ndata, window); (*cibase->nprocs->win_destroy_nhwindow)(cibase->ndata, window);
} }
void void
chainin_curs(window, x, y) chainin_curs(
winid window; winid window,
int x; int x,
int y; int y)
{ {
(*cibase->nprocs->win_curs)(cibase->ndata, window, x, y); (*cibase->nprocs->win_curs)(cibase->ndata, window, x, y);
} }
void void
chainin_putstr(window, attr, str) chainin_putstr(
winid window; winid window,
int attr; int attr,
const char *str; const char *str)
{ {
(*cibase->nprocs->win_putstr)(cibase->ndata, window, attr, str); (*cibase->nprocs->win_putstr)(cibase->ndata, window, attr, str);
} }
void void
chainin_putmixed(window, attr, str) chainin_putmixed(
winid window; winid window,
int attr; int attr,
const char *str; const char *str)
{ {
(*cibase->nprocs->win_putmixed)(cibase->ndata, window, attr, str); (*cibase->nprocs->win_putmixed)(cibase->ndata, window, attr, str);
} }
void void
chainin_display_file(fname, complain) chainin_display_file(
const char *fname; const char *fname,
boolean complain; boolean complain)
{ {
(*cibase->nprocs->win_display_file)(cibase->ndata, fname, complain); (*cibase->nprocs->win_display_file)(cibase->ndata, fname, complain);
} }
void void
chainin_start_menu(window, mbehavior) chainin_start_menu(
winid window; winid window,
unsigned long mbehavior; unsigned long mbehavior)
{ {
(*cibase->nprocs->win_start_menu)(cibase->ndata, window, mbehavior); (*cibase->nprocs->win_start_menu)(cibase->ndata, window, mbehavior);
} }
void void
chainin_add_menu(window, glyphinfo, identifier, ch, gch, attr, str, itemflags) chainin_add_menu(
winid window; /* window to use, must be of type NHW_MENU */ winid window, /* window to use, must be of type NHW_MENU */
const glyph_info *glyphinfo; /* glyph and other glyph info to display with item */ const glyph_info *glyphinfo, /* glyph and other info to display with item */
const anything *identifier; /* what to return if selected */ const anything *identifier, /* what to return if selected */
char ch; /* keyboard accelerator (0 = pick our own) */ char ch, /* keyboard accelerator (0 = pick our own) */
char gch; /* group accelerator (0 = no group) */ char gch, /* group accelerator (0 = no group) */
int attr; /* attribute for string (like tty_putstr()) */ int attr, /* attribute for string (like tty_putstr()) */
const char *str; /* menu string */ const char *str, /* menu string */
unsigned int itemflags; /* flags such as item is marked as selected unsigned int itemflags) /* flags such as item is marked as selected
MENU_ITEMFLAGS_SELECTED */ MENU_ITEMFLAGS_SELECTED */
{ {
(*cibase->nprocs->win_add_menu)(cibase->ndata, window, glyphinfo, (*cibase->nprocs->win_add_menu)(cibase->ndata, window, glyphinfo,
@@ -199,18 +271,18 @@ unsigned int itemflags; /* flags such as item is marked as selected
} }
void void
chainin_end_menu(window, prompt) chainin_end_menu(
winid window; winid window,
const char *prompt; const char *prompt)
{ {
(*cibase->nprocs->win_end_menu)(cibase->ndata, window, prompt); (*cibase->nprocs->win_end_menu)(cibase->ndata, window, prompt);
} }
int int
chainin_select_menu(window, how, menu_list) chainin_select_menu(
winid window; winid window,
int how; int how,
menu_item **menu_list; menu_item **menu_list)
{ {
int rv; int rv;
@@ -221,10 +293,10 @@ menu_item **menu_list;
} }
char char
chainin_message_menu(let, how, mesg) chainin_message_menu(
char let; char let,
int how; int how,
const char *mesg; const char *mesg)
{ {
char rv; char rv;
@@ -240,22 +312,20 @@ chainin_update_inventory(int arg)
} }
void void
chainin_mark_synch() chainin_mark_synch(void)
{ {
(*cibase->nprocs->win_mark_synch)(cibase->ndata); (*cibase->nprocs->win_mark_synch)(cibase->ndata);
} }
void void
chainin_wait_synch() chainin_wait_synch(void)
{ {
(*cibase->nprocs->win_wait_synch)(cibase->ndata); (*cibase->nprocs->win_wait_synch)(cibase->ndata);
} }
#ifdef CLIPPING #ifdef CLIPPING
void void
chainin_cliparound(x, y) chainin_cliparound(int x, int y)
int x;
int y;
{ {
(*cibase->nprocs->win_cliparound)(cibase->ndata, x, y); (*cibase->nprocs->win_cliparound)(cibase->ndata, x, y);
} }
@@ -263,8 +333,7 @@ int y;
#ifdef POSITIONBAR #ifdef POSITIONBAR
void void
chainin_update_positionbar(posbar) chainin_update_positionbar(char *posbar)
char *posbar;
{ {
(*cibase->nprocs->win_update_positionbar)(cibase->ndata, posbar); (*cibase->nprocs->win_update_positionbar)(cibase->ndata, posbar);
} }
@@ -272,31 +341,30 @@ char *posbar;
/* XXX can we decode the glyph in a meaningful way? */ /* XXX can we decode the glyph in a meaningful way? */
void void
chainin_print_glyph(window, x, y, glyphinfo, bkglyphinfo) chainin_print_glyph(
winid window; winid window,
xchar x, y; xchar x,
const glyph_info *glyphinfo; xchar y,
const glyph_info *bkglyphinfo; const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo)
{ {
(*cibase->nprocs->win_print_glyph)(cibase->ndata, window, x, y, glyphinfo, bkglyphinfo); (*cibase->nprocs->win_print_glyph)(cibase->ndata, window, x, y, glyphinfo, bkglyphinfo);
} }
void void
chainin_raw_print(str) chainin_raw_print(const char *str)
const char *str;
{ {
(*cibase->nprocs->win_raw_print)(cibase->ndata, str); (*cibase->nprocs->win_raw_print)(cibase->ndata, str);
} }
void void
chainin_raw_print_bold(str) chainin_raw_print_bold(const char *str)
const char *str;
{ {
(*cibase->nprocs->win_raw_print_bold)(cibase->ndata, str); (*cibase->nprocs->win_raw_print_bold)(cibase->ndata, str);
} }
int int
chainin_nhgetch() chainin_nhgetch(void)
{ {
int rv; int rv;
@@ -306,10 +374,10 @@ chainin_nhgetch()
} }
int int
chainin_nh_poskey(x, y, mod) chainin_nh_poskey(
int *x; int *x,
int *y; int *y,
int *mod; int *mod)
{ {
int rv; int rv;
@@ -319,13 +387,13 @@ int *mod;
} }
void void
chainin_nhbell() chainin_nhbell(void)
{ {
(*cibase->nprocs->win_nhbell)(cibase->ndata); (*cibase->nprocs->win_nhbell)(cibase->ndata);
} }
int int
chainin_doprev_message() chainin_doprev_message(void)
{ {
int rv; int rv;
@@ -335,9 +403,10 @@ chainin_doprev_message()
} }
char char
chainin_yn_function(query, resp, def) chainin_yn_function(
const char *query, *resp; const char *query,
char def; const char *resp,
char def)
{ {
int rv; int rv;
@@ -347,15 +416,15 @@ char def;
} }
void void
chainin_getlin(query, bufp) chainin_getlin(
const char *query; const char *query,
char *bufp; char *bufp)
{ {
(*cibase->nprocs->win_getlin)(cibase->ndata, query, bufp); (*cibase->nprocs->win_getlin)(cibase->ndata, query, bufp);
} }
int int
chainin_get_ext_cmd() chainin_get_ext_cmd(void)
{ {
int rv; int rv;
@@ -365,40 +434,38 @@ chainin_get_ext_cmd()
} }
void void
chainin_number_pad(state) chainin_number_pad(int state)
int state;
{ {
(*cibase->nprocs->win_number_pad)(cibase->ndata, state); (*cibase->nprocs->win_number_pad)(cibase->ndata, state);
} }
void void
chainin_delay_output() chainin_delay_output(void)
{ {
(*cibase->nprocs->win_delay_output)(cibase->ndata); (*cibase->nprocs->win_delay_output)(cibase->ndata);
} }
#ifdef CHANGE_COLOR #ifdef CHANGE_COLOR
void void
chainin_change_color(color, value, reverse) chainin_change_color(
int color; int color,
long value; long value,
int reverse; int reverse)
{ {
(*cibase->nprocs->win_change_color)(cibase->ndata, color, value, reverse); (*cibase->nprocs->win_change_color)(cibase->ndata, color, value, reverse);
} }
#ifdef MAC #ifdef MAC
void void
chainin_change_background(bw) chainin_change_background(int bw)
int bw;
{ {
(*cibase->nprocs->win_change_background)(cibase->ndata, bw); (*cibase->nprocs->win_change_background)(cibase->ndata, bw);
} }
short short
chainin_set_font_name(window, font) chainin_set_font_name(
winid window; winid window,
char *font; char *font)
{ {
short rv; short rv;
@@ -409,7 +476,7 @@ char *font;
#endif #endif
char * char *
trace_get_color_string() trace_get_color_string(void)
{ {
char *rv; char *rv;
@@ -422,36 +489,34 @@ trace_get_color_string()
/* other defs that really should go away (they're tty specific) */ /* other defs that really should go away (they're tty specific) */
void void
chainin_start_screen() chainin_start_screen(void)
{ {
(*cibase->nprocs->win_start_screen)(cibase->ndata); (*cibase->nprocs->win_start_screen)(cibase->ndata);
} }
void void
chainin_end_screen() chainin_end_screen(void)
{ {
(*cibase->nprocs->win_end_screen)(cibase->ndata); (*cibase->nprocs->win_end_screen)(cibase->ndata);
} }
void void
chainin_outrip(tmpwin, how, when) chainin_outrip(
winid tmpwin; winid tmpwin,
int how; int how,
time_t when; time_t when)
{ {
(*cibase->nprocs->win_outrip)(cibase->ndata, tmpwin, how, when); (*cibase->nprocs->win_outrip)(cibase->ndata, tmpwin, how, when);
} }
void void
chainin_preference_update(pref) chainin_preference_update(const char *pref)
const char *pref;
{ {
(*cibase->nprocs->win_preference_update)(cibase->ndata, pref); (*cibase->nprocs->win_preference_update)(cibase->ndata, pref);
} }
char * char *
chainin_getmsghistory(init) chainin_getmsghistory(boolean init)
boolean init;
{ {
char *rv; char *rv;
@@ -461,48 +526,48 @@ boolean init;
} }
void void
chainin_putmsghistory(msg, is_restoring) chainin_putmsghistory(
const char *msg; const char *msg,
boolean is_restoring; boolean is_restoring)
{ {
(*cibase->nprocs->win_putmsghistory)(cibase->ndata, msg, is_restoring); (*cibase->nprocs->win_putmsghistory)(cibase->ndata, msg, is_restoring);
} }
void void
chainin_status_init() chainin_status_init(void)
{ {
(*cibase->nprocs->win_status_init)(cibase->ndata); (*cibase->nprocs->win_status_init)(cibase->ndata);
} }
void void
chainin_status_finish() chainin_status_finish(void)
{ {
(*cibase->nprocs->win_status_finish)(cibase->ndata); (*cibase->nprocs->win_status_finish)(cibase->ndata);
} }
void void
chainin_status_enablefield(fieldidx, nm, fmt, enable) chainin_status_enablefield(
int fieldidx; int fieldidx,
const char *nm; const char *nm,
const char *fmt; const char *fmt,
boolean enable; boolean enable)
{ {
(*cibase->nprocs->win_status_enablefield)(cibase->ndata, fieldidx, nm, (*cibase->nprocs->win_status_enablefield)(cibase->ndata, fieldidx, nm,
fmt, enable); fmt, enable);
} }
void void chainin_status_update(
chainin_status_update(idx, ptr, chg, percent, color, colormasks) int idx,
int idx, chg, percent, color; genericptr_t ptr,
genericptr_t ptr; int chg, int percent, int color,
unsigned long *colormasks; unsigned long *colormasks)
{ {
(*cibase->nprocs->win_status_update)(cibase->ndata, idx, ptr, chg, (*cibase->nprocs->win_status_update)(cibase->ndata, idx, ptr, chg,
percent, color, colormasks); percent, color, colormasks);
} }
boolean boolean
chainin_can_suspend() chainin_can_suspend(void)
{ {
boolean rv; boolean rv;
@@ -514,6 +579,7 @@ chainin_can_suspend()
struct window_procs chainin_procs = { struct window_procs chainin_procs = {
"-chainin", 0, /* wincap */ "-chainin", 0, /* wincap */
0, /* wincap2 */ 0, /* wincap2 */
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
/* /*
XXX problem - the above need to come from the real window port, possibly XXX problem - the above need to come from the real window port, possibly
modified. May need to do something to call an additional init fn later modified. May need to do something to call an additional init fn later
+241 -186
View File
@@ -7,6 +7,78 @@
#include "hack.h" #include "hack.h"
void chainout_init_nhwindows(void *,int *, char **);
void chainout_player_selection(void *);
void chainout_askname(void *);
void chainout_get_nh_event(void *);
void chainout_exit_nhwindows(void *,const char *);
void chainout_suspend_nhwindows(void *,const char *);
void chainout_resume_nhwindows(void *);
winid chainout_create_nhwindow(void *,int);
void chainout_clear_nhwindow(void *,winid);
void chainout_display_nhwindow(void *,winid, boolean);
void chainout_destroy_nhwindow(void *,winid);
void chainout_curs(void *,winid, int, int);
void chainout_putstr(void *,winid, int, const char *);
void chainout_putmixed(void *,winid, int, const char *);
void chainout_display_file(void *,const char *, boolean);
void chainout_start_menu(void *,winid, unsigned long);
void chainout_add_menu(void *,winid, const glyph_info *, const ANY_P *,
char, char, int,
const char *, unsigned int);
void chainout_end_menu(void *,winid, const char *);
int chainout_select_menu(void *,winid, int, MENU_ITEM_P **);
char chainout_message_menu(void *,char, int, const char *);
void chainout_update_inventory(void *,int);
void chainout_mark_synch(void *);
void chainout_wait_synch(void *);
#ifdef CLIPPING
void chainout_cliparound(void *,int, int);
#endif
#ifdef POSITIONBAR
void chainout_update_positionbar(void *,char *);
#endif
void chainout_print_glyph(void *,winid, xchar, xchar,
const glyph_info *, const glyph_info *);
void chainout_raw_print(void *,const char *);
void chainout_raw_print_bold(void *,const char *);
int chainout_nhgetch(void *);
int chainout_nh_poskey(void *,int *, int *, int *);
void chainout_nhbell(void *);
int chainout_doprev_message(void *);
char chainout_yn_function(void *,const char *, const char *, char);
void chainout_getlin(void *,const char *, char *);
int chainout_get_ext_cmd(void *);
void chainout_number_pad(void *,int);
void chainout_delay_output(void *);
#ifdef CHANGE_COLOR
void chainout_change_color(void *,int, long, int);
#ifdef MAC
void chainout_change_background(void *,int);
short chainout_set_font_name(void *,winid, char *);
#endif
char *chainout_get_color_string(void *);
#endif
/* other defs that really should go away (they're tty specific) */
void chainout_start_screen(void *);
void chainout_end_screen(void *);
void chainout_outrip(void *,winid, int, time_t);
void chainout_preference_update(void *,const char *);
char *chainout_getmsghistory(void *,boolean);
void chainout_putmsghistory(void *,const char *, boolean);
void chainout_status_init(void *);
void chainout_status_finish(void *);
void chainout_status_enablefield(void *,int, const char *, const char *,
boolean);
void chainout_status_update(void *,int, genericptr_t, int, int, int,
unsigned long *);
boolean chainout_can_suspend(void *);
void chainout_procs_init(int dir);
void *chainout_procs_chain(int cmd, int n, void *me, void *nextprocs, void *nextdata);
struct chainout_data { struct chainout_data {
struct window_procs *nprocs; struct window_procs *nprocs;
#if 0 #if 0
@@ -17,12 +89,12 @@ struct chainout_data {
}; };
void * void *
chainout_procs_chain(cmd, n, me, nextprocs, nextdata) chainout_procs_chain(
int cmd; int cmd,
int n; int n,
void *me; void *me,
void *nextprocs; void *nextprocs,
void *nextdata UNUSED; void *nextdata UNUSED)
{ {
struct chainout_data *tdp = 0; struct chainout_data *tdp = 0;
@@ -45,8 +117,7 @@ void *nextdata UNUSED;
/* XXX if we don't need this, take it out of the table */ /* XXX if we don't need this, take it out of the table */
void void
chainout_procs_init(dir) chainout_procs_init(int dir UNUSED)
int dir UNUSED;
{ {
} }
@@ -55,10 +126,10 @@ int dir UNUSED;
***/ ***/
void void
chainout_init_nhwindows(vp, argcp, argv) chainout_init_nhwindows(
void *vp; void *vp,
int *argcp; int *argcp,
char **argv; char **argv)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -66,8 +137,7 @@ char **argv;
} }
void void
chainout_player_selection(vp) chainout_player_selection(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -75,8 +145,7 @@ void *vp;
} }
void void
chainout_askname(vp) chainout_askname(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -84,8 +153,7 @@ void *vp;
} }
void void
chainout_get_nh_event(vp) chainout_get_nh_event(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -93,9 +161,9 @@ void *vp;
} }
void void
chainout_exit_nhwindows(vp, str) chainout_exit_nhwindows(
void *vp; void *vp,
const char *str; const char *str)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -103,9 +171,9 @@ const char *str;
} }
void void
chainout_suspend_nhwindows(vp, str) chainout_suspend_nhwindows(
void *vp; void *vp,
const char *str; const char *str)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -113,8 +181,7 @@ const char *str;
} }
void void
chainout_resume_nhwindows(vp) chainout_resume_nhwindows(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -122,9 +189,9 @@ void *vp;
} }
winid winid
chainout_create_nhwindow(vp, type) chainout_create_nhwindow(
void *vp; void *vp,
int type; int type)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
winid rv; winid rv;
@@ -135,9 +202,9 @@ int type;
} }
void void
chainout_clear_nhwindow(vp, window) chainout_clear_nhwindow(
void *vp; void *vp,
winid window; winid window)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -145,10 +212,10 @@ winid window;
} }
void void
chainout_display_nhwindow(vp, window, blocking) chainout_display_nhwindow(
void *vp; void *vp,
winid window; winid window,
boolean blocking; boolean blocking)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -156,9 +223,9 @@ boolean blocking;
} }
void void
chainout_destroy_nhwindow(vp, window) chainout_destroy_nhwindow(
void *vp; void *vp,
winid window; winid window)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -166,11 +233,11 @@ winid window;
} }
void void
chainout_curs(vp, window, x, y) chainout_curs(
void *vp; void *vp,
winid window; winid window,
int x; int x,
int y; int y)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -178,11 +245,11 @@ int y;
} }
void void
chainout_putstr(vp, window, attr, str) chainout_putstr(
void *vp; void *vp,
winid window; winid window,
int attr; int attr,
const char *str; const char *str)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -190,11 +257,11 @@ const char *str;
} }
void void
chainout_putmixed(vp, window, attr, str) chainout_putmixed(
void *vp; void *vp,
winid window; winid window,
int attr; int attr,
const char *str; const char *str)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -202,10 +269,10 @@ const char *str;
} }
void void
chainout_display_file(vp, fname, complain) chainout_display_file(
void *vp; void *vp,
const char *fname; const char *fname,
boolean complain; boolean complain)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -213,10 +280,10 @@ boolean complain;
} }
void void
chainout_start_menu(vp, window, mbehavior) chainout_start_menu(
void *vp; void *vp,
winid window; winid window,
unsigned long mbehavior; unsigned long mbehavior)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -224,17 +291,16 @@ unsigned long mbehavior;
} }
void void
chainout_add_menu(vp, window, glyphinfo, identifier, ch, gch, attr, str, chainout_add_menu(
itemflags) void *vp,
void *vp; winid window, /* window to use, must be of type NHW_MENU */
winid window; /* window to use, must be of type NHW_MENU */ const glyph_info *glyphinfo, /* glyph plus info to display with item */
const glyph_info *glyphinfo /* glyph plus glyph info to display with item */ const anything *identifier, /* what to return if selected */
const anything *identifier; /* what to return if selected */ char ch, /* keyboard accelerator (0 = pick our own) */
char ch; /* keyboard accelerator (0 = pick our own) */ char gch, /* group accelerator (0 = no group) */
char gch; /* group accelerator (0 = no group) */ int attr, /* attribute for string (like tty_putstr()) */
int attr; /* attribute for string (like tty_putstr()) */ const char *str, /* menu string */
const char *str; /* menu string */ unsigned int itemflags) /* itemflags such as marked as selected */
unsigned int itemflags; /* itemflags such as marked as selected */
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -243,10 +309,10 @@ unsigned int itemflags; /* itemflags such as marked as selected */
} }
void void
chainout_end_menu(vp, window, prompt) chainout_end_menu(
void *vp; void *vp,
winid window; winid window,
const char *prompt; const char *prompt)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -254,11 +320,11 @@ const char *prompt;
} }
int int
chainout_select_menu(vp, window, how, menu_list) chainout_select_menu(
void *vp; void *vp,
winid window; winid window,
int how; int how,
menu_item **menu_list; menu_item **menu_list)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
int rv; int rv;
@@ -269,11 +335,11 @@ menu_item **menu_list;
} }
char char
chainout_message_menu(vp, let, how, mesg) chainout_message_menu(
void *vp; void *vp,
char let; char let,
int how; int how,
const char *mesg; const char *mesg)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
char rv; char rv;
@@ -292,8 +358,7 @@ chainout_update_inventory(void *vp, int arg)
} }
void void
chainout_mark_synch(vp) chainout_mark_synch(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -301,8 +366,7 @@ void *vp;
} }
void void
chainout_wait_synch(vp) chainout_wait_synch(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -311,10 +375,10 @@ void *vp;
#ifdef CLIPPING #ifdef CLIPPING
void void
chainout_cliparound(vp, x, y) chainout_cliparound(
void *vp; void *vp,
int x; int x,
int y; int y)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -324,9 +388,9 @@ int y;
#ifdef POSITIONBAR #ifdef POSITIONBAR
void void
chainout_update_positionbar(vp, posbar) chainout_update_positionbar(
void *vp; void *vp,
char *posbar; char *posbar)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -335,12 +399,13 @@ char *posbar;
#endif #endif
void void
chainout_print_glyph(vp, window, x, y, glyphinfo, bkglyphinfo) chainout_print_glyph(
void *vp; void *vp,
winid window; winid window,
xchar x, y; xchar x,
const glyph_info *glyphinfo; xchar y,
const glyph_info *bkglyphinfo; const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -348,9 +413,9 @@ const glyph_info *bkglyphinfo;
} }
void void
chainout_raw_print(vp, str) chainout_raw_print(
void *vp; void *vp,
const char *str; const char *str)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -358,9 +423,7 @@ const char *str;
} }
void void
chainout_raw_print_bold(vp, str) chainout_raw_print_bold(void *vp, const char *str)
void *vp;
const char *str;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -368,8 +431,7 @@ const char *str;
} }
int int
chainout_nhgetch(vp) chainout_nhgetch(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
int rv; int rv;
@@ -380,11 +442,11 @@ void *vp;
} }
int int
chainout_nh_poskey(vp, x, y, mod) chainout_nh_poskey(
void *vp; void *vp,
int *x; int *x,
int *y; int *y,
int *mod; int *mod)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
int rv; int rv;
@@ -395,8 +457,7 @@ int *mod;
} }
void void
chainout_nhbell(vp) chainout_nhbell(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -404,8 +465,7 @@ void *vp;
} }
int int
chainout_doprev_message(vp) chainout_doprev_message(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
int rv; int rv;
@@ -416,10 +476,11 @@ void *vp;
} }
char char
chainout_yn_function(vp, query, resp, def) chainout_yn_function(
void *vp; void *vp,
const char *query, *resp; const char *query,
char def; const char *resp,
char def)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
int rv; int rv;
@@ -430,10 +491,10 @@ char def;
} }
void void
chainout_getlin(vp, query, bufp) chainout_getlin(
void *vp; void *vp,
const char *query; const char *query,
char *bufp; char *bufp)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -441,8 +502,7 @@ char *bufp;
} }
int int
chainout_get_ext_cmd(vp) chainout_get_ext_cmd(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
int rv; int rv;
@@ -453,9 +513,7 @@ void *vp;
} }
void void
chainout_number_pad(vp, state) chainout_number_pad(void *vp, int state)
void *vp;
int state;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -463,8 +521,7 @@ int state;
} }
void void
chainout_delay_output(vp) chainout_delay_output(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -473,11 +530,11 @@ void *vp;
#ifdef CHANGE_COLOR #ifdef CHANGE_COLOR
void void
chainout_change_color(vp, color, value, reverse) chainout_change_color(
void *vp; void *vp,
int color; int color,
long value; long value,
int reverse; int reverse)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -486,9 +543,9 @@ int reverse;
#ifdef MAC #ifdef MAC
void void
chainout_change_background(vp, bw) chainout_change_background(
void *vp; void *vp,
int bw; int bw)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -496,10 +553,10 @@ int bw;
} }
short short
chainout_set_font_name(vp, window, font) chainout_set_font_name(
void *vp; void *vp,
winid window; winid window,
char *font; char *font)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
short rv; short rv;
@@ -511,8 +568,7 @@ char *font;
#endif #endif
char * char *
trace_get_color_string(vp) trace_get_color_string(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
char *rv; char *rv;
@@ -526,8 +582,7 @@ void *vp;
/* other defs that really should go away (they're tty specific) */ /* other defs that really should go away (they're tty specific) */
void void
chainout_start_screen(vp) chainout_start_screen(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -535,8 +590,7 @@ void *vp;
} }
void void
chainout_end_screen(vp) chainout_end_screen(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -544,11 +598,11 @@ void *vp;
} }
void void
chainout_outrip(vp, tmpwin, how, when) chainout_outrip(
void *vp; void *vp,
winid tmpwin; winid tmpwin,
int how; int how,
time_t when; time_t when)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -556,9 +610,9 @@ time_t when;
} }
void void
chainout_preference_update(vp, pref) chainout_preference_update(
void *vp; void *vp,
const char *pref; const char *pref)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -566,9 +620,9 @@ const char *pref;
} }
char * char *
chainout_getmsghistory(vp, init) chainout_getmsghistory(
void *vp; void *vp,
boolean init; boolean init)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
char *rv; char *rv;
@@ -579,10 +633,10 @@ boolean init;
} }
void void
chainout_putmsghistory(vp, msg, is_restoring) chainout_putmsghistory(
void *vp; void *vp,
const char *msg; const char *msg,
boolean is_restoring; boolean is_restoring)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -590,8 +644,7 @@ boolean is_restoring;
} }
void void
chainout_status_init(vp) chainout_status_init(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -599,8 +652,7 @@ void *vp;
} }
void void
chainout_status_finish(vp) chainout_status_finish(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -608,12 +660,12 @@ void *vp;
} }
void void
chainout_status_enablefield(vp, fieldidx, nm, fmt, enable) chainout_status_enablefield(
void *vp; void *vp,
int fieldidx; int fieldidx,
const char *nm; const char *nm,
const char *fmt; const char *fmt,
boolean enable; boolean enable)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -621,11 +673,14 @@ boolean enable;
} }
void void
chainout_status_update(vp, idx, ptr, chg, percent, color, colormasks) chainout_status_update(
void *vp; void *vp,
int idx, chg, percent, color; int idx,
genericptr_t ptr; genericptr_t ptr,
unsigned long *colormasks; int chg,
int percent,
int color,
unsigned long *colormasks)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
@@ -633,8 +688,7 @@ unsigned long *colormasks;
} }
boolean boolean
chainout_can_suspend(vp) chainout_can_suspend(void *vp)
void *vp;
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
boolean rv; boolean rv;
@@ -647,6 +701,7 @@ void *vp;
struct chain_procs chainout_procs = { struct chain_procs chainout_procs = {
"-chainout", 0, /* wincap */ "-chainout", 0, /* wincap */
0, /* wincap2 */ 0, /* wincap2 */
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
/* /*
XXX problem - the above need to come from the real window port, possibly XXX problem - the above need to come from the real window port, possibly
modified. May need to do something to call an additional init fn later modified. May need to do something to call an additional init fn later
+248 -189
View File
@@ -33,6 +33,78 @@ static char indentdata[10] = " ";
#define PRE indent_level++ #define PRE indent_level++
#define POST indent_level-- #define POST indent_level--
void trace_init_nhwindows(void *,int *, char **);
void trace_player_selection(void *);
void trace_askname(void *);
void trace_get_nh_event(void *);
void trace_exit_nhwindows(void *,const char *);
void trace_suspend_nhwindows(void *,const char *);
void trace_resume_nhwindows(void *);
winid trace_create_nhwindow(void *,int);
void trace_clear_nhwindow(void *,winid);
void trace_display_nhwindow(void *,winid, boolean);
void trace_destroy_nhwindow(void *,winid);
void trace_curs(void *,winid, int, int);
void trace_putstr(void *,winid, int, const char *);
void trace_putmixed(void *,winid, int, const char *);
void trace_display_file(void *,const char *, boolean);
void trace_start_menu(void *,winid, unsigned long);
void trace_add_menu(void *,winid, const glyph_info *, const ANY_P *,
char, char, int,
const char *, unsigned int);
void trace_end_menu(void *,winid, const char *);
int trace_select_menu(void *,winid, int, MENU_ITEM_P **);
char trace_message_menu(void *,char, int, const char *);
void trace_update_inventory(void *,int);
void trace_mark_synch(void *);
void trace_wait_synch(void *);
#ifdef CLIPPING
void trace_cliparound(void *,int, int);
#endif
#ifdef POSITIONBAR
void trace_update_positionbar(void *,char *);
#endif
void trace_print_glyph(void *,winid, xchar, xchar,
const glyph_info *, const glyph_info *);
void trace_raw_print(void *,const char *);
void trace_raw_print_bold(void *,const char *);
int trace_nhgetch(void *);
int trace_nh_poskey(void *,int *, int *, int *);
void trace_nhbell(void *);
int trace_doprev_message(void *);
char trace_yn_function(void *,const char *, const char *, char);
void trace_getlin(void *,const char *, char *);
int trace_get_ext_cmd(void *);
void trace_number_pad(void *,int);
void trace_delay_output(void *);
#ifdef CHANGE_COLOR
void trace_change_color(void *,int, long, int);
#ifdef MAC
void trace_change_background(void *,int);
short trace_set_font_name(void *,winid, char *);
#endif
char *trace_get_color_string(void *);
#endif
/* other defs that really should go away (they're tty specific) */
void trace_start_screen(void *);
void trace_end_screen(void *);
void trace_outrip(void *,winid, int, time_t);
void trace_preference_update(void *,const char *);
char *trace_getmsghistory(void *,boolean);
void trace_putmsghistory(void *,const char *, boolean);
void trace_status_init(void *);
void trace_status_finish(void *);
void trace_status_enablefield(void *,int, const char *, const char *,
boolean);
void trace_status_update(void *,int, genericptr_t, int, int, int,
unsigned long *);
boolean trace_can_suspend(void *);
void trace_procs_init(int dir);
void *trace_procs_chain(int cmd, int n, void *me, void *nextprocs, void *nextdata);
struct trace_data { struct trace_data {
struct chain_procs *nprocs; struct chain_procs *nprocs;
void *ndata; void *ndata;
@@ -41,12 +113,12 @@ struct trace_data {
}; };
void * void *
trace_procs_chain(cmd, n, me, nextprocs, nextdata) trace_procs_chain(
int cmd; int cmd,
int n; int n,
void *me; void *me,
void *nextprocs; void *nextprocs,
void *nextdata; void *nextdata)
{ {
struct trace_data *tdp = 0; struct trace_data *tdp = 0;
@@ -70,8 +142,7 @@ void *nextdata;
} }
void void
trace_procs_init(dir) trace_procs_init(int dir)
int dir;
{ {
char fname[200]; char fname[200];
long pid; long pid;
@@ -99,10 +170,10 @@ int dir;
***/ ***/
void void
trace_init_nhwindows(vp, argcp, argv) trace_init_nhwindows(
void *vp; void *vp,
int *argcp; int *argcp,
char **argv; char **argv)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -114,8 +185,7 @@ char **argv;
} }
void void
trace_player_selection(vp) trace_player_selection(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
fprintf(wc_tracelogf, "%splayer_selection()\n", INDENT); fprintf(wc_tracelogf, "%splayer_selection()\n", INDENT);
@@ -126,8 +196,7 @@ void *vp;
} }
void void
trace_askname(vp) trace_askname(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
fprintf(wc_tracelogf, "%saskname()\n", INDENT); fprintf(wc_tracelogf, "%saskname()\n", INDENT);
@@ -138,8 +207,7 @@ void *vp;
} }
void void
trace_get_nh_event(vp) trace_get_nh_event(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
fprintf(wc_tracelogf, "%sget_nh_event()\n", INDENT); fprintf(wc_tracelogf, "%sget_nh_event()\n", INDENT);
@@ -150,9 +218,9 @@ void *vp;
} }
void void
trace_exit_nhwindows(vp, str) trace_exit_nhwindows(
void *vp; void *vp,
const char *str; const char *str)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
fprintf(wc_tracelogf, "%sexit_nhwindows(%s)\n", INDENT, str); fprintf(wc_tracelogf, "%sexit_nhwindows(%s)\n", INDENT, str);
@@ -163,9 +231,9 @@ const char *str;
} }
void void
trace_suspend_nhwindows(vp, str) trace_suspend_nhwindows(
void *vp; void *vp,
const char *str; const char *str)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
fprintf(wc_tracelogf, "%ssuspend_nhwindows(%s)\n", INDENT, str); fprintf(wc_tracelogf, "%ssuspend_nhwindows(%s)\n", INDENT, str);
@@ -176,8 +244,7 @@ const char *str;
} }
void void
trace_resume_nhwindows(vp) trace_resume_nhwindows(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
fprintf(wc_tracelogf, "%sresume_nhwindows()\n", INDENT); fprintf(wc_tracelogf, "%sresume_nhwindows()\n", INDENT);
@@ -188,8 +255,7 @@ void *vp;
} }
static const char * static const char *
NHWname(type) NHWname(int type)
int type;
{ {
switch (type) { switch (type) {
case NHW_MESSAGE: case NHW_MESSAGE:
@@ -213,9 +279,9 @@ int type;
} }
winid winid
trace_create_nhwindow(vp, type) trace_create_nhwindow(
void *vp; void *vp,
int type; int type)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
const char *typestring = NHWname(type); const char *typestring = NHWname(type);
@@ -232,9 +298,9 @@ int type;
} }
void void
trace_clear_nhwindow(vp, window) trace_clear_nhwindow(
void *vp; void *vp,
winid window; winid window)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -246,10 +312,10 @@ winid window;
} }
void void
trace_display_nhwindow(vp, window, blocking) trace_display_nhwindow(
void *vp; void *vp,
winid window; winid window,
boolean blocking; boolean blocking)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -262,9 +328,9 @@ boolean blocking;
} }
void void
trace_destroy_nhwindow(vp, window) trace_destroy_nhwindow(
void *vp; void *vp,
winid window; winid window)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -276,11 +342,11 @@ winid window;
} }
void void
trace_curs(vp, window, x, y) trace_curs(
void *vp; void *vp,
winid window; winid window,
int x; int x,
int y; int y)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -292,11 +358,11 @@ int y;
} }
void void
trace_putstr(vp, window, attr, str) trace_putstr(
void *vp; void *vp,
winid window; winid window,
int attr; int attr,
const char *str; const char *str)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -314,11 +380,11 @@ const char *str;
} }
void void
trace_putmixed(vp, window, attr, str) trace_putmixed(
void *vp; void *vp,
winid window; winid window,
int attr; int attr,
const char *str; const char *str)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -336,10 +402,10 @@ const char *str;
} }
void void
trace_display_file(vp, fname, complain) trace_display_file(
void *vp; void *vp,
const char *fname; const char *fname,
boolean complain; boolean complain)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -356,10 +422,10 @@ boolean complain;
} }
void void
trace_start_menu(vp, window, mbehavior) trace_start_menu(
void *vp; void *vp,
winid window; winid window,
unsigned long mbehavior; unsigned long mbehavior)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -372,16 +438,16 @@ unsigned long mbehavior;
} }
void void
trace_add_menu(vp, window, glyphinfo, identifier, ch, gch, attr, str, itemflags) trace_add_menu(
void *vp; void *vp,
winid window; /* window to use, must be of type NHW_MENU */ winid window, /* window to use, must be of type NHW_MENU */
const glyph_info *glyphinfo /* glyph plus glyph info to display with item */ const glyph_info *glyphinfo, /* glyph plus glyph info to display with item */
const anything *identifier; /* what to return if selected */ const anything *identifier, /* what to return if selected */
char ch; /* keyboard accelerator (0 = pick our own) */ char ch, /* keyboard accelerator (0 = pick our own) */
char gch; /* group accelerator (0 = no group) */ char gch, /* group accelerator (0 = no group) */
int attr; /* attribute for string (like tty_putstr()) */ int attr, /* attribute for string (like tty_putstr()) */
const char *str; /* menu string */ const char *str, /* menu string */
unsigned int itemflags; /* itemflags such as marked as selected */ unsigned int itemflags) /* itemflags such as marked as selected */
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -403,12 +469,12 @@ unsigned int itemflags; /* itemflags such as marked as selected */
if (str) { if (str) {
fprintf(wc_tracelogf, fprintf(wc_tracelogf,
"%sadd_menu(%d, %d, %u, %p, %s, %s, %d, '%s'(%d), %u)\n", INDENT, "%sadd_menu(%d, %d, %u, %p, %s, %s, %d, '%s'(%d), %u)\n", INDENT,
window, glyphinfo->glyph, glyphinfo->flags, (void *) identifier, window, glyphinfo->glyph, glyphinfo->gm.glyphflags, (void *) identifier,
buf_ch, buf_gch, attr, str, (int) strlen(str), itemflags); buf_ch, buf_gch, attr, str, (int) strlen(str), itemflags);
} else { } else {
fprintf(wc_tracelogf, fprintf(wc_tracelogf,
"%sadd_menu(%d, %d, %u, %p, %s, %s, %d, NULL, %u)\n", INDENT, "%sadd_menu(%d, %d, %u, %p, %s, %s, %d, NULL, %u)\n", INDENT,
window, glyphinfo->glyph, glyphinfo->flags, (void *) identifier, window, glyphinfo->glyph, glyphinfo->gm.glyphflags, (void *) identifier,
buf_ch, buf_gch, attr, itemflags); buf_ch, buf_gch, attr, itemflags);
} }
@@ -419,10 +485,10 @@ unsigned int itemflags; /* itemflags such as marked as selected */
} }
void void
trace_end_menu(vp, window, prompt) trace_end_menu(
void *vp; void *vp,
winid window; winid window,
const char *prompt; const char *prompt)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -439,11 +505,11 @@ const char *prompt;
} }
int int
trace_select_menu(vp, window, how, menu_list) trace_select_menu(
void *vp; void *vp,
winid window; winid window,
int how; int how,
menu_item **menu_list; menu_item **menu_list)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
int rv; int rv;
@@ -461,11 +527,11 @@ menu_item **menu_list;
} }
char char
trace_message_menu(vp, let, how, mesg) trace_message_menu(
void *vp; void *vp,
char let; char let,
int how; int how,
const char *mesg; const char *mesg)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
char buf_let[10]; char buf_let[10];
@@ -512,8 +578,7 @@ trace_update_inventory(void *vp, int arg)
} }
void void
trace_mark_synch(vp) trace_mark_synch(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -525,8 +590,7 @@ void *vp;
} }
void void
trace_wait_synch(vp) trace_wait_synch(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -539,10 +603,10 @@ void *vp;
#ifdef CLIPPING #ifdef CLIPPING
void void
trace_cliparound(vp, x, y) trace_cliparound(
void *vp; void *vp,
int x; int x,
int y; int y)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -556,9 +620,9 @@ int y;
#ifdef POSITIONBAR #ifdef POSITIONBAR
void void
trace_update_positionbar(vp, posbar) trace_update_positionbar(
void *vp; void *vp,
char *posbar; char *posbar)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -577,12 +641,13 @@ char *posbar;
/* XXX can we decode the glyph in a meaningful way? see map_glyphinfo()? /* XXX can we decode the glyph in a meaningful way? see map_glyphinfo()?
genl_putmixed? */ genl_putmixed? */
void void
trace_print_glyph(vp, window, x, y, glyphinfo, bkglyphinfo) trace_print_glyph(
void *vp; void *vp,
winid window; winid window,
xchar x, y; xchar x,
const glyph_info *glyphinfo; xchar y,
const glyph_info *bkglyphinfo; const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -595,9 +660,9 @@ const glyph_info *bkglyphinfo;
} }
void void
trace_raw_print(vp, str) trace_raw_print(
void *vp; void *vp,
const char *str; const char *str)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -614,9 +679,9 @@ const char *str;
} }
void void
trace_raw_print_bold(vp, str) trace_raw_print_bold(
void *vp; void *vp,
const char *str; const char *str)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -633,8 +698,7 @@ const char *str;
} }
int int
trace_nhgetch(vp) trace_nhgetch(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
int rv; int rv;
@@ -657,11 +721,11 @@ void *vp;
} }
int int
trace_nh_poskey(vp, x, y, mod) trace_nh_poskey(
void *vp; void *vp,
int *x; int *x,
int *y; int *y,
int *mod; int *mod)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
int rv; int rv;
@@ -684,8 +748,7 @@ int *mod;
} }
void void
trace_nhbell(vp) trace_nhbell(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -697,8 +760,7 @@ void *vp;
} }
int int
trace_doprev_message(vp) trace_doprev_message(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
int rv; int rv;
@@ -715,10 +777,11 @@ void *vp;
} }
char char
trace_yn_function(vp, query, resp, def) trace_yn_function(
void *vp; void *vp,
const char *query, *resp; const char *query,
char def; const char *resp,
char def)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
char rv; char rv;
@@ -761,10 +824,10 @@ char def;
} }
void void
trace_getlin(vp, query, bufp) trace_getlin(
void *vp; void *vp,
const char *query; const char *query,
char *bufp; char *bufp)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -787,8 +850,7 @@ char *bufp;
} }
int int
trace_get_ext_cmd(vp) trace_get_ext_cmd(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
int rv; int rv;
@@ -816,9 +878,9 @@ void *vp;
} }
void void
trace_number_pad(vp, state) trace_number_pad(
void *vp; void *vp,
int state; int state)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -830,8 +892,7 @@ int state;
} }
void void
trace_delay_output(vp) trace_delay_output(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -844,11 +905,11 @@ void *vp;
#ifdef CHANGE_COLOR #ifdef CHANGE_COLOR
void void
trace_change_color(vp, color, value, reverse) trace_change_color(
void *vp; void *vp,
int color; int color,
long value; long value,
int reverse; int reverse)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -862,9 +923,9 @@ int reverse;
#ifdef MAC #ifdef MAC
void void
trace_change_background(vp, bw) trace_change_background(
void *vp; void *vp,
int bw; int bw)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -876,10 +937,10 @@ int bw;
} }
short short
trace_set_font_name(vp, window, font) trace_set_font_name(
void *vp; void *vp,
winid window; winid window,
char *font; char *font)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
short rv; short rv;
@@ -902,8 +963,7 @@ char *font;
#endif #endif
char * char *
trace_get_color_string(vp) trace_get_color_string(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
char *rv; char *rv;
@@ -928,8 +988,7 @@ void *vp;
/* other defs that really should go away (they're tty specific) */ /* other defs that really should go away (they're tty specific) */
void void
trace_start_screen(vp) trace_start_screen(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -941,8 +1000,7 @@ void *vp;
} }
void void
trace_end_screen(vp) trace_end_screen(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -954,11 +1012,11 @@ void *vp;
} }
void void
trace_outrip(vp, tmpwin, how, when) trace_outrip(
void *vp; void *vp,
winid tmpwin; winid tmpwin,
int how; int how,
time_t when; time_t when)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -971,9 +1029,9 @@ time_t when;
} }
void void
trace_preference_update(vp, pref) trace_preference_update(
void *vp; void *vp,
const char *pref; const char *pref)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -990,9 +1048,9 @@ const char *pref;
} }
char * char *
trace_getmsghistory(vp, init) trace_getmsghistory(
void *vp; void *vp,
boolean init; boolean init)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
char *rv; char *rv;
@@ -1014,10 +1072,10 @@ boolean init;
} }
void void
trace_putmsghistory(vp, msg, is_restoring) trace_putmsghistory(
void *vp; void *vp,
const char *msg; const char *msg,
boolean is_restoring; boolean is_restoring)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -1035,8 +1093,7 @@ boolean is_restoring;
} }
void void
trace_status_init(vp) trace_status_init(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -1048,8 +1105,7 @@ void *vp;
} }
void void
trace_status_finish(vp) trace_status_finish(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -1061,12 +1117,12 @@ void *vp;
} }
void void
trace_status_enablefield(vp, fieldidx, nm, fmt, enable) trace_status_enablefield(
void *vp; void *vp,
int fieldidx; int fieldidx,
const char *nm; const char *nm,
const char *fmt; const char *fmt,
boolean enable; boolean enable)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -1090,11 +1146,14 @@ boolean enable;
} }
void void
trace_status_update(vp, idx, ptr, chg, percent, color, colormasks) trace_status_update(
void *vp; void *vp,
int idx, chg, percent, color; int idx,
genericptr_t ptr; genericptr_t ptr,
unsigned long *colormasks; int chg,
int percent,
int color,
unsigned long *colormasks)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -1108,8 +1167,7 @@ unsigned long *colormasks;
} }
boolean boolean
trace_can_suspend(vp) trace_can_suspend(void *vp)
void *vp;
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
boolean rv; boolean rv;
@@ -1128,6 +1186,7 @@ void *vp;
struct chain_procs trace_procs = { struct chain_procs trace_procs = {
"+trace", 0, /* wincap */ "+trace", 0, /* wincap */
0, /* wincap2 */ 0, /* wincap2 */
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
/* /*
XXX problem - the above need to come from the real window port, possibly XXX problem - the above need to come from the real window port, possibly
modified. May need to do something to call an additional init fn later modified. May need to do something to call an additional init fn later