| 1448 | // |
| 1449 | |
| 1450 | static void cmp_field( const gpre_nod* node, gpre_req* request) |
| 1451 | { |
| 1452 | CMP_check(request, 0); |
| 1453 | |
| 1454 | const ref* reference = (ref*) node->nod_arg[0]; |
| 1455 | if (!reference) |
| 1456 | { |
| 1457 | CPR_error("cmp_field: reference missing"); |
| 1458 | return; // NULL; |
| 1459 | } |
| 1460 | |
| 1461 | const gpre_ctx* context = reference->ref_context; |
| 1462 | if (!context) |
| 1463 | { |
| 1464 | CPR_error("cmp_field: context missing"); |
| 1465 | return; // NULL; |
| 1466 | } |
| 1467 | |
| 1468 | const gpre_fld* field = reference->ref_field; |
| 1469 | if (!field) |
| 1470 | { |
| 1471 | CPR_error("cmp_field: field missing"); |
| 1472 | return; // NULL; |
| 1473 | } |
| 1474 | |
| 1475 | if (!field) |
| 1476 | puts("cmp_field: symbol missing"); |
| 1477 | |
| 1478 | if (context->ctx_flags & CTX_null) |
| 1479 | { |
| 1480 | request->add_byte(blr_null); |
| 1481 | } |
| 1482 | else if (field->fld_flags & FLD_dbkey) |
| 1483 | { |
| 1484 | request->add_byte(blr_dbkey); |
| 1485 | request->add_byte(context->ctx_internal); |
| 1486 | } |
| 1487 | /* This code cannot run because REF_union is never activated, parser bug? |
| 1488 | else if (reference->ref_flags & REF_union) |
| 1489 | { |
| 1490 | request->add_byte(blr_fid); |
| 1491 | request->add_byte(context->ctx_internal); |
| 1492 | request->add_word(reference->ref_id); |
| 1493 | } |
| 1494 | */ |
| 1495 | else if (gpreGlob.sw_ids) |
| 1496 | { |
| 1497 | request->add_byte(blr_fid); |
| 1498 | request->add_byte(context->ctx_internal); |
| 1499 | request->add_word(field->fld_id); |
| 1500 | } |
| 1501 | else |
| 1502 | { |
| 1503 | request->add_byte(blr_field); |
| 1504 | request->add_byte(context->ctx_internal); |
| 1505 | CMP_stuff_symbol(request, field->fld_symbol); |
| 1506 | } |
| 1507 | |