1 /* ***********************************************************
 2    *                                                         *
 3    * Copyright, (C) Honeywell Bull Inc., 1987                *
 4    *                                                         *
 5    * Copyright, (C) Honeywell Information Systems Inc., 1986 *
 6    *                                                         *
 7    *********************************************************** */
 8 
 9 /* HISTORY COMMENTS:
10   1) change(86-11-07,Flegel), approve(87-07-13,MCR7580),
11      audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
12      Created.
13                                                    END HISTORY COMMENTS */
14 
15 /* : PROCEDURE FUNCTION (dtm_mowse)
16 
17 When MOWSE receives information from Multics that MOWSE on Multics is detached
18 then MOWSE must be cleaned up on the PC.
19 */
20 
21 #include <stdio.h>
22 #include <dos.h>
23 #include <mowse.h>
24 #include <cat.h>
25 #include <ws_msg.h>
26 
27 extern local_cat l_cat[];              /* Currently loaded applications */
28 extern char      mysystem;             /* PC system id */
29 
30 dtm_mowse ()
31 {
32 int  i;
33 struct input_msg message;              /* Terminate message to capability */
34 
35 /* : For each loaded application (mcb_ptr is not NULL)
36      - send TERMINATE_APPLICATION to it */
37 
38    message.source_system = mysystem;
39    message.source_major  = WSMAJCAP;
40    message.msg_data[0]   = 0;
41    message.system        = mysystem;
42    message.minor         = TERMINATE_APPLICATION;
43 
44 /* For each of the capabilities which are loaded in the CAT, generate a
45    terminate_application message and release the memory to the system. */
46 
47    for (i = 0; i < NUMBER_OF_CAT_ENTRIES; i++)
48    {  if (l_cat[i].mcb_ptr)
49       {  message.major = i + MIN_CAPABILITY_NUMBER;
50          if (!(l_cat[i].flags & NULL_BIT))
51          {  wsexecap (&l_cat [i], &message, sizeof (struct input_msg) - 1);
52             free_cat_program (&l_cat[i]);
53          }
54       }
55    }
56 
57 /* Reinitialize the CATS */
58 
59    init_cat ();
60 
61    return (0);
62 }