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

Function xdr_longs

src/remote/protocol.cpp:1521–1568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1519
1520
1521static bool_t xdr_longs( RemoteXdr* xdrs, CSTRING* cstring)
1522{
1523/**************************************
1524 *
1525 * x d r _ l o n g s
1526 *
1527 **************************************
1528 *
1529 * Functional description
1530 * Pass a vector of longs.
1531 *
1532 **************************************/
1533 if (!xdr_long(xdrs, reinterpret_cast<SLONG*>(&cstring->cstr_length)))
1534 {
1535 return FALSE;
1536 }
1537
1538 // string length was USHORT in older versions
1539 fixupLength(xdrs, cstring->cstr_length);
1540
1541 // Handle operation specific stuff, particularly memory allocation/deallocation
1542
1543 switch (xdrs->x_op)
1544 {
1545 case XDR_ENCODE:
1546 break;
1547
1548 case XDR_DECODE:
1549 if (!alloc_cstring(xdrs, cstring))
1550 return FALSE;
1551 break;
1552
1553 case XDR_FREE:
1554 cstring->free(xdrs);
1555 return TRUE;
1556 }
1557
1558 const size_t n = cstring->cstr_length / sizeof(SLONG);
1559
1560 SLONG* next = (SLONG*) cstring->cstr_address;
1561 for (const SLONG* const end = next + n; next < end; next++)
1562 {
1563 if (!xdr_long(xdrs, next))
1564 return FALSE;
1565 }
1566
1567 return TRUE;
1568}
1569
1570
1571static bool_t xdr_message( RemoteXdr* xdrs, RMessage* message, const rem_fmt* format)

Callers

nothing calls this directly

Calls 4

xdr_longFunction · 0.85
fixupLengthFunction · 0.85
alloc_cstringFunction · 0.85
freeMethod · 0.45

Tested by

no test coverage detected