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

Function SDL_walk

src/common/sdl.cpp:234–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232
233
234int SDL_walk(CheckStatusWrapper* status_vector,
235 const UCHAR* sdl,
236 UCHAR* array,
237 Ods::InternalArrayDesc* array_desc,
238 SLONG* variables,
239 SDL_walk_callback callback,
240 array_slice* argument)
241{
242/**************************************
243 *
244 * S D L _ w a l k
245 *
246 **************************************
247 *
248 * Functional description
249 * Walk a slice.
250 *
251 **************************************/
252 DSC junk;
253 USHORT n, offset;
254 sdl_arg arg;
255
256 arg.sdl_arg_array = array;
257 arg.sdl_arg_sdl = sdl;
258 arg.sdl_arg_desc = array_desc;
259 arg.sdl_arg_variables = variables;
260 arg.sdl_arg_callback = callback;
261 arg.sdl_arg_argument = argument;
262 arg.sdl_arg_status_vector = status_vector;
263 const UCHAR* p = sdl + 1;
264
265 while (*p != isc_sdl_eoc)
266 {
267 switch (*p++)
268 {
269 case isc_sdl_struct:
270 for (n = *p++; n; --n)
271 {
272 offset = p - sdl - 1;
273 if (!(p = sdl_desc(p, &junk)))
274 return error(status_vector, Arg::Gds(isc_invalid_sdl) << Arg::Num(offset));
275 }
276 break;
277
278 case isc_sdl_fid:
279 case isc_sdl_rid:
280 p += 2;
281 break;
282
283 case isc_sdl_field:
284 case isc_sdl_relation:
285 n = *p++;
286 p += n;
287 break;
288
289 default:
290 // Check that element is in range of valid SDL
291 fb_assert_continue(*(p - 1) >= isc_sdl_version1 && *(p - 1) <= isc_sdl_element);

Callers 2

get_sliceMethod · 0.85
put_sliceMethod · 0.85

Calls 7

sdl_descFunction · 0.85
GdsClass · 0.85
NumClass · 0.85
compileFunction · 0.85
stuffFunction · 0.85
executeFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected