1 /****^  ***********************************************************
 2         *                                                         *
 3         * Copyright, (C) Honeywell Bull Inc., 1987                *
 4         *                                                         *
 5         * Copyright, (C) Honeywell Information Systems Inc., 1982 *
 6         *                                                         *
 7         * Copyright (c) 1972 by Massachusetts Institute of        *
 8         * Technology and Honeywell Information Systems, Inc.      *
 9         *                                                         *
10         *********************************************************** */
11 
12 /* format: style4,indattr,ifthenstmt,ifthen,idind35,^indcomtxt */
13 
14 kstsrch: proc (uid, hash_bucket, kstep);
15 
16 /*
17 
18    --->  kstsrch searches the KST unique identifier hash table and returns a pointer  to  the
19    KSTE  desired  and the uid hash class.
20 
21    Modified November 1984 by Keith Loepere to remove hdr, also notion of
22    undetectable objects.
23 
24    USAGE:  call kstsrch(uid, hash_bucket, kstep);
25 
26    uid bit(36) aligned ---- unique id of object searched for (input)
27    hash_bucket fixed bin (17) ---- hash class (output)
28    kstep ptr ---- pointer to the desired KSTE if found else null (output)
29 
30 */
31 
32 /* Parameters */
33 
34 dcl  hash_bucket                        fixed bin (17) parameter;
35 dcl  uid                                bit (36) aligned parameter;
36 
37 /* dcl kstep                            ptr parameter; */
38 
39 /* Variables */
40 
41 dcl  ring                               fixed bin (3);
42 
43 /* Misc */
44 
45 dcl  (fixed, ptr, rel, null, mod, dimension) builtin;
46 
47 /* Entries */
48 
49 dcl  level$get                          entry () returns (fixed bin (3));
50 %page;
51           kstp = pds$kstp;
52           ring = level$get ();
53           hash_bucket = mod (fixed (uid), dimension (kst.uid_hash_bucket, 1));
54           do kstep = ptr (kstp, kst.uid_hash_bucket (hash_bucket))
55                repeat (ptr (kstp, kste.fp)) while (rel (kstep) ^= "0"b);
56                if uid = kste.uid then return;
57           end;
58           kstep = null ();
59           return;
60 %page; %include kst;
61      end kstsrch;