Fossil SCM
Update the built-in linenoise code to the latest from the canonical website: [https://github.com/antirez/linenoise].
Commit
a424972e96d229a0cfd2d693fe1479f8412de69ccb725f083c19f293312afa6c
Parent
76c81e0359addbc…
2 files changed
+37
-11
+2
+37
-11
| --- src/linenoise.c | ||
| +++ src/linenoise.c | ||
| @@ -123,10 +123,11 @@ | ||
| 123 | 123 | static linenoiseCompletionCallback *completionCallback = NULL; |
| 124 | 124 | static linenoiseHintsCallback *hintsCallback = NULL; |
| 125 | 125 | static linenoiseFreeHintsCallback *freeHintsCallback = NULL; |
| 126 | 126 | |
| 127 | 127 | static struct termios orig_termios; /* In order to restore at exit.*/ |
| 128 | +static int maskmode = 0; /* Show "***" instead of input. For passwords. */ | |
| 128 | 129 | static int rawmode = 0; /* For atexit() function to check if restore is needed*/ |
| 129 | 130 | static int mlmode = 0; /* Multi line mode. Default is single line. */ |
| 130 | 131 | static int atexit_registered = 0; /* Register atexit just 1 time. */ |
| 131 | 132 | static int history_max_len = LINENOISE_DEFAULT_HISTORY_MAX_LEN; |
| 132 | 133 | static int history_len = 0; |
| @@ -194,10 +195,23 @@ | ||
| 194 | 195 | #else |
| 195 | 196 | #define lndebug(fmt, ...) |
| 196 | 197 | #endif |
| 197 | 198 | |
| 198 | 199 | /* ======================= Low level terminal handling ====================== */ |
| 200 | + | |
| 201 | +/* Enable "mask mode". When it is enabled, instead of the input that | |
| 202 | + * the user is typing, the terminal will just display a corresponding | |
| 203 | + * number of asterisks, like "****". This is useful for passwords and other | |
| 204 | + * secrets that should not be displayed. */ | |
| 205 | +void linenoiseMaskModeEnable(void) { | |
| 206 | + maskmode = 1; | |
| 207 | +} | |
| 208 | + | |
| 209 | +/* Disable mask mode. */ | |
| 210 | +void linenoiseMaskModeDisable(void) { | |
| 211 | + maskmode = 0; | |
| 212 | +} | |
| 199 | 213 | |
| 200 | 214 | /* Set if to use or not the multi line mode. */ |
| 201 | 215 | void linenoiseSetMultiLine(int ml) { |
| 202 | 216 | mlmode = ml; |
| 203 | 217 | } |
| @@ -483,10 +497,12 @@ | ||
| 483 | 497 | int hintmaxlen = l->cols-(plen+l->len); |
| 484 | 498 | if (hintlen > hintmaxlen) hintlen = hintmaxlen; |
| 485 | 499 | if (bold == 1 && color == -1) color = 37; |
| 486 | 500 | if (color != -1 || bold != 0) |
| 487 | 501 | snprintf(seq,64,"\033[%d;%d;49m",bold,color); |
| 502 | + else | |
| 503 | + seq[0] = '\0'; | |
| 488 | 504 | abAppend(ab,seq,strlen(seq)); |
| 489 | 505 | abAppend(ab,hint,hintlen); |
| 490 | 506 | if (color != -1 || bold != 0) |
| 491 | 507 | abAppend(ab,"\033[0m",4); |
| 492 | 508 | /* Call the function to free the hint returned. */ |
| @@ -521,11 +537,15 @@ | ||
| 521 | 537 | /* Cursor to left edge */ |
| 522 | 538 | snprintf(seq,64,"\r"); |
| 523 | 539 | abAppend(&ab,seq,strlen(seq)); |
| 524 | 540 | /* Write the prompt and the current buffer content */ |
| 525 | 541 | abAppend(&ab,l->prompt,strlen(l->prompt)); |
| 526 | - abAppend(&ab,buf,len); | |
| 542 | + if (maskmode == 1) { | |
| 543 | + while (len--) abAppend(&ab,"*",1); | |
| 544 | + } else { | |
| 545 | + abAppend(&ab,buf,len); | |
| 546 | + } | |
| 527 | 547 | /* Show hits if any. */ |
| 528 | 548 | refreshShowHints(&ab,l,plen); |
| 529 | 549 | /* Erase to right */ |
| 530 | 550 | snprintf(seq,64,"\x1b[0K"); |
| 531 | 551 | abAppend(&ab,seq,strlen(seq)); |
| @@ -556,30 +576,35 @@ | ||
| 556 | 576 | |
| 557 | 577 | /* First step: clear all the lines used before. To do so start by |
| 558 | 578 | * going to the last row. */ |
| 559 | 579 | abInit(&ab); |
| 560 | 580 | if (old_rows-rpos > 0) { |
| 561 | - /* lndebug("go down %d", old_rows-rpos); */ | |
| 581 | + lndebug("go down %d", old_rows-rpos); | |
| 562 | 582 | snprintf(seq,64,"\x1b[%dB", old_rows-rpos); |
| 563 | 583 | abAppend(&ab,seq,strlen(seq)); |
| 564 | 584 | } |
| 565 | 585 | |
| 566 | 586 | /* Now for every row clear it, go up. */ |
| 567 | 587 | for (j = 0; j < old_rows-1; j++) { |
| 568 | - /* lndebug("clear+up"); */ | |
| 588 | + lndebug("clear+up"); | |
| 569 | 589 | snprintf(seq,64,"\r\x1b[0K\x1b[1A"); |
| 570 | 590 | abAppend(&ab,seq,strlen(seq)); |
| 571 | 591 | } |
| 572 | 592 | |
| 573 | 593 | /* Clean the top line. */ |
| 574 | - /* lndebug("clear"); */ | |
| 594 | + lndebug("clear"); | |
| 575 | 595 | snprintf(seq,64,"\r\x1b[0K"); |
| 576 | 596 | abAppend(&ab,seq,strlen(seq)); |
| 577 | 597 | |
| 578 | 598 | /* Write the prompt and the current buffer content */ |
| 579 | 599 | abAppend(&ab,l->prompt,strlen(l->prompt)); |
| 580 | - abAppend(&ab,l->buf,l->len); | |
| 600 | + if (maskmode == 1) { | |
| 601 | + unsigned int i; | |
| 602 | + for (i = 0; i < l->len; i++) abAppend(&ab,"*",1); | |
| 603 | + } else { | |
| 604 | + abAppend(&ab,l->buf,l->len); | |
| 605 | + } | |
| 581 | 606 | |
| 582 | 607 | /* Show hits if any. */ |
| 583 | 608 | refreshShowHints(&ab,l,plen); |
| 584 | 609 | |
| 585 | 610 | /* If we are at the very end of the screen with our prompt, we need to |
| @@ -586,39 +611,39 @@ | ||
| 586 | 611 | * emit a newline and move the prompt to the first column. */ |
| 587 | 612 | if (l->pos && |
| 588 | 613 | l->pos == l->len && |
| 589 | 614 | (l->pos+plen) % l->cols == 0) |
| 590 | 615 | { |
| 591 | - /* lndebug("<newline>"); */ | |
| 616 | + lndebug("<newline>"); | |
| 592 | 617 | abAppend(&ab,"\n",1); |
| 593 | 618 | snprintf(seq,64,"\r"); |
| 594 | 619 | abAppend(&ab,seq,strlen(seq)); |
| 595 | 620 | rows++; |
| 596 | 621 | if (rows > (int)l->maxrows) l->maxrows = rows; |
| 597 | 622 | } |
| 598 | 623 | |
| 599 | 624 | /* Move cursor to right position. */ |
| 600 | 625 | rpos2 = (plen+l->pos+l->cols)/l->cols; /* current cursor relative row. */ |
| 601 | - /* lndebug("rpos2 %d", rpos2); */ | |
| 626 | + lndebug("rpos2 %d", rpos2); | |
| 602 | 627 | |
| 603 | 628 | /* Go up till we reach the expected positon. */ |
| 604 | 629 | if (rows-rpos2 > 0) { |
| 605 | - /* lndebug("go-up %d", rows-rpos2); */ | |
| 630 | + lndebug("go-up %d", rows-rpos2); | |
| 606 | 631 | snprintf(seq,64,"\x1b[%dA", rows-rpos2); |
| 607 | 632 | abAppend(&ab,seq,strlen(seq)); |
| 608 | 633 | } |
| 609 | 634 | |
| 610 | 635 | /* Set column. */ |
| 611 | 636 | col = (plen+(int)l->pos) % (int)l->cols; |
| 612 | - /* lndebug("set col %d", 1+col); */ | |
| 637 | + lndebug("set col %d", 1+col); | |
| 613 | 638 | if (col) |
| 614 | 639 | snprintf(seq,64,"\r\x1b[%dC", col); |
| 615 | 640 | else |
| 616 | 641 | snprintf(seq,64,"\r"); |
| 617 | 642 | abAppend(&ab,seq,strlen(seq)); |
| 618 | 643 | |
| 619 | - /* lndebug("\n"); */ | |
| 644 | + lndebug("\n"); | |
| 620 | 645 | l->oldpos = l->pos; |
| 621 | 646 | |
| 622 | 647 | if (write(fd,ab.b,ab.len) == -1) {} /* Can't recover from write error. */ |
| 623 | 648 | abFree(&ab); |
| 624 | 649 | } |
| @@ -643,11 +668,12 @@ | ||
| 643 | 668 | l->len++; |
| 644 | 669 | l->buf[l->len] = '\0'; |
| 645 | 670 | if ((!mlmode && l->plen+l->len < l->cols && !hintsCallback)) { |
| 646 | 671 | /* Avoid a full update of the line in the |
| 647 | 672 | * trivial case. */ |
| 648 | - if (write(l->ofd,&c,1) == -1) return -1; | |
| 673 | + char d = (maskmode==1) ? '*' : c; | |
| 674 | + if (write(l->ofd,&d,1) == -1) return -1; | |
| 649 | 675 | } else { |
| 650 | 676 | refreshLine(l); |
| 651 | 677 | } |
| 652 | 678 | } else { |
| 653 | 679 | memmove(l->buf+l->pos+1,l->buf+l->pos,l->len-l->pos); |
| 654 | 680 |
| --- src/linenoise.c | |
| +++ src/linenoise.c | |
| @@ -123,10 +123,11 @@ | |
| 123 | static linenoiseCompletionCallback *completionCallback = NULL; |
| 124 | static linenoiseHintsCallback *hintsCallback = NULL; |
| 125 | static linenoiseFreeHintsCallback *freeHintsCallback = NULL; |
| 126 | |
| 127 | static struct termios orig_termios; /* In order to restore at exit.*/ |
| 128 | static int rawmode = 0; /* For atexit() function to check if restore is needed*/ |
| 129 | static int mlmode = 0; /* Multi line mode. Default is single line. */ |
| 130 | static int atexit_registered = 0; /* Register atexit just 1 time. */ |
| 131 | static int history_max_len = LINENOISE_DEFAULT_HISTORY_MAX_LEN; |
| 132 | static int history_len = 0; |
| @@ -194,10 +195,23 @@ | |
| 194 | #else |
| 195 | #define lndebug(fmt, ...) |
| 196 | #endif |
| 197 | |
| 198 | /* ======================= Low level terminal handling ====================== */ |
| 199 | |
| 200 | /* Set if to use or not the multi line mode. */ |
| 201 | void linenoiseSetMultiLine(int ml) { |
| 202 | mlmode = ml; |
| 203 | } |
| @@ -483,10 +497,12 @@ | |
| 483 | int hintmaxlen = l->cols-(plen+l->len); |
| 484 | if (hintlen > hintmaxlen) hintlen = hintmaxlen; |
| 485 | if (bold == 1 && color == -1) color = 37; |
| 486 | if (color != -1 || bold != 0) |
| 487 | snprintf(seq,64,"\033[%d;%d;49m",bold,color); |
| 488 | abAppend(ab,seq,strlen(seq)); |
| 489 | abAppend(ab,hint,hintlen); |
| 490 | if (color != -1 || bold != 0) |
| 491 | abAppend(ab,"\033[0m",4); |
| 492 | /* Call the function to free the hint returned. */ |
| @@ -521,11 +537,15 @@ | |
| 521 | /* Cursor to left edge */ |
| 522 | snprintf(seq,64,"\r"); |
| 523 | abAppend(&ab,seq,strlen(seq)); |
| 524 | /* Write the prompt and the current buffer content */ |
| 525 | abAppend(&ab,l->prompt,strlen(l->prompt)); |
| 526 | abAppend(&ab,buf,len); |
| 527 | /* Show hits if any. */ |
| 528 | refreshShowHints(&ab,l,plen); |
| 529 | /* Erase to right */ |
| 530 | snprintf(seq,64,"\x1b[0K"); |
| 531 | abAppend(&ab,seq,strlen(seq)); |
| @@ -556,30 +576,35 @@ | |
| 556 | |
| 557 | /* First step: clear all the lines used before. To do so start by |
| 558 | * going to the last row. */ |
| 559 | abInit(&ab); |
| 560 | if (old_rows-rpos > 0) { |
| 561 | /* lndebug("go down %d", old_rows-rpos); */ |
| 562 | snprintf(seq,64,"\x1b[%dB", old_rows-rpos); |
| 563 | abAppend(&ab,seq,strlen(seq)); |
| 564 | } |
| 565 | |
| 566 | /* Now for every row clear it, go up. */ |
| 567 | for (j = 0; j < old_rows-1; j++) { |
| 568 | /* lndebug("clear+up"); */ |
| 569 | snprintf(seq,64,"\r\x1b[0K\x1b[1A"); |
| 570 | abAppend(&ab,seq,strlen(seq)); |
| 571 | } |
| 572 | |
| 573 | /* Clean the top line. */ |
| 574 | /* lndebug("clear"); */ |
| 575 | snprintf(seq,64,"\r\x1b[0K"); |
| 576 | abAppend(&ab,seq,strlen(seq)); |
| 577 | |
| 578 | /* Write the prompt and the current buffer content */ |
| 579 | abAppend(&ab,l->prompt,strlen(l->prompt)); |
| 580 | abAppend(&ab,l->buf,l->len); |
| 581 | |
| 582 | /* Show hits if any. */ |
| 583 | refreshShowHints(&ab,l,plen); |
| 584 | |
| 585 | /* If we are at the very end of the screen with our prompt, we need to |
| @@ -586,39 +611,39 @@ | |
| 586 | * emit a newline and move the prompt to the first column. */ |
| 587 | if (l->pos && |
| 588 | l->pos == l->len && |
| 589 | (l->pos+plen) % l->cols == 0) |
| 590 | { |
| 591 | /* lndebug("<newline>"); */ |
| 592 | abAppend(&ab,"\n",1); |
| 593 | snprintf(seq,64,"\r"); |
| 594 | abAppend(&ab,seq,strlen(seq)); |
| 595 | rows++; |
| 596 | if (rows > (int)l->maxrows) l->maxrows = rows; |
| 597 | } |
| 598 | |
| 599 | /* Move cursor to right position. */ |
| 600 | rpos2 = (plen+l->pos+l->cols)/l->cols; /* current cursor relative row. */ |
| 601 | /* lndebug("rpos2 %d", rpos2); */ |
| 602 | |
| 603 | /* Go up till we reach the expected positon. */ |
| 604 | if (rows-rpos2 > 0) { |
| 605 | /* lndebug("go-up %d", rows-rpos2); */ |
| 606 | snprintf(seq,64,"\x1b[%dA", rows-rpos2); |
| 607 | abAppend(&ab,seq,strlen(seq)); |
| 608 | } |
| 609 | |
| 610 | /* Set column. */ |
| 611 | col = (plen+(int)l->pos) % (int)l->cols; |
| 612 | /* lndebug("set col %d", 1+col); */ |
| 613 | if (col) |
| 614 | snprintf(seq,64,"\r\x1b[%dC", col); |
| 615 | else |
| 616 | snprintf(seq,64,"\r"); |
| 617 | abAppend(&ab,seq,strlen(seq)); |
| 618 | |
| 619 | /* lndebug("\n"); */ |
| 620 | l->oldpos = l->pos; |
| 621 | |
| 622 | if (write(fd,ab.b,ab.len) == -1) {} /* Can't recover from write error. */ |
| 623 | abFree(&ab); |
| 624 | } |
| @@ -643,11 +668,12 @@ | |
| 643 | l->len++; |
| 644 | l->buf[l->len] = '\0'; |
| 645 | if ((!mlmode && l->plen+l->len < l->cols && !hintsCallback)) { |
| 646 | /* Avoid a full update of the line in the |
| 647 | * trivial case. */ |
| 648 | if (write(l->ofd,&c,1) == -1) return -1; |
| 649 | } else { |
| 650 | refreshLine(l); |
| 651 | } |
| 652 | } else { |
| 653 | memmove(l->buf+l->pos+1,l->buf+l->pos,l->len-l->pos); |
| 654 |
| --- src/linenoise.c | |
| +++ src/linenoise.c | |
| @@ -123,10 +123,11 @@ | |
| 123 | static linenoiseCompletionCallback *completionCallback = NULL; |
| 124 | static linenoiseHintsCallback *hintsCallback = NULL; |
| 125 | static linenoiseFreeHintsCallback *freeHintsCallback = NULL; |
| 126 | |
| 127 | static struct termios orig_termios; /* In order to restore at exit.*/ |
| 128 | static int maskmode = 0; /* Show "***" instead of input. For passwords. */ |
| 129 | static int rawmode = 0; /* For atexit() function to check if restore is needed*/ |
| 130 | static int mlmode = 0; /* Multi line mode. Default is single line. */ |
| 131 | static int atexit_registered = 0; /* Register atexit just 1 time. */ |
| 132 | static int history_max_len = LINENOISE_DEFAULT_HISTORY_MAX_LEN; |
| 133 | static int history_len = 0; |
| @@ -194,10 +195,23 @@ | |
| 195 | #else |
| 196 | #define lndebug(fmt, ...) |
| 197 | #endif |
| 198 | |
| 199 | /* ======================= Low level terminal handling ====================== */ |
| 200 | |
| 201 | /* Enable "mask mode". When it is enabled, instead of the input that |
| 202 | * the user is typing, the terminal will just display a corresponding |
| 203 | * number of asterisks, like "****". This is useful for passwords and other |
| 204 | * secrets that should not be displayed. */ |
| 205 | void linenoiseMaskModeEnable(void) { |
| 206 | maskmode = 1; |
| 207 | } |
| 208 | |
| 209 | /* Disable mask mode. */ |
| 210 | void linenoiseMaskModeDisable(void) { |
| 211 | maskmode = 0; |
| 212 | } |
| 213 | |
| 214 | /* Set if to use or not the multi line mode. */ |
| 215 | void linenoiseSetMultiLine(int ml) { |
| 216 | mlmode = ml; |
| 217 | } |
| @@ -483,10 +497,12 @@ | |
| 497 | int hintmaxlen = l->cols-(plen+l->len); |
| 498 | if (hintlen > hintmaxlen) hintlen = hintmaxlen; |
| 499 | if (bold == 1 && color == -1) color = 37; |
| 500 | if (color != -1 || bold != 0) |
| 501 | snprintf(seq,64,"\033[%d;%d;49m",bold,color); |
| 502 | else |
| 503 | seq[0] = '\0'; |
| 504 | abAppend(ab,seq,strlen(seq)); |
| 505 | abAppend(ab,hint,hintlen); |
| 506 | if (color != -1 || bold != 0) |
| 507 | abAppend(ab,"\033[0m",4); |
| 508 | /* Call the function to free the hint returned. */ |
| @@ -521,11 +537,15 @@ | |
| 537 | /* Cursor to left edge */ |
| 538 | snprintf(seq,64,"\r"); |
| 539 | abAppend(&ab,seq,strlen(seq)); |
| 540 | /* Write the prompt and the current buffer content */ |
| 541 | abAppend(&ab,l->prompt,strlen(l->prompt)); |
| 542 | if (maskmode == 1) { |
| 543 | while (len--) abAppend(&ab,"*",1); |
| 544 | } else { |
| 545 | abAppend(&ab,buf,len); |
| 546 | } |
| 547 | /* Show hits if any. */ |
| 548 | refreshShowHints(&ab,l,plen); |
| 549 | /* Erase to right */ |
| 550 | snprintf(seq,64,"\x1b[0K"); |
| 551 | abAppend(&ab,seq,strlen(seq)); |
| @@ -556,30 +576,35 @@ | |
| 576 | |
| 577 | /* First step: clear all the lines used before. To do so start by |
| 578 | * going to the last row. */ |
| 579 | abInit(&ab); |
| 580 | if (old_rows-rpos > 0) { |
| 581 | lndebug("go down %d", old_rows-rpos); |
| 582 | snprintf(seq,64,"\x1b[%dB", old_rows-rpos); |
| 583 | abAppend(&ab,seq,strlen(seq)); |
| 584 | } |
| 585 | |
| 586 | /* Now for every row clear it, go up. */ |
| 587 | for (j = 0; j < old_rows-1; j++) { |
| 588 | lndebug("clear+up"); |
| 589 | snprintf(seq,64,"\r\x1b[0K\x1b[1A"); |
| 590 | abAppend(&ab,seq,strlen(seq)); |
| 591 | } |
| 592 | |
| 593 | /* Clean the top line. */ |
| 594 | lndebug("clear"); |
| 595 | snprintf(seq,64,"\r\x1b[0K"); |
| 596 | abAppend(&ab,seq,strlen(seq)); |
| 597 | |
| 598 | /* Write the prompt and the current buffer content */ |
| 599 | abAppend(&ab,l->prompt,strlen(l->prompt)); |
| 600 | if (maskmode == 1) { |
| 601 | unsigned int i; |
| 602 | for (i = 0; i < l->len; i++) abAppend(&ab,"*",1); |
| 603 | } else { |
| 604 | abAppend(&ab,l->buf,l->len); |
| 605 | } |
| 606 | |
| 607 | /* Show hits if any. */ |
| 608 | refreshShowHints(&ab,l,plen); |
| 609 | |
| 610 | /* If we are at the very end of the screen with our prompt, we need to |
| @@ -586,39 +611,39 @@ | |
| 611 | * emit a newline and move the prompt to the first column. */ |
| 612 | if (l->pos && |
| 613 | l->pos == l->len && |
| 614 | (l->pos+plen) % l->cols == 0) |
| 615 | { |
| 616 | lndebug("<newline>"); |
| 617 | abAppend(&ab,"\n",1); |
| 618 | snprintf(seq,64,"\r"); |
| 619 | abAppend(&ab,seq,strlen(seq)); |
| 620 | rows++; |
| 621 | if (rows > (int)l->maxrows) l->maxrows = rows; |
| 622 | } |
| 623 | |
| 624 | /* Move cursor to right position. */ |
| 625 | rpos2 = (plen+l->pos+l->cols)/l->cols; /* current cursor relative row. */ |
| 626 | lndebug("rpos2 %d", rpos2); |
| 627 | |
| 628 | /* Go up till we reach the expected positon. */ |
| 629 | if (rows-rpos2 > 0) { |
| 630 | lndebug("go-up %d", rows-rpos2); |
| 631 | snprintf(seq,64,"\x1b[%dA", rows-rpos2); |
| 632 | abAppend(&ab,seq,strlen(seq)); |
| 633 | } |
| 634 | |
| 635 | /* Set column. */ |
| 636 | col = (plen+(int)l->pos) % (int)l->cols; |
| 637 | lndebug("set col %d", 1+col); |
| 638 | if (col) |
| 639 | snprintf(seq,64,"\r\x1b[%dC", col); |
| 640 | else |
| 641 | snprintf(seq,64,"\r"); |
| 642 | abAppend(&ab,seq,strlen(seq)); |
| 643 | |
| 644 | lndebug("\n"); |
| 645 | l->oldpos = l->pos; |
| 646 | |
| 647 | if (write(fd,ab.b,ab.len) == -1) {} /* Can't recover from write error. */ |
| 648 | abFree(&ab); |
| 649 | } |
| @@ -643,11 +668,12 @@ | |
| 668 | l->len++; |
| 669 | l->buf[l->len] = '\0'; |
| 670 | if ((!mlmode && l->plen+l->len < l->cols && !hintsCallback)) { |
| 671 | /* Avoid a full update of the line in the |
| 672 | * trivial case. */ |
| 673 | char d = (maskmode==1) ? '*' : c; |
| 674 | if (write(l->ofd,&d,1) == -1) return -1; |
| 675 | } else { |
| 676 | refreshLine(l); |
| 677 | } |
| 678 | } else { |
| 679 | memmove(l->buf+l->pos+1,l->buf+l->pos,l->len-l->pos); |
| 680 |
+2
| --- src/linenoise.h | ||
| +++ src/linenoise.h | ||
| @@ -63,10 +63,12 @@ | ||
| 63 | 63 | int linenoiseHistorySave(const char *filename); |
| 64 | 64 | int linenoiseHistoryLoad(const char *filename); |
| 65 | 65 | void linenoiseClearScreen(void); |
| 66 | 66 | void linenoiseSetMultiLine(int ml); |
| 67 | 67 | void linenoisePrintKeyCodes(void); |
| 68 | +void linenoiseMaskModeEnable(void); | |
| 69 | +void linenoiseMaskModeDisable(void); | |
| 68 | 70 | |
| 69 | 71 | #ifdef __cplusplus |
| 70 | 72 | } |
| 71 | 73 | #endif |
| 72 | 74 | |
| 73 | 75 |
| --- src/linenoise.h | |
| +++ src/linenoise.h | |
| @@ -63,10 +63,12 @@ | |
| 63 | int linenoiseHistorySave(const char *filename); |
| 64 | int linenoiseHistoryLoad(const char *filename); |
| 65 | void linenoiseClearScreen(void); |
| 66 | void linenoiseSetMultiLine(int ml); |
| 67 | void linenoisePrintKeyCodes(void); |
| 68 | |
| 69 | #ifdef __cplusplus |
| 70 | } |
| 71 | #endif |
| 72 | |
| 73 |
| --- src/linenoise.h | |
| +++ src/linenoise.h | |
| @@ -63,10 +63,12 @@ | |
| 63 | int linenoiseHistorySave(const char *filename); |
| 64 | int linenoiseHistoryLoad(const char *filename); |
| 65 | void linenoiseClearScreen(void); |
| 66 | void linenoiseSetMultiLine(int ml); |
| 67 | void linenoisePrintKeyCodes(void); |
| 68 | void linenoiseMaskModeEnable(void); |
| 69 | void linenoiseMaskModeDisable(void); |
| 70 | |
| 71 | #ifdef __cplusplus |
| 72 | } |
| 73 | #endif |
| 74 | |
| 75 |