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-07-13,Westcott), approve(87-07-13,MCR7580),
11      audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
12      Created.
13   2) change(86-11-11,Flegel), approve(87-07-13,MCR7580),
14      audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
15      Source capability needs to be passed in the
16      message.
17                                                    END HISTORY COMMENTS */
18 
19 /* : PROCEDURE FUNCTION (resetcap)
20 
21 Sends a "RESET_APPLICATION" minor capability message to the addressed major
22 capability. This message is used by the major capability as a signal to
23 discard all un-processed buffers amd to reset all counters, etc.
24 */
25 
26 #include <stdio.h>
27 #include <ws.h>
28 #include <wsmincap.h>
29 #include <ws_mcb.h>
30 #include <ws_dcls.h>
31 #include <ws_func.h>
32 #include <ws_error.h>
33 
34 resetcap (p_major_number, p_mcb_ptr)
35 
36 int p_major_number;
37 mcb *p_mcb_ptr;
38 {
39 int code;                /* return code  */
40 int system;              /* Temp system id */
41 int major;               /* Temp major cap */
42 struct xcap_struc xcap;  /* parameter area for call to MOWSE */
43 
44    if (p_mcb_ptr == NULL)
45       return (WSINVMCB);
46 
47 /* : send message to application */
48 
49    if (code = c_unpack (&system, &major, p_major_number))
50       return (code);
51 
52    xcap.system = (char)system;
53    xcap.major = (char)major;
54    xcap.minor = RESET_APPLICATION;
55    xcap.source_system = p_mcb_ptr -> system_id;
56    xcap.source_major  = p_mcb_ptr -> major_capability;
57 
58    return (call_mowse_int (I$RESET, &xcap, sizeof (xcap) - 1));
59 }
60 ^Z