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-06,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 (findname)
16 
17 Find the name of a capability given its major capability number.  The
18 code for this routine sits in the application's memory space and simply
19 passes its parameters to the internal mowse interrupt routine which finds
20 and returns the return code and capability name.
21 */
22 
23 #include <dos.h>
24 #include <cat.h>
25 #include <ws_dcls.h>
26 #include <ws_func.h>
27 
28 #define NULL 0
29 
30 extern char local_system;              /* Local system ID */
31 
32 findname (p_capability_number, p_capability_name)
33 
34 int  p_capability_number;              /* Capability number to find */
35 char *p_capability_name;               /* Name of found capability */
36 {
37 struct findname_param_struct param;    /* parameter structure for user interrupt */
38 int code;                              /* return code from user interrupt */
39 char *s1;                              /* pointer to source string */
40 char *d1;                              /* pointer to destination string */
41 int i;                                 /* counter for copy */
42 
43    param.major_capability_number = p_capability_number;
44 
45 /* : call the mowse interrupt routine for finding capability name
46      - if the capability name was found
47      -- copy capability name into caller's buffer */
48 
49    code = call_mowse_int (I$FINDNAME, &param, sizeof(param));
50    if (code)
51       return (code);
52 
53    s1 = &(param.capability_name[0]);
54    d1 = p_capability_name;
55    for (i = 0; i < CAPABILITY_NAME_LENGTH; i++) {
56       *d1++ = *s1++;
57    }
58 
59    return(0);
60 }
61 ^Z