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

Function gen_whenever

src/gpre/c_cxx.cpp:3510–3539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3508//
3509
3510static void gen_whenever( const swe* label, int column)
3511{
3512 const TEXT* condition = NULL;
3513
3514 while (label)
3515 {
3516 switch (label->swe_condition)
3517 {
3518 case SWE_error:
3519 condition = "SQLCODE < 0";
3520 break;
3521
3522 case SWE_warning:
3523 condition = "SQLCODE > 0 && SQLCODE != 100";
3524 break;
3525
3526 case SWE_not_found:
3527 condition = "SQLCODE == 100";
3528 break;
3529
3530 default:
3531 // condition undefined
3532 fb_assert(false);
3533 return;
3534 }
3535 align(column);
3536 fprintf(gpreGlob.out_file, "if (%s) goto %s;", condition, label->swe_label);
3537 label = label->swe_next;
3538 }
3539}
3540
3541
3542//____________________________________________________________

Callers 3

C_CXX_actionFunction · 0.70
gen_get_or_put_sliceFunction · 0.70
gen_sliceFunction · 0.70

Calls 1

alignFunction · 0.70

Tested by

no test coverage detected