diff options
| author | Toby Goodwin <toby@paccrat.org> | 2015-05-15 19:36:55 +0100 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:24 +0100 |
| commit | 27c900d6ae9cd0dcf4bc97bc9b8c1882e40ccfa8 (patch) | |
| tree | 9ce71c54d395ebc0e84ecded69a75d2ed0ce831c /edit-null.c | |
| parent | 3202133256713848312dddefba2250a6803bfec6 (diff) | |
snapshot from cvs: 2005-03-03
Diffstat (limited to 'edit-null.c')
| -rw-r--r-- | edit-null.c | 59 |
1 files changed, 11 insertions, 48 deletions
diff --git a/edit-null.c b/edit-null.c index ea6c5db..de2379e 100644 --- a/edit-null.c +++ b/edit-null.c @@ -8,65 +8,28 @@ bool editing = 0; -void *edit_init(int fd) { - /* this function deliberately left blank */ +void *edit_begin(int fd) { + assert(0); /* should never be called */ return NULL; } char *edit_alloc(void *cookie, int *count) { - char *buf; - int size, used; - ssize_t r; - - used = 0; - size = 1; - buf = ealloc(size + 1); /* leave room for terminating \0 */ - do { - if (used >= size) { /* >= leaves room for terminating \0 */ - size = size * 2; - buf = erealloc(buf, size); - } - do { - r = rc_read(0, buf + used, size - used); - sigchk(); - if (r == -1) - switch (errno) { - case EAGAIN: - if (!makeblocking(0)) - panic("not O_NONBLOCK"); - errno = EINTR; - break; - case EIO: - if (makesamepgrp(0)) - errno = EINTR; - else - errno = EIO; - break; - } - } while (r < 0 && errno == EINTR); - - if (r == 0) - return NULL; - - used += r; - buf[used] = '\0'; - } while (strchr(buf, '\n') == NULL); - - *count = used; - if (used) - return buf; - else - return NULL; + assert(0); /* should never be called */ + return NULL; } void edit_prompt(void *cookie, char *prompt) { - fprint(2, "%s", prompt); + assert(0); /* should never be called */ } void edit_free(void *buffer) { - efree(buffer); + assert(0); /* should never be called */ } void edit_end(void *cookie) { - /* this function deliberately left blank */ + assert(0); /* should never be called */ +} + +void edit_reset(void *cookie) { + assert(0); /* should never be called */ } |