From: Neal Andrew Crook Date: Tue, 24 May 2016 21:59:02 +0000 (+0100) Subject: Bring 6809 library stuff in sync with z80.. in particular by adding X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=36036b96767f222b267643c44a01d65c9ea4a339;p=FUZIX.git Bring 6809 library stuff in sync with z80.. in particular by adding termcap.c and the lib/curses files. Tweaked line-breaks in makefile to make it easier to diff against z80 version. --- diff --git a/Library/include/curses.h b/Library/include/curses.h index 5bceb187..43134622 100644 --- a/Library/include/curses.h +++ b/Library/include/curses.h @@ -165,11 +165,11 @@ _PROTOTYPE( char *longname, (void)); _PROTOTYPE( void meta, (WINDOW *_win, bool _flag) ); _PROTOTYPE( int mvcur, (int _oldy, int _oldx, int _newy, int _newx) ); _PROTOTYPE( int mvinch, (int _y, int _x) ); -_PROTOTYPE( int mvprintw, (int _y, int _x, char *_fmt, ...) ); +_PROTOTYPE( int mvprintw, (int _y, int _x, const char *_fmt, ...) ); _PROTOTYPE( int mvscanw, (int _y, int _x, const char *_fmt, ...) ); _PROTOTYPE( int mvwin, (WINDOW *_win, int _begy, int _begx) ); _PROTOTYPE( int mvwinch, (WINDOW *_win, int _y, int _x) ); -_PROTOTYPE( int mvwprintw, (WINDOW *_win, int _y, int _x, char *_fmt, ...) ); +_PROTOTYPE( int mvwprintw, (WINDOW *_win, int _y, int _x, const char *_fmt, ...) ); _PROTOTYPE( int mvwscanw, (WINDOW *_win, int _y, int _x, const char *_fmt, ...) ); _PROTOTYPE( WINDOW *newwin, (int _num_lines, int _num_cols, int _y, int _x)); @@ -183,7 +183,7 @@ _PROTOTYPE( int outc, (int _c) ); _PROTOTYPE( void overlay, (WINDOW *_win1, WINDOW *_win2) ); _PROTOTYPE( void overwrite, (WINDOW *_win1, WINDOW *_win2) ); _PROTOTYPE( void poscur, (int _r, int _c) ); -_PROTOTYPE( int printw, (char *fmt, ...) ); +_PROTOTYPE( int printw, (const char *_fmt, ...) ); _PROTOTYPE( void raw, (void)); _PROTOTYPE( int resetterm, (void)); _PROTOTYPE( int saveoldterm, (void)); @@ -216,7 +216,7 @@ _PROTOTYPE( int winsch, (WINDOW *_win, char _c) ); _PROTOTYPE( int winsertln, (WINDOW *_win) ); _PROTOTYPE( int wmove, (WINDOW *_win, int _y, int _x) ); _PROTOTYPE( void wnoutrefresh, (WINDOW *_win) ); -_PROTOTYPE( int wprintw, (WINDOW *win, char *fmt, ...)); +_PROTOTYPE( int wprintw, (WINDOW *_win, const char *_fmt, ...)); _PROTOTYPE( void wrefresh, (WINDOW *_win) ); _PROTOTYPE( int wscanw, (WINDOW *_win, const char *_fmt, ...)); _PROTOTYPE( int wsetscrreg, (WINDOW *_win, int _top, int _bottom) ); diff --git a/Library/libs/Makefile.6809 b/Library/libs/Makefile.6809 index f419a264..d965d8e7 100644 --- a/Library/libs/Makefile.6809 +++ b/Library/libs/Makefile.6809 @@ -16,9 +16,9 @@ OBJ_CRT0 = $(SRC_CRT0:.s=.o) SRC_ASM = setjmp_6809.s ashlsi3_6809.s OBJ_ASM = $(SRC_ASM:.s=.o) SRC_C = __argv.c abort.c asctime.c assert.c atexit.c -SRC_C += bcmp.c bcopy.c bsearch.c bzero.c calloc.c cfree.c -SRC_C += clock.c clock_gettime.c clock_getres.c clock_settime.c -SRC_C += closedir.c closedir_r.c creat.c crypt.c ctermid.c ctime.c cuserid.c +SRC_C += bcmp.c bcopy.c bsearch.c bzero.c calloc.c cfree.c clock.c closedir.c +SRC_C += closedir_r.c clock_gettime.c clock_getres.c clock_settime.c +SRC_C += creat.c crypt.c ctermid.c ctime.c cuserid.c SRC_C += difftime.c err.c errno.c error.c SRC_C += execl.c execv.c execvp.c exit.c SRC_C += fclose.c fflush.c fgetc.c fgetgrent.c fgetpwent.c @@ -27,8 +27,10 @@ SRC_C += free.c fsetpos.c ftell.c fwrite.c getcwd.c SRC_C += getenv.c __getgrent.c getgrgid.c getgrnam.c getloadavg.c getlogin.c SRC_C += getopt.c SRC_C += getpw.c __getpwent.c getpwnam.c getpwuid.c gets.c gettimeofday.c -SRC_C += getw.c gmtime.c gmtime_r.c grent.c index.c initgroups.c isatty.c -SRC_C += killpg.c libintl.c +SRC_C += getw.c gmtime.c gmtime_r.c grent.c +SRC_C += inet_addr.c inet_aton.c inet_network.c inet_ntoa.c inet_ntop.c inet_pton.c +SRC_C += index.c initgroups.c isatty.c killpg.c +SRC_C += libintl.c SRC_C += localtim.c localtim_r.c lseek.c lsearch.c lstat.c ltoa.c ltostr.c SRC_C += malloc.c mkfifo.c mkstemps.c nanosleep.c opendir.c opendir_r.c SRC_C += pause.c perror.c @@ -38,7 +40,7 @@ SRC_C += regsub.c remove.c rewind.c rewinddir.c rindex.c seekdir.c setbuffer.c s SRC_C += setlocale.c setvbuf.c settimeofday.c sleep.c sprintf.c SRC_C += stat.c stdio0.c stime.c SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c -SRC_C += strnlen.c strnicmp.c strsep.c strsignal.c strxfrm.c strcoll.c +SRC_C += strnlen.c strnicmp.c strsep.c strxfrm.c strcoll.c strsignal.c SRC_C += strtod.c strtol.c swab.c system.c telldir.c time.c tmpfile.c tmpnam.c ttyname.c SRC_C += tzset.c ungetc.c usleep.c utent.c utimes.c utsname.c SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c @@ -60,9 +62,14 @@ SRC_C += strcat.c strchr.c strcmp.c strcspn.c strncat.c strncmp.c SRC_C += strncpy.c strpbrk.c strrchr.c strspn.c strstr.c strtok.c SRC_C += memchr.c memcmp.c memcpy.c memset.c memmove.c +SRC_C += termcap.c + +SRC_CURS = $(shell find curses -name '*.c') + OBJ_C = $(SRC_C:.c=.o) +OBJ_CURS = $(SRC_CURS:.c=.o) OBJ_HARD = $(SRC_HARD:.c=.o) -OBJ_ALL = $(OBJ_ASM) $(OBJ_C) $(OBJ_HARD) +OBJ_ALL = $(OBJ_ASM) $(OBJ_C) $(OBJ_CURS) $(OBJ_HARD) all: syslib$(PLATFORM).lib liberror.txt $(OBJ_CRT0) @@ -106,6 +113,9 @@ $(OBJ_CRT0):%.o: %.s $(OBJ_C):%.o: %.c $(CC) $(CC_OPT) $(@:.o=.c) +$(OBJ_CURS):%.o: %.c + $(CC) $(CC_OPT) $(@:.o=.c) -o $@ + $(OBJ_HARD):%.o: %.c $(CC) $(CC_NOOPT) $(@:.o=.c) @@ -115,3 +125,4 @@ clean: -cd fuzix$(PLATFORM) && make clean rm -rf fuzix$(PLATFORM)/Makefile rm -f $(KRN_HEADERS_COPY) + -cd curses && rm -rf *.o *.asm *.sym *.lst *~ diff --git a/Library/libs/termcap.c b/Library/libs/termcap.c index a0182824..0e81d04d 100644 --- a/Library/libs/termcap.c +++ b/Library/libs/termcap.c @@ -58,7 +58,7 @@ extern char *UP; /* up cursor movement */ * termcap entry found, 0 if not found, and -1 if file not found. */ -int tgetent(char *bp, char *name) +int tgetent(char *bp, const char *name) { FILE *fp; const char *file;