]>
git.saurik.com Git - wxWidgets.git/blob - utils/Install/packace/uac_sys.c
1 /* ------------------------------------------------------------------------ */
3 /* Some basic things. */
5 /* ------------------------------------------------------------------------ */
9 #include <signal.h> // signal()
10 #include <stdio.h> // fprintf() fflush() getch() putc()
12 #if defined(DOS) || defined(WINNT) || defined(WIN16)
13 #if !defined(__CYGWIN__)
14 #include <conio.h> // getch()
18 #include <dos.h> // delay() sound()
25 void memset16(USHORT
* dest
, SHORT val
, INT len
) // fills short-array with
31 INT
cancel(void) // checks whether to interrupt the program
43 INT
wrask(CHAR
* s
) // prompt-routine
47 fprintf(stderr
, "\n %s (Yes,Always,No,Cancel) ", s
);
54 while (ch
!= 'Y' && ch
!= 'A' && ch
!= 'N' && ch
!= 'C' && ch
!= 27);
55 fprintf(stderr
, "%s", ch
== 'Y' ? "Yes" : (ch
== 'A' ? "Always" : (ch
== 'N' ? "No" : "Cancel")));
57 return (ch
== 'Y' ? 0 : (ch
== 'A' ? 1 : (ch
== 'N' ? 2 : 3)));
60 void beep(void) // makes some noise
72 void my_signalhandler(INT sig_number
) // sets f_err if ctrl+c or ctrl+brk
75 pipeit("\nUser break\n");
78 #ifdef DOS // handles hardware errors
80 INT
harderrhandler(UINT deverr
, UINT errc
, UINT
* devhdr
)
82 INT __far
harderrhandler(UINT deverr
, UINT errc
, UINT
* devhdr
)
85 f_criterr
= 'A' + deverr
& 0xff;
91 void set_handler(void) // initializes handlers
93 #if defined(DOS) && !defined(__BORLANDC__)
94 signal(SIGBREAK
, my_signalhandler
); // set ctrl-break/-c handlers
96 signal(SIGINT
, my_signalhandler
);
97 #if defined(DOS) && !defined(__CONSOLE__) // set hardware error handler
99 harderr(harderrhandler
);
101 _harderr(harderrhandler
);