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

Function subStatus

src/common/utils.cpp:1504–1555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1502}
1503
1504unsigned int subStatus(const ISC_STATUS* in, unsigned int cin,
1505 const ISC_STATUS* sub, unsigned int csub) throw()
1506{
1507 for (unsigned pos = 0; csub <= cin - pos; )
1508 {
1509 for (unsigned i = 0; i < csub; )
1510 {
1511 const ISC_STATUS* op1 = &in[pos + i];
1512 const ISC_STATUS* op2 = &sub[i];
1513 if (*op1 != *op2)
1514 goto miss;
1515
1516 i += nextArg(*op1);
1517 if (i > csub) // arg does not fit
1518 goto miss;
1519
1520
1521 if (isStr(*op1))
1522 {
1523 unsigned l1, l2;
1524 const char *s1, *s2;
1525 if (*op1 == isc_arg_cstring)
1526 {
1527 l1 = op1[1];
1528 l2 = op2[1];
1529 s1 = (const char*) (op1[2]);
1530 s2 = (const char*) (op2[2]);
1531 }
1532 else
1533 {
1534 s1 = (const char*) (op1[1]);
1535 s2 = (const char*) (op2[1]);
1536 l1 = strlen(s1);
1537 l2 = strlen(s2);
1538 }
1539
1540 if (l1 != l2)
1541 goto miss;
1542 if (memcmp(s1, s2, l1) != 0)
1543 goto miss;
1544 }
1545 else if (op1[1] != op2[1])
1546 goto miss;
1547 }
1548
1549 return pos;
1550
1551miss: pos += nextArg(in[pos]);
1552 }
1553
1554 return ~0u;
1555}
1556
1557// moves DB path information (from limbo transaction) to another buffer
1558void getDbPathInfo(unsigned int& itemsLength, const unsigned char*& items,

Callers 3

internal_postFunction · 0.85
ERR_post_warningFunction · 0.85
post_nothrowFunction · 0.85

Calls 2

nextArgFunction · 0.85
isStrFunction · 0.85

Tested by

no test coverage detected