MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / linenoiseRaw

Function linenoiseRaw

tools/shell/linenoise.cpp:3812–3828  ·  view source on GitHub ↗

This function calls the line editing function linenoiseEdit() using * the STDIN file descriptor set in raw mode. */

Source from the content-addressed store, hash-verified

3810/* This function calls the line editing function linenoiseEdit() using
3811 * the STDIN file descriptor set in raw mode. */
3812static int linenoiseRaw(char* buf, size_t buflen, const char* prompt, const char* continuePrompt,
3813 const char* selectedContinuePrompt) {
3814 int count;
3815
3816 if (buflen == 0) {
3817 errno = EINVAL;
3818 return -1;
3819 }
3820
3821 if (enableRawMode(STDIN_FILENO) == -1)
3822 return -1;
3823 count = linenoiseEdit(STDIN_FILENO, STDOUT_FILENO, buf, buflen, prompt, continuePrompt,
3824 selectedContinuePrompt);
3825 disableRawMode(STDIN_FILENO);
3826 printf("\n");
3827 return count;
3828}
3829
3830/* This function is called when linenoise() is called with the standard
3831 * input file descriptor not attached to a TTY. So for example when the

Callers 1

linenoiseFunction · 0.85

Calls 3

enableRawModeFunction · 0.85
linenoiseEditFunction · 0.85
disableRawModeFunction · 0.85

Tested by

no test coverage detected