]>
git.saurik.com Git - wxWidgets.git/blob - utils/Install/sfxace/uac_sys.c
1 /* ------------------------------------------------------------------------ */
3 /* Some basic things. */
5 /* ------------------------------------------------------------------------ */
9 #include <signal.h> // signal()
10 #include <stdio.h> // fprintf() fflush() getch() putc()
16 void memset16(USHORT
* dest
, SHORT val
, INT len
) // fills short-array with
22 INT
cancel(void) // checks whether to interrupt the program
34 /*INT wrask(CHAR * s) // prompt-routine
38 fprintf(stderr, "\n %s (Yes,Always,No,Cancel) ", s);
45 while (ch != 'Y' && ch != 'A' && ch != 'N' && ch != 'C' && ch != 27);
46 fprintf(stderr, "%s", ch == 'Y' ? "Yes" : (ch == 'A' ? "Always" : (ch == 'N' ? "No" : "Cancel")));
48 return (ch == 'Y' ? 0 : (ch == 'A' ? 1 : (ch == 'N' ? 2 : 3)));
51 void beep(void) // makes some noise
63 void my_signalhandler(INT sig_number
) // sets f_err if ctrl+c or ctrl+brk
66 error("\nUser break\n");
69 #ifdef DOS // handles hardware errors
71 INT
harderrhandler(UINT deverr
, UINT errc
, UINT
* devhdr
)
73 INT __far
harderrhandler(UINT deverr
, UINT errc
, UINT
* devhdr
)
76 f_criterr
= 'A' + deverr
& 0xff;
82 void set_handler(void) // initializes handlers
84 #if defined(DOS) && !defined(__BORLANDC__)
85 signal(SIGBREAK
, my_signalhandler
); // set ctrl-break/-c handlers
87 signal(SIGINT
, my_signalhandler
);
88 #if defined(DOS) && !defined(__CONSOLE__) // set hardware error handler
90 harderr(harderrhandler
);
92 _harderr(harderrhandler
);