1
2
3
4
5
6
7 linus_query:
8 proc (lcb_ptr_parm, answer_parm, question_parm);
9
10
11
12
13
14
15
16
17
18
19 %page;
20
21
22
23
24
25
26
27
28
29
30
31
32 %page;
33 dcl answer_parm char(*) var parm;
34 dcl lcb_ptr_parm ptr parm;
35 dcl question_parm char(*) var parm;
36 dcl yes_no_parm bit (1) aligned parm;
37
38
39
40 answer_parm = "";
41 lcb_ptr = lcb_ptr_parm;
42 question = question_parm;
43
44 query_information.switches.yes_or_no_sw = "0"b;
45 call query;
46 answer_parm = answer;
47 return;
48
49 yes_no: entry (lcb_ptr_parm, yes_no_parm, question_parm);
50
51
52
53
54 yes_no_parm = "0"b;
55 lcb_ptr = lcb_ptr_parm;
56 question = question_parm;
57
58 query_information.switches.yes_or_no_sw = "1"b;
59 call query;
60
61 if substr (answer, 1, 1) = "y"
62 then yes_no_parm = "1"b;
63
64 return;
65
66 query: proc;
67 query_information.version = query_info_version_5;
68 query_information.switches.suppress_name_sw = "1"b;
69 query_information.switches.cp_escape_control = "00"b;
70 query_information.switches.suppress_spacing = "1"b;
71 query_information.switches.padding = "0"b;
72 query_information.status_code = 0;
73 query_information.query_code = 0;
74 query_information.question_iocbp = iox_$user_output;
75 query_information.answer_iocbp = iox_$user_input;
76 query_information.repeat_time = 0;
77 query_information.explanation_ptr = null();
78 query_information.explanation_len = 0;
79
80
81
82
83
84
85 if lcb.is_ptr ^= iox_$user_input
86 then query_information.answer_iocbp = iox_$user_io;
87
88
89
90
91 call command_query_ (addr(query_information), answer, "linus_query", (question));
92
93 return;
94 end;
95 %page;
96 %include iocb;
97 %page;
98 %include linus_lcb;
99 %page;
100 %include query_info;
101 ^L
102
103 dcl answer char(linus_data_$buff_len) varying;
104 dcl 1 query_information like query_info;
105 dcl question char(linus_data_$buff_len) varying;
106
107
108 dcl (addr, fixed, null, rel, substr) builtin;
109
110
111 dcl iox_$user_input ptr ext static;
112 dcl iox_$user_io ptr ext static;
113 dcl iox_$user_output ptr ext static;
114 dcl linus_data_$buff_len fixed bin(35) ext static;
115 dcl sys_info$max_seg_size fixed bin(35) ext static;
116
117
118 dcl command_query_ entry() options(variable);
119
120 end linus_query;
121
122
123
124