teco

Check-in [f3f5d918bc]
Login

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

Overview
Comment:Make use of termcap optional (for embedded targets). It's only used for terminal sizing; everything else is hard-coded for ANSI.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | master | trunk
Files: files | file ages | folders
SHA3-256:f3f5d918bc5bfe62a6bcd375146b30066e7ce09c0562ac05319ce8d936b6f93b
User & Date: vandys 2019-02-23 15:21:41
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.

11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
26
27
28
29
# teco executable
#
# CC=clang
CC=gcc
OBJS=chario.o data.o exec0.o exec1.o \
	exec2.o main.o rdcmd.o srch.o subs.o \
	utils.o window.o undo.o
CFLAGS=-DDEBUG -g -Wall -Werror

LIBS=-ltermcap

te: $(OBJS)
	rm -f te
	$(CC) $(CFLAGS) -o te $(OBJS) $(LIBS)

clean:
	rm -f core *.o tags

clobber: clean
	rm -f te teco lib/tecorc







|
>











11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# teco executable
#
# CC=clang
CC=gcc
OBJS=chario.o data.o exec0.o exec1.o \
	exec2.o main.o rdcmd.o srch.o subs.o \
	utils.o window.o undo.o
CFLAGS=-DDEBUG -g -DWSIZE -Wall -Werror
# Only used for window size (-DWSIZE)
LIBS=-ltermcap

te: $(OBJS)
	rm -f te
	$(CC) $(CFLAGS) -o te $(OBJS) $(LIBS)

clean:
	rm -f core *.o tags

clobber: clean
	rm -f te teco lib/tecorc

Changes to main.c.

39
40
41
42
43
44
45

46

47
48
49
50
51
52
53
...
265
266
267
268
269
270
271

272
273
274
275
276
277
278
...
287
288
289
290
291
292
293








294
295
296
297
298
299
300
301
302
* chario.c		keyboard (stdin), typeout (stdout), suspend
*
* window.c		display window and display special functions
*
* These routines should be compiled and linked to form the TECO executable.
*/
#include <stdlib.h>

#include <termcap.h>

#include <setjmp.h>
#include "defs.h"

static void save_args(int argc, char **argv, struct qh *q);
static void read_startup(void), get_term_par(void);
static void print_string(int arg), cleanup(void);

................................................................................

            /* set eisw if file found, or not if not */
            eisw = fopen(fn, "r");
        }
    }
}


/* routine to get terminal height and width from termcap */
static void
get_term_par(void)
{
    static char lbuff[1024];	/* termcap buffer */
    char *pname;			/* pointer to name of terminal */
    extern char *getenv();
................................................................................
    }

#ifdef SIGWINCH
    /* Let SIGWINCH-type handler have a shot at it */
    recalc_tsize(SIGWINCH);
#endif
}









/*
 * Jump out on teco error code
 */
void
teco_error(int why)
{
    longjmp(err_jump, why);
}







>

>







 







>







 







>
>
>
>
>
>
>
>









39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
...
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
...
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
* chario.c		keyboard (stdin), typeout (stdout), suspend
*
* window.c		display window and display special functions
*
* These routines should be compiled and linked to form the TECO executable.
*/
#include <stdlib.h>
#ifdef WSIZE
#include <termcap.h>
#endif
#include <setjmp.h>
#include "defs.h"

static void save_args(int argc, char **argv, struct qh *q);
static void read_startup(void), get_term_par(void);
static void print_string(int arg), cleanup(void);

................................................................................

            /* set eisw if file found, or not if not */
            eisw = fopen(fn, "r");
        }
    }
}

#ifdef WSIZE
/* routine to get terminal height and width from termcap */
static void
get_term_par(void)
{
    static char lbuff[1024];	/* termcap buffer */
    char *pname;			/* pointer to name of terminal */
    extern char *getenv();
................................................................................
    }

#ifdef SIGWINCH
    /* Let SIGWINCH-type handler have a shot at it */
    recalc_tsize(SIGWINCH);
#endif
}
#else /* WSIZE */
static void
get_term_par(void)
{
    /* Default geometry */
    set_term_par(24, 80);
}
#endif /* !WSIZE */

/*
 * Jump out on teco error code
 */
void
teco_error(int why)
{
    longjmp(err_jump, why);
}