teco

Check-in [36bb4d9a18]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Sync w. last git source
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:36bb4d9a18619bf001d1f7b9296251e875e10fcfd0b295682fb1755a2becc78a
User & Date: vandys 2019-02-23 15:13:01
Context
2019-02-23
15:21
Make use of termcap optional (for embedded targets). It's only used for terminal sizing; everything else is hard-coded for ANSI. Leaf check-in: f3f5d918bc user: vandys tags: master, trunk
15:13
Sync w. last git source check-in: 36bb4d9a18 user: vandys tags: master, trunk
2014-01-16
00:36
Ignore ctags check-in: 6c36f04c05 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to chario.c.

112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
...
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
...
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
        /* disable the interrupt char in this one */
        tc_noint = tty_new;
        tc_noint.c_cc[VINTR] = -1;
    }

    if ((arg == TTY_ON) || (arg == TTY_RESUME)) {
        /* Set up TTY for TECO */
        tcsetattr(fileno(stdin), TCSAFLUSH, &tty_new);
#ifndef DEBUG
        /* Handle signals */
#ifdef SIGTSTP
        sig(SIGTSTP, stp_handler);
#endif
        sig(SIGINT, int_handler);
        sig(SIGHUP, hup_handler);
#endif /* DEBUG */
    } else {
        /* Restore to original state */
        tcsetattr(fileno(stdin), TCSAFLUSH, &tty_orig);
#ifndef DEBUG
#ifdef SIGTSTP
        sig(SIGTSTP, SIG_DFL);
#endif
        sig(SIGINT, SIG_DFL);
        sig(SIGHUP, SIG_DFL);
#endif
................................................................................
    /* Clear EOF if set */
    if (feof(stdin)) {
        clearerr(stdin);
    }

    /* set to "no delay" mode */
    tty_new.c_cc[VMIN] = 0;
    tcsetattr(fileno(stdin), TCSAFLUSH, &tty_new);

    /* read character, or -1, skip nulls */
    do {
        cnt = read(fileno(stdin), &c, sizeof(c));
    } while ((cnt > 0) && (c == '\0'));
    err = errno;

    /* reset to normal mode */
    tty_new.c_cc[VMIN] = 1;
    tcsetattr(fileno(stdin), TCSAFLUSH, &tty_new);

    /* If interrupted, try again */
    if ((cnt < 0) && (err == EINTR)) {
        goto again;
    }

    /* No data--return -1 */
................................................................................

    /* if interrupt happened in "getchar" pass a ^C to input */
    if (in_read) {
        /* clear "read" switch */
        in_read = 0;

        /* disable interrupt char */
        tcsetattr(fileno(stdin), TCSAFLUSH, &tc_noint);

        /* send a ^C to input stream */
        qio_char(CTL('C'));

        /* reenable interrupt char */
        tcsetattr(fileno(stdin), TCSAFLUSH, &tty_new);
    }
}
#endif

/*
 * routine to disable (1), enable (0) ^C interrupt, used to block
 * interrupts during display update







|










|







 







|









|







 







|





|







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
...
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
...
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
        /* disable the interrupt char in this one */
        tc_noint = tty_new;
        tc_noint.c_cc[VINTR] = -1;
    }

    if ((arg == TTY_ON) || (arg == TTY_RESUME)) {
        /* Set up TTY for TECO */
        tcsetattr(fileno(stdin), TCSADRAIN, &tty_new);
#ifndef DEBUG
        /* Handle signals */
#ifdef SIGTSTP
        sig(SIGTSTP, stp_handler);
#endif
        sig(SIGINT, int_handler);
        sig(SIGHUP, hup_handler);
#endif /* DEBUG */
    } else {
        /* Restore to original state */
        tcsetattr(fileno(stdin), TCSADRAIN, &tty_orig);
#ifndef DEBUG
#ifdef SIGTSTP
        sig(SIGTSTP, SIG_DFL);
#endif
        sig(SIGINT, SIG_DFL);
        sig(SIGHUP, SIG_DFL);
#endif
................................................................................
    /* Clear EOF if set */
    if (feof(stdin)) {
        clearerr(stdin);
    }

    /* set to "no delay" mode */
    tty_new.c_cc[VMIN] = 0;
    tcsetattr(fileno(stdin), TCSADRAIN, &tty_new);

    /* read character, or -1, skip nulls */
    do {
        cnt = read(fileno(stdin), &c, sizeof(c));
    } while ((cnt > 0) && (c == '\0'));
    err = errno;

    /* reset to normal mode */
    tty_new.c_cc[VMIN] = 1;
    tcsetattr(fileno(stdin), TCSADRAIN, &tty_new);

    /* If interrupted, try again */
    if ((cnt < 0) && (err == EINTR)) {
        goto again;
    }

    /* No data--return -1 */
................................................................................

    /* if interrupt happened in "getchar" pass a ^C to input */
    if (in_read) {
        /* clear "read" switch */
        in_read = 0;

        /* disable interrupt char */
        tcsetattr(fileno(stdin), TCSADRAIN, &tc_noint);

        /* send a ^C to input stream */
        qio_char(CTL('C'));

        /* reenable interrupt char */
        tcsetattr(fileno(stdin), TCSADRAIN, &tty_new);
    }
}
#endif

