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

Function xdr_status_vector

src/remote/protocol.cpp:2062–2171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2060
2061
2062static bool_t xdr_status_vector(RemoteXdr* xdrs, DynamicStatusVector*& vector)
2063{
2064/**************************************
2065 *
2066 * x d r _ s t a t u s _ v e c t o r
2067 *
2068 **************************************
2069 *
2070 * Functional description
2071 * Map a status vector. This is tricky since the status vector
2072 * may contain argument types, numbers, and strings.
2073 *
2074 **************************************/
2075
2076 // If this is a free operation, release any allocated strings
2077
2078 if (xdrs->x_op == XDR_FREE)
2079 {
2080 delete vector;
2081 vector = NULL;
2082 return TRUE;
2083 }
2084
2085 if (!vector)
2086 vector = FB_NEW_POOL(*getDefaultMemoryPool()) DynamicStatusVector();
2087
2088 StaticStatusVector vectorDecode;
2089 const ISC_STATUS* vectorEncode = vector->value();
2090
2091 Stack<SCHAR*> space;
2092 bool rc = false;
2093
2094 SLONG vec;
2095
2096 while (true)
2097 {
2098 if (xdrs->x_op == XDR_ENCODE)
2099 vec = *vectorEncode++;
2100 if (!xdr_long(xdrs, &vec))
2101 goto brk;
2102 if (xdrs->x_op == XDR_DECODE)
2103 vectorDecode.push((ISC_STATUS) vec);
2104
2105 switch (static_cast<ISC_STATUS>(vec))
2106 {
2107 case isc_arg_end:
2108 rc = true;
2109 goto brk;
2110
2111 case isc_arg_interpreted:
2112 case isc_arg_string:
2113 case isc_arg_sql_state:
2114 if (xdrs->x_op == XDR_ENCODE)
2115 {
2116 if (!xdr_wrapstring(xdrs, (SCHAR**)(vectorEncode++)))
2117 goto brk;
2118 }
2119 else

Callers 1

xdr_protocolFunction · 0.85

Calls 10

getDefaultMemoryPoolFunction · 0.85
xdr_longFunction · 0.85
xdr_wrapstringFunction · 0.85
DynamicStatusVectorClass · 0.70
valueMethod · 0.45
pushMethod · 0.45
saveMethod · 0.45
beginMethod · 0.45
hasDataMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected