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. Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE. This file is part of QSE.
@ -167,15 +167,18 @@ static void stop_run (int sig)
#endif #endif
#if defined(__OS2__)
static EXCEPTIONREGISTRATIONRECORD os2_excrr = { 0 };
#endif
static void set_intr_run (void) static void set_intr_run (void)
{ {
#if defined(_WIN32) #if defined(_WIN32)
SetConsoleCtrlHandler (stop_run, TRUE); SetConsoleCtrlHandler (stop_run, TRUE);
#elif defined(__OS2__) #elif defined(__OS2__)
EXCEPTIONREGISTRATIONRECORD rr = { 0 };
APIRET rc; APIRET rc;
rr.ExceptionHandler = (ERR)stop_run; os2_excrr.ExceptionHandler = (ERR)stop_run;
rc = DosSetExceptionHandler (&rr); rc = DosSetExceptionHandler (&os2_excrr);
/*if (rc != NO_ERROR)...*/ /*if (rc != NO_ERROR)...*/
#else #else
/*setsignal (SIGINT, stop_run, 1); TO BE MORE COMPATIBLE WITH WIN32*/ /*setsignal (SIGINT, stop_run, 1); TO BE MORE COMPATIBLE WITH WIN32*/
@ -188,10 +191,8 @@ static void unset_intr_run (void)
#if defined(_WIN32) #if defined(_WIN32)
SetConsoleCtrlHandler (stop_run, FALSE); SetConsoleCtrlHandler (stop_run, FALSE);
#elif defined(__OS2__) #elif defined(__OS2__)
EXCEPTIONREGISTRATIONRECORD rr = { 0 };
APIRET rc; APIRET rc;
rr.ExceptionHandler = (ERR)stop_run; rc = DosUnsetExceptionHandler (&os2_excrr);
rc = DosUnsetExceptionHandler (&rr);
/*if (rc != NO_ERROR) ...*/ /*if (rc != NO_ERROR) ...*/
#else #else
setsignal (SIGINT, SIG_DFL, 1); 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 = static qse_mmgr_t xma_mmgr =
{ {
qse_xma_alloc, (qse_mmgr_alloc_t)qse_xma_alloc,
qse_xma_realloc, (qse_mmgr_realloc_t)qse_xma_realloc,
qse_xma_free, (qse_mmgr_free_t)qse_xma_free,
QSE_NULL QSE_NULL
}; };
@ -895,6 +896,7 @@ oops:
if (xma_mmgr.udd) qse_xma_close (xma_mmgr.udd); if (xma_mmgr.udd) qse_xma_close (xma_mmgr.udd);
freearg (&arg); freearg (&arg);
return ret; return ret;
} }
@ -902,3 +904,4 @@ int qse_main (int argc, qse_achar_t* argv[])
{ {
return qse_runmain (argc, argv, awk_main); return qse_runmain (argc, argv, awk_main);
} }

View File

@ -67,63 +67,106 @@ qsecmn qseawk
0 0
17 17
WVList 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 0
-1 -1
1 1
1 1
0 0
18 31
WPickList WPickList
2 2
19 32
MItem MItem
3 3
*.c *.c
20 33
WString WString
4 4
COBJ COBJ
21 34
WVList WVList
1 1
22 35
MVState MVState
23 36
WString WString
3 3
WCC WCC
24 37
WString WString
25 25
o?2??Include directories: o?2??Include directories:
1 1
25 38
WString WString
54 54
"$(%watcom)/h;$(%watcom)/h/os2;..\..\..\..\..\include" "$(%watcom)/h;$(%watcom)/h/os2;..\..\..\..\..\include"
0 0
26 39
WVList WVList
0 0
-1 -1
1 1
1 1
0 0
27 40
MItem MItem
28 28
..\..\..\..\..\cmd\awk\awk.c ..\..\..\..\..\cmd\awk\awk.c
28 41
WString WString
4 4
COBJ COBJ
29 42
WVList WVList
0 0
30 43
WVList WVList
0 0
19 32
1 1
1 1
0 0

View File

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