1 PACKAGE diutil IS
2
3 e_subpnotfound EXCEPTION;
4 e_notinpackage EXCEPTION;
5 e_nopriv EXCEPTION;
6 e_stubtoolong EXCEPTION;
7 e_notv6compat EXCEPTION;
8 e_other EXCEPTION;
9
10 SUBTYPE ptnod IS pidl.ptnod;
11 SUBTYPE ub4 IS pidl.ub4;
12
13 -- RETURN code FROM diutil functions
14 --
15 s_ok CONSTANT NUMBER := 0; -- successful
16 s_notinpackage CONSTANT NUMBER := 6; -- PACKAGE found, proc NOT found
17 s_subpnotfound CONSTANT NUMBER := 1; -- subprogram NOT found
18 s_stubtoolong CONSTANT NUMBER := 3; -- text TO be returned IS too long
19 s_logic CONSTANT NUMBER := 4; -- logic error
20 s_other CONSTANT NUMBER := 5; -- other error
21 s_defaultval CONSTANT NUMBER := 8; -- true iff parameters have DEFAULT
22 -- VALUES. applicable TO pstub
23 s_notv6compat CONSTANT NUMBER := 7; -- found non v6 TYPE OR construct
24
25 char_for_varchar2 BOOLEAN; -- SET FROM flags FOR v6 compatibility
26
27 libunit_type_spec CONSTANT NUMBER := 1;
28 libunit_type_body CONSTANT NUMBER := 2;
29
30 load_source_yes CONSTANT NUMBER := 1;
31 load_source_no CONSTANT NUMBER := 2;
32
33 -- get_d: returns the root OF the diana OF a libunit, given name AND usr.
34 -- name will be first folded TO upper CASE IF NOT IN quotes, ELSE stripped
35 -- OF quotes.
36 -- IN: name = subprogram name
37 -- usr = user name
38 -- dbname = database name, NULL FOR CURRENT
39 -- dbowner = NULL FOR CURRENT
40 -- libunit_type = libunit_type_spec FOR spec,
41 -- = libunit_type_body FOR BODY
42 -- OUT: status = s_ok(0): diana root returned IN nod
43 -- s_subpnotfound: nod NULL
44 -- s_other: other error, nod NULL
45 --
46 PROCEDURE get_d(name VARCHAR2, usr VARCHAR2, dbname VARCHAR2,
47 dbowner VARCHAR2, status IN OUT ub4, nod OUT ptnod,
48 libunit_type NUMBER := libunit_type_spec,
49 load_source NUMBER := load_source_no);
50
51 -- get_diana: returns the root OF the diana OF a libunit, given name AND usr.
52 -- name will be first folded TO upper CASE IF NOT IN quotes, ELSE stripped
53 -- OF quotes. will trace synonym links.
54 -- IN: name = subprogram name
55 -- usr = user name
56 -- dbname = database name, NULL FOR CURRENT
57 -- dbowner = NULL FOR CURRENT
58 -- libunit_type = libunit_type_spec FOR spec,
59 -- = libunit_type_body FOR BODY
60 -- OUT: status = s_ok(0): diana root returned IN nod
61 -- s_subpnotfound: nod NULL
62 -- s_other: other error, nod NULL
63 --
64 PROCEDURE get_diana(name VARCHAR2, usr VARCHAR2, dbname VARCHAR2,
65 dbowner VARCHAR2, status IN OUT ub4, nod IN OUT ptnod,
66 libunit_type NUMBER := libunit_type_spec,
67 load_source NUMBER := load_source_no);
68
69 -- subptxt: returns the text OF a subprogram source (describe).
70 -- IN: name - PACKAGE OR toplevel proc/func name;
71 -- subname - non-NULL TO specify proc/func IN PACKAGE <name>.
72 -- dbname - database name
73 -- dbowner - dbase owner
74 -- OUT: status = s_ok (0): text returned IN txt
75 -- s_subpnotfound: txt empty
76 -- s_notinpackagte: txt empty
77 -- s_stubtoolong: txt len too small; txt empty
78 -- s_logic: logic error; txt empty
79 -- s_other: other failure; txt empty
80 --
81 PROCEDURE subptxt(name VARCHAR2, subname VARCHAR2, usr VARCHAR2,
82 dbname VARCHAR2, dbowner VARCHAR2, txt IN OUT VARCHAR2,
83 status IN OUT ub4);
84
85 -- bool_to_int: translates 3-valued BOOLEAN TO NUMBER FOR USE
86 -- IN sending BOOLEAN parameter / RETURN VALUES
87 -- BETWEEN pls v1 (client) AND pls v2. since sqlnet
88 -- has no BOOLEAN bind variable TYPE, we encode
89 -- booleans AS false = 0, true = 1, NULL = NULL FOR
90 -- network transfer AS NUMBER
91 --
92 FUNCTION bool_to_int( b BOOLEAN) RETURN NUMBER;
93
94 -- int_to_bool: translates 3-valued NUMBER encoding TO BOOLEAN FOR USE
95 -- IN sending BOOLEAN parameter / RETURN VALUES
96 -- BETWEEN pls v1 (client) AND pls v2. since sqlnet
97 -- has no BOOLEAN bind variable TYPE, we encode
98 -- booleans AS false = 0, true = 1, NULL = NULL FOR
99 -- network transfer AS NUMBER
100 --
101 function int_to_bool( n NUMBER) return boolean;
102
103 -- node_use_statistics: reports libunit's node count and limit
104 --
105 -- Parameters:
106 --
107 -- libunit_node : legal ptnod, as returned by get_diana or get_d
108 -- node_count : how many diana nodes the unit contains
109 -- node_limit : that many diana nodes allowed to allocate
110 --
111 procedure node_use_statistics (libunit_node IN ptnod,
112 node_count out ub4,
113 node_limit out ub4);
114
115 -- attribute_use_statistics: reports libunit's attribute count and limit
116 --
117 -- Parameters:
118 --
119 -- libunit_node : legal ptnod, as returned by get_diana or get_d
120 -- attribute_count : how many diana attributes the unit contains
121 -- attribute_limit : that many diana attributes allowed to allocate
122 --
123 procedure attribute_use_statistics (libunit_node IN ptnod,
124 attribute_count out ub4,
125 attribute_limit out ub4);
126
127 end diutil;