| 1519 | |
| 1520 | |
| 1521 | static 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 | |
| 1571 | static bool_t xdr_message( RemoteXdr* xdrs, RMessage* message, const rem_fmt* format) |
nothing calls this directly
no test coverage detected