MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / InputString

Function InputString

io.cpp:2467–2485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2465// display and a string buffer to fill with it.
2466
2467void InputString(CONST char *szPrompt, char *sz)
2468{
2469 FILE *file;
2470 int cch;
2471
2472 file = is.S; is.S = stdout;
2473 PrintSz(szPrompt);
2474 AnsiColor(kYellowA);
2475 PrintSz(" > ");
2476 AnsiColor(kDefault);
2477 if (fgets(sz, cchSzMax, stdin) == NULL) // Pressing Control+d terminates
2478 Terminate(tcForce); // the program on some systems.
2479 cch = CchSz(sz);
2480 while (cch > 0 && sz[cch-1] < ' ')
2481 cch--;
2482 sz[cch] = chNull;
2483 is.S = file;
2484 is.cchCol = 0;
2485}
2486
2487
2488// Prompt the user for a floating point value, parsing as appropriate, and

Callers 6

NPromptSwitchesFunction · 0.85
NInputRangeFunction · 0.85
RInputRangeFunction · 0.85
FInputDataFunction · 0.85
PrintSzFunction · 0.85
BeginFileXFunction · 0.85

Calls 4

PrintSzFunction · 0.85
AnsiColorFunction · 0.85
TerminateFunction · 0.85
CchSzFunction · 0.85

Tested by

no test coverage detected