added a problem in installing ctrl-c handler in OS2

This commit is contained in:
hyung-hwan 2011-04-21 08:30:47 +00:00
parent 0ba21de0f1
commit 0f3c027105
3 changed files with 83 additions and 37 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: awk.c 438 2011-04-17 15:38:21Z hyunghwan.chung $
* $Id: awk.c 440 2011-04-20 14:30:47Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
@ -167,15 +167,18 @@ static void stop_run (int sig)
#endif
#if defined(__OS2__)
static EXCEPTIONREGISTRATIONRECORD os2_excrr = { 0 };
#endif
static void set_intr_run (void)
{
#if defined(_WIN32)
SetConsoleCtrlHandler (stop_run, TRUE);
#elif defined(__OS2__)
EXCEPTIONREGISTRATIONRECORD rr = { 0 };
APIRET rc;
rr.ExceptionHandler = (ERR)stop_run;
rc = DosSetExceptionHandler (&rr);
os2_excrr.ExceptionHandler = (ERR)stop_run;
rc = DosSetExceptionHandler (&os2_excrr);
/*if (rc != NO_ERROR)...*/
#else
/*setsignal (SIGINT, stop_run, 1); TO BE MORE COMPATIBLE WITH WIN32*/
@ -188,10 +191,8 @@ static void unset_intr_run (void)
#if defined(_WIN32)
SetConsoleCtrlHandler (stop_run, FALSE);
#elif defined(__OS2__)
EXCEPTIONREGISTRATIONRECORD rr = { 0 };
APIRET rc;
rr.ExceptionHandler = (ERR)stop_run;
rc = DosUnsetExceptionHandler (&rr);
rc = DosUnsetExceptionHandler (&os2_excrr);
/*if (rc != NO_ERROR) ...*/
#else
setsignal (SIGINT, SIG_DFL, 1);
@ -747,9 +748,9 @@ qse_htb_walk_t add_global (qse_htb_t* map, qse_htb_pair_t* pair, void* arg)
static qse_mmgr_t xma_mmgr =
{
qse_xma_alloc,
qse_xma_realloc,
qse_xma_free,
(qse_mmgr_alloc_t)qse_xma_alloc,
(qse_mmgr_realloc_t)qse_xma_realloc,
(qse_mmgr_free_t)qse_xma_free,
QSE_NULL
};
@ -895,6 +896,7 @@ oops:
if (xma_mmgr.udd) qse_xma_close (xma_mmgr.udd);
freearg (&arg);
return ret;
}
@ -902,3 +904,4 @@ int qse_main (int argc, qse_achar_t* argv[])
{
return qse_runmain (argc, argv, awk_main);
}

View File

@ -67,63 +67,106 @@ qsecmn qseawk
0
17
WVList
3
18
ActionStates
19
WString
12
Local &Debug
20
WVList
1
21
MVState
22
WString
6
WDEBUG
23
WString
28
?????Application parameters:
1
24
WString
39
"BEGIN { print OFILENAME; print 100; }"
0
25
ActionStates
26
WString
13
Remote D&ebug
27
WVList
0
28
ActionStates
29
WString
5
&Make
30
WVList
0
-1
1
1
0
18
31
WPickList
2
19
32
MItem
3
*.c
20
33
WString
4
COBJ
21
34
WVList
1
22
35
MVState
23
36
WString
3
WCC
24
37
WString
25
o?2??Include directories:
1
25
38
WString
54
"$(%watcom)/h;$(%watcom)/h/os2;..\..\..\..\..\include"
0
26
39
WVList
0
-1
1
1
0
27
40
MItem
28
..\..\..\..\..\cmd\awk\awk.c
28
41
WString
4
COBJ
29
42
WVList
0
30
43
WVList
0
19
32
1
1
0

View File

@ -144,18 +144,18 @@ release/os2/lib/scm/qsescm.tgt
VComponent
33
WRect
100
0
60
1373
5700
4240
1
0
0
34
WFileName
28
debug/os2/lib/cmn/qsecmn.tgt
29
35
36
35
VComponent
36
@ -193,7 +193,7 @@ VComponent
42
WRect
2460
2413
2400
5700
4240
1
@ -257,9 +257,9 @@ VComponent
54
WRect
240
106
80
5700
4253
4240
0
0
55
@ -267,15 +267,15 @@ WFileName
28
debug/os2/lib/awk/qseawk.tgt
8
16
15
56
VComponent
57
WRect
830
2746
2720
5700
4253
4240
1
0
58
@ -288,10 +288,10 @@ debug/win32/lib/awk/qseawk.tgt
VComponent
60
WRect
2680
-133
2920
906
5700
4253
4240
0
0
61