| 292 | |
| 293 | |
| 294 | ISC_STATUS filter_format(USHORT action, BlobControl* control) |
| 295 | { |
| 296 | /************************************** |
| 297 | * |
| 298 | * f i l t e r _ f o r m a t |
| 299 | * |
| 300 | ************************************** |
| 301 | * |
| 302 | * Functional description |
| 303 | * Get next segment from a record format blob. |
| 304 | * |
| 305 | **************************************/ |
| 306 | |
| 307 | if (action != isc_blob_filter_open) |
| 308 | return string_filter(action, control); |
| 309 | |
| 310 | // 1 2 3 4 5 6 |
| 311 | // 12345678901234567890123456789012345678901234567890123456789012345678 |
| 312 | const char* head1 = " id offset type length sub_type flags"; // descriptors |
| 313 | const char* sep1 = "--- ------ -------------- ------ -------- -----"; |
| 314 | |
| 315 | const char* head2 = " id type length default value"; // defaults |
| 316 | const char* sep2 = "--- -------------- ------ -----------------------------------"; |
| 317 | |
| 318 | const char* fmt1 = "%3d %6d %2d %-11s %6d %8d 0x%02x"; // descriptors |
| 319 | const char* fmt2 = "%3d %2d %-11s %6d %s"; // defaults |
| 320 | |
| 321 | const char* name1 = "Fields:"; |
| 322 | const char* name2 = "Defaults:"; |
| 323 | |
| 324 | string str; |
| 325 | USHORT length; |
| 326 | ISC_STATUS status; |
| 327 | |
| 328 | // read number of fields descriptors |
| 329 | |
| 330 | USHORT num; |
| 331 | status = caller(isc_blob_filter_get_segment, control, |
| 332 | sizeof(USHORT), reinterpret_cast<UCHAR*>(&num), &length); |
| 333 | if (status != FB_SUCCESS && status != isc_segment) |
| 334 | return status; |
| 335 | |
| 336 | if (num) |
| 337 | { |
| 338 | string_put(control, name1); |
| 339 | string_put(control, head1); |
| 340 | string_put(control, sep1); |
| 341 | } |
| 342 | |
| 343 | // read fields descriptors |
| 344 | for (int id = 0; num; --num, id++) |
| 345 | { |
| 346 | Ods::Descriptor desc; |
| 347 | memset(&desc, 0, sizeof(desc)); |
| 348 | |
| 349 | status = caller(isc_blob_filter_get_segment, control, |
| 350 | sizeof(desc), reinterpret_cast<UCHAR*>(&desc), &length); |
| 351 | if (status != FB_SUCCESS && status != isc_segment) |
nothing calls this directly
no test coverage detected