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-05-10,Lee), approve(87-07-13,MCR7580), audit(87-07-13,Leskiw),
11      install(87-08-07,MR12.1-1072):
12      Created.
13                                                    END HISTORY COMMENTS */
14 
15 /* : PROCEDURE FUNCTION (findnumb):
16 
17 Find the major capability number of an application given a capability name.
18 */
19 
20 /* : RETURNS
21 
22      0, if major capability number found
23      WSINVNAM, if major capability number not found
24      WSINVSYS, if the system id is not valid.
25 */
26 
27 #include <dos.h>
28 #include <cat.h>
29 #include <ws_dcls.h>
30 #include <ws_func.h>
31 
32 #define LOW_8_BITS  0x00FF
33 
34 findnumb (capability_name,system_id ,major_capability_number)
35 
36 char *capability_name;                 /* Name of capability to find */
37 int  system_id;                        /* Id of system to find capability on */
38 int  *major_capability_number;         /* Address of retrun value for capability number */
39 {
40 struct findnumb_param_struct param;    /* structure for user interrupt call */
41 int  code;                             /* return code */
42 int  cap_num;                          /* major capability extracted from major_capability */
43 
44 /* : create major capability number, where system id occupies high 8 bits,
45      major_number low 8 bits */
46 
47    cap_num = *major_capability_number & LOW_8_BITS;
48    param.major_capability_number = (system_id << 8) | cap_num;
49 
50 /* : call the mowse interrupt routine to find the capability number */
51 
52    strncpy (param.capability_name, capability_name, CAPABILITY_NAME_LENGTH);
53    if (code = call_mowse_int (I$FINDNUMB, &param, sizeof(param)))
54       return (code);
55 
56    *major_capability_number = param.major_capability_number;
57 
58    return(0);
59 }
60 
61 /* : END findnumb */
62 ^Z