1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 capability_:
22 proc ();
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 dcl p_system_id fixed bin parameter;
39 dcl p_major_capability fixed bin parameter;
40 dcl p_major_number fixed bin parameter;
41
42
43
44 dcl p_code fixed bin (35);
45
46
47
48 dcl fixed8 fixed bin (8) based;
49 dcl fixed17 fixed bin (17) based;
50 dcl major_ptr ptr;
51 dcl major fixed bin (35);
52
53
54
55 dcl ws_error_$invalid_system_id
56 fixed bin (35) ext static;
57 dcl ws_error_$invalid_capability_number
58 fixed bin (35) ext static;
59
60
61 dcl 01 major_overlay unaligned based (major_ptr),
62 02 pad bit (18),
63 02 system fixed bin (8),
64 02 index fixed bin (8);
65
66
67 dcl addr builtin;
68 dcl convert builtin;
69
70
71 return;
72
73
74
75
76 pack:
77 entry (p_system_id, p_major_number, p_major_capability, p_code);
78
79 p_code = 0;
80 major = 0;
81 major_ptr = addr (major);
82
83
84
85 if (p_major_number < INTERNAL)
86 | (p_major_number > MAXIMUM_CAT_ENTRY) then do;
87
88 p_code = ws_error_$invalid_capability_number;
89 return;
90 end;
91
92
93
94 if (p_system_id ^= REMOTE_SYSTEM) & (p_system_id ^= LOCAL_SYSTEM)
95 then do;
96 p_code = ws_error_$invalid_system_id;
97 return;
98 end;
99
100
101
102 major_overlay.system = convert (fixed8, p_system_id);
103 major_overlay.index = convert (fixed8, p_major_number);
104 p_major_capability = convert (fixed17, major);
105 return;
106
107
108
109
110 unpack:
111 entry (p_system_id, p_major_number, p_major_capability, p_code);
112
113 p_code = 0;
114 major = p_major_capability;
115 major_ptr = addr (major);
116
117
118
119 if (major_overlay.system ^= LOCAL_SYSTEM
120 & major_overlay.system ^= REMOTE_SYSTEM)
121 | (major_overlay.index < INTERNAL
122 | major_overlay.index > MAXIMUM_CAT_ENTRY) then
123
124 p_code = ws_error_$invalid_capability_number;
125
126 else do;
127 p_major_number = major_overlay.index;
128 p_system_id = major_overlay.system;
129 end;
130 return;
131
132 %page;
133
134 %include "mowse";
135 %include "mowse_info";
136
137
138 end capability_;