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-12,Westcott), 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 (sendqrep)
16 
17 Send a user' response to a query message to the originator of the background
18 query message. The reponse must be less than or equal to WSPAKSIZ characters
19 in length.
20 */
21 
22 #include <dos.h>
23 #include <stdio.h>
24 #include <ws.h>
25 #include <ws_msg.h>
26 #include <ws_func.h>
27 #include <ws_mcb.h>
28 #include <wsmincap.h>
29 #include <ws_error.h>
30 
31 #define HEADER_SIZE 5
32 
33 sendqrep (p_reply_string, p_major_num)
34 
35 char *p_reply_string;     /* Reply to be sent */
36 int p_major_num;          /* Destination of reply */
37 {
38 int code;                 /* return code */
39 int msg_len;              /* Length of reply string */
40 int system_id;            /* Temporary system id */
41 int major;                /* Temporary major */
42 struct packet_msg msg;    /* structure for message */
43 
44 /* : copy reply string to mowse buffer */
45 
46    msg_len = stccpy (msg.msg_data, p_reply_string, WSPAKSIZ);
47 
48    c_unpack (&system_id, &major, p_major_num);
49    msg.system = system_id;
50    msg.major = major;
51    msg.minor = QUERY_REPLY;
52    msg.source_system = WSIBMPC;
53    msg.source_major = WSMAJCAP;
54 
55 /* : call user_interrupt to send data (don't send the null) */
56 
57    return (call_mowse_int (I$SENDBG, &msg , msg_len - 1 + HEADER_SIZE));
58 }
59 ^Z