1 /*  BEGIN:   _ssu_check_sci.incl.pl1                          *  *  *  *  *  */
 2 
 3 /* Created:  25 February 1982 by G. Palter */
 4 /* Modified: 6 November 1984 by G. Palter for version 3 and new sub_err_
 5                                           calling sequence */
 6 
 7 
 8 /****^  HISTORY COMMENTS:
 9   1) change(87-02-07,GDixon), approve(87-05-25,MCR7680),
10      audit(87-06-02,Parisek), install(87-08-04,MR12.1-1056):
11      Modified to verify that p_sci_ptr has proper its modifier by overlaying it
12      with the structure in its.incl.pl1, rather than assuming knowledge of
13      pointer format.
14                                                    END HISTORY COMMENTS */
15 
16 
17 /* format: style4,delnl,insnl,ifthenstmt,ifthen */
18 
19 /* *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */
20 /*                                                                           */
21 /* Validates that the caller's sci_ptr acutally references a valid           */
22 /* subsystem control info structure.                                         */
23 /*                                                                           */
24 /* *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */
25 
26 ssu_check_sci:
27      procedure (p_sci_ptr);
28 
29 dcl  p_sci_ptr pointer parameter;
30 
31 dcl  SSU_ character (32) static options (constant) initial ("ssu_");
32 
33 dcl  error_table_$bad_ptr fixed binary (35) external;
34 dcl  error_table_$null_info_ptr fixed binary (35) external;
35 dcl  error_table_$unimplemented_version fixed binary (35) external;
36 
37 dcl  sub_err_ entry () options (variable);
38 
39 dcl  (null, substr, unspec) builtin;
40 
41           if addr(p_sci_ptr) -> its.its_mod ^= ITS_MODIFIER then do;
42 RESIGNAL_BAD_POINTER:
43                call sub_err_ (error_table_$bad_ptr, SSU_, ACTION_CANT_RESTART, null (), (0), "^24.3b", unspec (p_sci_ptr));
44                go to RESIGNAL_BAD_POINTER;
45           end;
46 
47           if p_sci_ptr = null () then do;
48 RESIGNAL_NULL_POINTER:
49                call sub_err_ (error_table_$null_info_ptr, SSU_, ACTION_CANT_RESTART, null (), (0), "sci_ptr");
50                go to RESIGNAL_NULL_POINTER;
51           end;
52 
53           if p_sci_ptr -> sci.version = SCI_VERSION_3 then  /* all is well */
54                return;
55 
56 RESIGNAL_BAD_VERSION:
57           call sub_err_ (error_table_$unimplemented_version, SSU_, ACTION_CANT_RESTART, null (), (0), "^24.3b",
58                unspec (p_sci_ptr -> sci.version));
59           go to RESIGNAL_BAD_VERSION;
60 ^L
61 %include its;
62 ^L
63 %include sub_err_flags;
64 
65      end ssu_check_sci;
66 
67 
68 /*  END OF:  _ssu_check_sci.incl.pl1                          *  *  *  *  *  */