uint transid; /* tracks the last used transaction id for log entries */
void (*errfn)(char*); /* callback for error messages */
size_t nlines; /* tracks number of lines in the buffer */
- size_t outpoint; /* tracks the point separating output from input for command buffers */
} Buf;
/* cursor/selection representation */
int exec_cmd(char** cmd);
int exec_spawn(char** cmd, int* in, int* out);
-/* Pseudo-Terminal Handling
- *****************************************************************************/
-bool pty_active(void);
-void pty_spawn(char** argv);
-void pty_send(char* cmd, char* arg);
-void pty_send_rune(Rune rune);
-void pty_send_intr(void);
-void pty_send_eof(void);
-void pty_send_susp(void);
-
/* Configuration Data
*****************************************************************************/
enum { /* Configuration Variables */
buf->redo = NULL;
buf->errfn = errfn;
buf->nlines = 0;
- buf->outpoint = 0;
assert(buf->bufstart);
}
static void delete(Buf* buf, size_t off) {
Rune rune = buf_get(buf, off);
- if (off < buf->outpoint) buf->outpoint--;
if (rune == RUNE_CRLF || rune == '\n')
buf->nlines--;
syncgap(buf, off);
static size_t insert(Buf* buf, size_t off, Rune rune) {
size_t rcount = 1;
syncgap(buf, off);
- if (off < buf->outpoint) buf->outpoint++;
if (rune == '\n' || rune == RUNE_CRLF) buf->nlines++;
if (buf->crlf && rune == '\n' && buf_get(buf, off-1) == '\r') {
rcount = 0;