MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / PRETTY_print_cdb

Function PRETTY_print_cdb

src/common/pretty.cpp:126–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124//
125
126int PRETTY_print_cdb(const UCHAR* blr, FPTR_PRINT_CALLBACK routine, void* user_arg, SSHORT language)
127{
128
129 ctl ctl_buffer;
130 ctl* control = &ctl_buffer;
131
132 if (!routine)
133 {
134 routine = gds__default_printer;
135 user_arg = NULL;
136 }
137
138 control->ctl_routine = routine;
139 control->ctl_user_arg = user_arg;
140 control->ctl_blr = control->ctl_blr_start = blr;
141 control->ctl_ptr = control->ctl_buffer;
142 control->ctl_language = language;
143
144 SSHORT level = 0;
145 indent(control, level);
146 const SSHORT i = BLR_BYTE;
147
148 SCHAR temp[32];
149 if (*control->ctl_blr)
150 sprintf(temp, "gds__dpb_version%d, ", i);
151 else
152 sprintf(temp, "gds__dpb_version%d", i);
153 blr_format(control, temp);
154
155 SSHORT offset = 0;
156 print_line(control, offset);
157
158 SSHORT parameter;
159 while (parameter = BLR_BYTE)
160 {
161 const char* p;
162 if (parameter > FB_NELEM(cdb_table) || !(p = cdb_table[parameter]))
163 {
164 return error(control, 0, "*** cdb parameter %d is undefined ***\n", parameter);
165 }
166 indent(control, level);
167 blr_format(control, p);
168 PUT_BYTE(',');
169 int length = print_byte(control);
170 if (length)
171 {
172 do {
173 print_char(control, offset);
174 } while (--length);
175 }
176 print_line(control, offset);
177 }
178
179 return 0;
180}
181
182
183int PRETTY_print_dyn(const UCHAR* blr, FPTR_PRINT_CALLBACK routine, void* user_arg, SSHORT language)

Callers 7

gen_requestFunction · 0.85
gen_requestFunction · 0.85
gen_request_dataFunction · 0.85
gen_requestFunction · 0.85
gen_requestFunction · 0.85
gen_requestFunction · 0.85
gen_requestFunction · 0.85

Calls 6

indentFunction · 0.85
print_lineFunction · 0.85
print_byteFunction · 0.85
print_charFunction · 0.85
blr_formatFunction · 0.70
errorFunction · 0.70

Tested by

no test coverage detected