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-10-21,ASmith), approve(87-07-13,MCR7580),
11      audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
12      Created.
13   2) change(86-10-29,Flegel), approve(87-07-13,MCR7580),
14      audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
15      Reduced to a simple send message to the
16      appropriate internal MOWSE on the necessary system.
17                                                    END HISTORY COMMENTS */
18 
19 /* : PROCEDURE FUNCTION (i_connect)
20 
21 Generate a message to the appropriate system for connect request.
22 */
23 
24 #include <dos.h>
25 #include <stdio.h>
26 #include <ws_msg.h>
27 #include <wsmincap.h>
28 #include <cat.h>
29 #include <ws_dcls.h>
30 
31 #define INTERNAL         32            /* MOWSE's capability number */
32 #define HEADER_LENGTH    5             /* Length of message header */
33 
34 extern local_cat l_CAT[];
35 
36 i_connect (p_params)
37 
38 struct i_connect_request *p_params;
39 {
40 struct null_msg message;
41 
42    message.system        = p_params -> system;
43    message.major         = INTERNAL;
44    message.minor         = REQUEST_CONNECT;
45    message.source_system = p_params -> source_system;
46    message.source_major  = p_params -> source_major;
47 
48    return (send_i_mess (&message,HEADER_LENGTH,p_params->connect_command,strlen(p_params->connect_command)));
49 }
50 
51 /* : PROCEDURE FUNCTION (find_local_capability)
52 
53 Find the number of the capability given its name from within the user's
54 data space.
55 */
56 
57 find_local_capability (p_name)
58 
59 char *p_name;                          /* Name of capability to find */
60 {
61 int i,j;
62 char cap_name[CAPABILITY_NAME_LENGTH];
63 int  cap_num;
64 int  code;
65 
66    for (i = 0; i < CAPABILITY_NAME_LENGTH; i++)
67    {  code = get_mcb_values (&l_CAT[i],cap_name,&cap_num);
68       if (code == 0)
69       {  for (j = 0; (p_name[j] == cap_name[j]) && (j < CAPABILITY_NAME_LENGTH); j++)
70          {  if (p_name[j] == NULL)
71                return(cap_num);
72          }
73       }
74    }
75    return(0);
76 }
77 ^Z