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

Function ask

src/alice/tdr.cpp:637–672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635//
636
637static SINT64 ask()
638{
639 AliceGlobals* tdgbl = AliceGlobals::getSpecific();
640
641 if (tdgbl->uSvc->isService())
642 return ~SINT64(0);
643
644 char response[32];
645 SINT64 switches = 0;
646
647 while (true)
648 {
649 ALICE_print(85);
650 // msg 85: Commit, rollback, or neither (c, r, or n)?
651 int c;
652 const char* end = response + sizeof(response) - 1;
653 char* p = response;
654 while ((c = getchar()) != '\n' && !feof(stdin) && !ferror(stdin) && p < end)
655 *p++ = c;
656 if (p == response)
657 return ~SINT64(0);
658 *p = 0;
659 ALICE_upper_case(response, response, sizeof(response));
660 if (!strcmp(response, "N") || !strcmp(response, "C") || !strcmp(response, "R"))
661 {
662 break;
663 }
664 }
665
666 if (response[0] == 'C')
667 switches |= sw_commit;
668 else if (response[0] == 'R')
669 switches |= sw_rollback;
670
671 return switches;
672}
673
674
675//____________________________________________________________

Callers 2

TDR_reconnect_multipleFunction · 0.85
reconnectFunction · 0.85

Calls 6

ALICE_printFunction · 0.85
getcharFunction · 0.85
feofFunction · 0.85
ferrorFunction · 0.85
ALICE_upper_caseFunction · 0.85
isServiceMethod · 0.45

Tested by

no test coverage detected