| 2060 | |
| 2061 | |
| 2062 | static 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 |
no test coverage detected