diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-04 06:59:22 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-04 06:59:22 -0700 |
commit | 534d081c2c09956870be3a0334792c72da5feac9 (patch) | |
tree | 99ccd3f7f148465f8f90ac995ba0fa90a78f1218 /linenoise/linenoise.c | |
parent | 1e39fffe8e7c307bdaacf575e7b9eab81e6f2ce9 (diff) | |
download | txr-534d081c2c09956870be3a0334792c72da5feac9.tar.gz txr-534d081c2c09956870be3a0334792c72da5feac9.tar.bz2 txr-534d081c2c09956870be3a0334792c72da5feac9.zip |
Compile and link linkenoise into txr; fix errors.
* Makefile (OBJS): Add linenoise/linenoise.o.
* linenoise/linenoise.c (linenoiseEditInsert,
linenoiseEditMoveLeft, linenoiseEditMoveRight,
linenoiseEditMoveEnd, linenoiseEditHistoryNext,
linenoiseEditDelete, linenoiseEditBackspace,
linenoiseEditDeletePrevWord): These de facto internal
functions are switched from external to static.
Diffstat (limited to 'linenoise/linenoise.c')
-rw-r--r-- | linenoise/linenoise.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c index c10557d0..c54e4c83 100644 --- a/linenoise/linenoise.c +++ b/linenoise/linenoise.c @@ -593,7 +593,7 @@ static void refreshLine(struct linenoiseState *l) { /* Insert the character 'c' at cursor current position. * * On error writing to the terminal -1 is returned, otherwise 0. */ -int linenoiseEditInsert(struct linenoiseState *l, char c) { +static int linenoiseEditInsert(struct linenoiseState *l, char c) { if (l->len < l->buflen) { if (l->len == l->pos) { l->buf[l->pos] = c; @@ -620,7 +620,7 @@ int linenoiseEditInsert(struct linenoiseState *l, char c) { } /* Move cursor on the left. */ -void linenoiseEditMoveLeft(struct linenoiseState *l) { +static void linenoiseEditMoveLeft(struct linenoiseState *l) { if (l->pos > 0) { l->pos--; refreshLine(l); @@ -628,7 +628,7 @@ void linenoiseEditMoveLeft(struct linenoiseState *l) { } /* Move cursor on the right. */ -void linenoiseEditMoveRight(struct linenoiseState *l) { +static void linenoiseEditMoveRight(struct linenoiseState *l) { if (l->pos != l->len) { l->pos++; refreshLine(l); @@ -636,7 +636,7 @@ void linenoiseEditMoveRight(struct linenoiseState *l) { } /* Move cursor to the start of the line. */ -void linenoiseEditMoveHome(struct linenoiseState *l) { +static void linenoiseEditMoveHome(struct linenoiseState *l) { if (l->pos != 0) { l->pos = 0; refreshLine(l); @@ -644,7 +644,7 @@ void linenoiseEditMoveHome(struct linenoiseState *l) { } /* Move cursor to the end of the line. */ -void linenoiseEditMoveEnd(struct linenoiseState *l) { +static void linenoiseEditMoveEnd(struct linenoiseState *l) { if (l->pos != l->len) { l->pos = l->len; refreshLine(l); @@ -655,7 +655,7 @@ void linenoiseEditMoveEnd(struct linenoiseState *l) { * entry as specified by 'dir'. */ #define LINENOISE_HISTORY_NEXT 0 #define LINENOISE_HISTORY_PREV 1 -void linenoiseEditHistoryNext(struct linenoiseState *l, int dir) { +static void linenoiseEditHistoryNext(struct linenoiseState *l, int dir) { if (history_len > 1) { /* Update the current history entry before to * overwrite it with the next one. */ @@ -679,7 +679,7 @@ void linenoiseEditHistoryNext(struct linenoiseState *l, int dir) { /* Delete the character at the right of the cursor without altering the cursor * position. Basically this is what happens with the "Delete" keyboard key. */ -void linenoiseEditDelete(struct linenoiseState *l) { +static void linenoiseEditDelete(struct linenoiseState *l) { if (l->len > 0 && l->pos < l->len) { memmove(l->buf+l->pos,l->buf+l->pos+1,l->len-l->pos-1); l->len--; @@ -689,7 +689,7 @@ void linenoiseEditDelete(struct linenoiseState *l) { } /* Backspace implementation. */ -void linenoiseEditBackspace(struct linenoiseState *l) { +static void linenoiseEditBackspace(struct linenoiseState *l) { if (l->pos > 0 && l->len > 0) { memmove(l->buf+l->pos-1,l->buf+l->pos,l->len-l->pos); l->pos--; @@ -701,7 +701,7 @@ void linenoiseEditBackspace(struct linenoiseState *l) { /* Delete the previosu word, maintaining the cursor at the start of the * current word. */ -void linenoiseEditDeletePrevWord(struct linenoiseState *l) { +static void linenoiseEditDeletePrevWord(struct linenoiseState *l) { size_t old_pos = l->pos; size_t diff; |