MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / API_ROUTINE gds__blob_size

Function API_ROUTINE gds__blob_size

src/yvalve/utl.cpp:1459–1511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1457
1458
1459int API_ROUTINE gds__blob_size(FB_API_HANDLE* b, SLONG* size, SLONG* seg_count, SLONG* max_seg)
1460{
1461/**************************************
1462 *
1463 * g d s _ $ b l o b _ s i z e
1464 *
1465 **************************************
1466 *
1467 * Functional description
1468 * Get the size, number of segments, and max
1469 * segment length of a blob. Return TRUE
1470 * if it happens to succeed.
1471 *
1472 **************************************/
1473 ISC_STATUS_ARRAY status_vector;
1474 UCHAR buffer[64];
1475
1476 if (isc_blob_info(status_vector, b, sizeof(blob_items), blob_items, sizeof(buffer), (SCHAR*)buffer))
1477 {
1478 isc_print_status(status_vector);
1479 return FALSE;
1480 }
1481
1482 for (ClumpletReader p(ClumpletReader::InfoResponse, buffer, sizeof(buffer)); !p.isEof(); p.moveNext())
1483 {
1484 UCHAR item = p.getClumpTag();
1485 if (item == isc_info_end)
1486 break;
1487
1488 switch (item)
1489 {
1490 case isc_info_blob_max_segment:
1491 if (max_seg)
1492 *max_seg = p.getInt();
1493 break;
1494
1495 case isc_info_blob_num_segments:
1496 if (seg_count)
1497 *seg_count = p.getInt();
1498 break;
1499
1500 case isc_info_blob_total_length:
1501 if (size)
1502 *size = p.getInt();
1503 break;
1504
1505 default:
1506 return FALSE;
1507 }
1508 }
1509
1510 return TRUE;
1511}
1512
1513
1514// 17 May 2001 - isc_expand_dpb is DEPRECATED

Callers

nothing calls this directly

Calls 4

getClumpTagMethod · 0.80
isEofMethod · 0.45
moveNextMethod · 0.45
getIntMethod · 0.45

Tested by

no test coverage detected