| 157 | |
| 158 | |
| 159 | ISC_STATUS SDL_info(CheckStatusWrapper* status_vector, |
| 160 | const UCHAR* sdl, sdl_info* info, SLONG* vector) |
| 161 | { |
| 162 | /************************************** |
| 163 | * |
| 164 | * S D L _ i n f o |
| 165 | * |
| 166 | ************************************** |
| 167 | * |
| 168 | * Functional description |
| 169 | * Parse enough of SDL to pick relation and field identification and |
| 170 | * element descriptor. |
| 171 | * |
| 172 | **************************************/ |
| 173 | USHORT n, offset; |
| 174 | array_range range; |
| 175 | |
| 176 | const UCHAR* p = sdl; |
| 177 | info->sdl_info_fid = info->sdl_info_rid = 0; |
| 178 | info->sdl_info_relation = info->sdl_info_field = ""; |
| 179 | |
| 180 | if (*p++ != isc_sdl_version1) |
| 181 | return error(status_vector, Arg::Gds(isc_invalid_sdl) << Arg::Num(0)); |
| 182 | |
| 183 | for (;;) |
| 184 | switch (*p++) |
| 185 | { |
| 186 | case isc_sdl_struct: |
| 187 | n = *p++; |
| 188 | if (n != 1) |
| 189 | return error(status_vector, Arg::Gds(isc_invalid_sdl) << Arg::Num(p - sdl - 1)); |
| 190 | offset = p - sdl; |
| 191 | if (!(p = sdl_desc(p, &info->sdl_info_element))) |
| 192 | return error(status_vector, Arg::Gds(isc_invalid_sdl) << Arg::Num(offset)); |
| 193 | info->sdl_info_element.dsc_address = 0; |
| 194 | break; |
| 195 | |
| 196 | case isc_sdl_fid: |
| 197 | info->sdl_info_fid = get_word(p); |
| 198 | break; |
| 199 | |
| 200 | case isc_sdl_rid: |
| 201 | info->sdl_info_rid = get_word(p); |
| 202 | break; |
| 203 | |
| 204 | case isc_sdl_field: |
| 205 | n = *p++; |
| 206 | info->sdl_info_field.assign(reinterpret_cast<const char*>(p), n); |
| 207 | p += n; |
| 208 | break; |
| 209 | |
| 210 | case isc_sdl_relation: |
| 211 | n = *p++; |
| 212 | info->sdl_info_relation.assign(reinterpret_cast<const char*>(p), n); |
| 213 | p += n; |
| 214 | break; |
| 215 | |
| 216 | default: |