/*
 * routine to disable (1), enable (0) ^C interrupt, used to block
 * interrupts during display update

Changes to lib/emacs.tec.

177
178
179
180
181
182
183



184
185
186
187
188
189
190
191
192
193
194
195
196
 qa-^^>"e .ud zj f<'

 !* ESC-p positions screen; gets one more char !
 qa-^^p"e .,6:w f<'

 !* ESC-space, set mark !
 qa-^^ "e .ud f<'




 !* ESC-ESC--go back to TECO !
 qa-^^"e
  5,7:w  et-40et
  ]k
  ^c
 '

 !* All others--no-op !
 f<
>

\







>
>
>













177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
 qa-^^>"e .ud zj f<'

 !* ESC-p positions screen; gets one more char !
 qa-^^p"e .,6:w f<'

 !* ESC-space, set mark !
 qa-^^ "e .ud f<'

 !* ESC-F, format paragraph !
 qa-^^F"e 0l mf f<'

 !* ESC-ESC--go back to TECO !
 qa-^^"e
  5,7:w  et-40et
  ]k
  ^c
 '

 !* All others--no-op !
 f<
>

\

Changes to utils.c.

256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
...
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
 * getcmdc0, when reading beyond command string, pops
 * macro stack and continues.
 * getcmdc, in similar circumstances, reports an error
 * if pushcmdc() has returned any chars, read them first
 * routines type characters as read, if argument != 0
 */
char
getcmdc0(trace)
{
    /* if at end of this level, pop macro stack */
    while (cptr.dot >= cptr.z) {
        /* pop stack; if top level */
        if (--msp < &mstack[0]) {
            /* restore stack pointer */
            msp = &mstack[0];
................................................................................
        cptr.p = cptr.p->f;
        cptr.c = 0;
    }
    return(cmdc);
}

char
getcmdc(trace)
{
    if (cptr.dot++ >= cptr.z) {
        ERROR((msp <= &mstack[0]) ? E_UTC : E_UTM);
    } else {
        cmdc = cptr.p->ch[cptr.c++];	/* get char */
        if (trace) {
            type_char(cmdc);







|







 







|







256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
...
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
 * getcmdc0, when reading beyond command string, pops
 * macro stack and continues.
 * getcmdc, in similar circumstances, reports an error
 * if pushcmdc() has returned any chars, read them first
 * routines type characters as read, if argument != 0
 */
char
getcmdc0(int trace)
{
    /* if at end of this level, pop macro stack */
    while (cptr.dot >= cptr.z) {
        /* pop stack; if top level */
        if (--msp < &mstack[0]) {
            /* restore stack pointer */
            msp = &mstack[0];
................................................................................
        cptr.p = cptr.p->f;
        cptr.c = 0;
    }
    return(cmdc);
}

char
getcmdc(int trace)
{
    if (cptr.dot++ >= cptr.z) {
        ERROR((msp <= &mstack[0]) ? E_UTC : E_UTM);
    } else {
        cmdc = cptr.p->ch[cptr.c++];	/* get char */
        if (trace) {
            type_char(cmdc);