Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
This package contains the useful components that can still be used
on NetBSD after pcvt was replaced with wscons:
* playvt: A vt-movie player, includes several demo files.
* fed, fontedit: two font editors that can also be used on
the fonts in /usr/share/wscons/fonts.

View File

@@ -0,0 +1,31 @@
# $NetBSD: Makefile,v 1.13 2012/10/23 19:51:19 asau Exp $
#
DISTNAME= netbsd-pcvt-20000611
PKGNAME= pcvt-utils-20000611
PKGREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_LOCAL}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://cvsweb.NetBSD.org/bsdweb.cgi/src/sys/arch/i386/isa/pcvt/
COMMENT= Useful leftovers from pcvt: playvt and two font editors
ONLY_FOR_PLATFORM= NetBSD-*-*
USE_BSD_MAKEFILE= yes
WRKSRC= ${WRKDIR}/pcvt/Util
AUTO_MKDIRS= yes
do-install:
${INSTALL_PROGRAM} \
${WRKSRC}/demo/playvt \
${WRKSRC}/fed/fed \
${WRKSRC}/fontedit/fontedit \
${DESTDIR}${PREFIX}/bin
${INSTALL_DATA} \
${WRKSRC}/demo/*.vt \
${DESTDIR}${PREFIX}/share/playvt
.include "../../mk/curses.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

11
sysutils/pcvt-utils/PLIST Normal file
View File

@@ -0,0 +1,11 @@
@comment $NetBSD: PLIST,v 1.3 2009/06/14 18:16:12 joerg Exp $
bin/fed
bin/fontedit
bin/playvt
share/playvt/chardemo.vt
share/playvt/colors.vt
share/playvt/cowscene.vt
share/playvt/outerlimit.vt
share/playvt/sgr.vt
share/playvt/twzone.vt
share/playvt/xmas.vt

View File

@@ -0,0 +1,15 @@
$NetBSD: distinfo,v 1.8 2011/10/01 21:42:16 dholland Exp $
SHA1 (netbsd-pcvt-20000611.tar.gz) = ea51ded62dc82635f1eda3cd198b29cf6f4941ea
RMD160 (netbsd-pcvt-20000611.tar.gz) = 33364b8503d286047163e9f4256374faa3c6b455
Size (netbsd-pcvt-20000611.tar.gz) = 315263 bytes
SHA1 (patch-aa) = 47dec68f79792803f9b4480c8fde812c97b49c46
SHA1 (patch-ab) = f553c956aea18464bced85743a32f3a489870f67
SHA1 (patch-ac) = 9defbfde072b72281a20902e8bc3cc359a46b98b
SHA1 (patch-ad) = 7eca3b30d973f38e51cff98bdb12b58a033341b2
SHA1 (patch-ae) = cc84e968dd2f73fd3328b87de642e9f0d92fc2ac
SHA1 (patch-af) = bd625913a3693e15d305dd56113695953907e99b
SHA1 (patch-ag) = ecc1633ca79c823f2105d9722228c4fd55646835
SHA1 (patch-ah) = 4056eb297b3d155971f2bd96cf8e337a01d4850c
SHA1 (patch-ai) = f35b612fe053b516503d23799db236fde94373f5
SHA1 (patch-fed_misc_c) = 713f5a09db6dfbf7ea71b0a1c76304806d7e07f2

View File

@@ -0,0 +1,28 @@
$NetBSD: patch-aa,v 1.1.1.1 2000/12/04 13:38:25 hubertf Exp $
--- Makefile.orig Mon Dec 4 13:31:23 2000
+++ Makefile
@@ -2,13 +2,18 @@
-#SUBDIR=keycap
#SUBDIR+=cursor
+SUBDIR+=demo
+SUBDIR+=fed
SUBDIR+=fontedit
-SUBDIR+=fonts
+#SUBDIR+=fonts
+#SUBDIR+=ispcvt
+#SUBDIR+=kbdio
#SUBDIR+=kcon
+#SUBDIR+=keycap
#SUBDIR+=loadfont
+#SUBDIR+=mcon
#SUBDIR+=scon
+#SUBDIR+=set2061
#SUBDIR+=userkeys
-SUBDIR+=vttest
-#SUBDIR+=ispcvt
-#SUBDIR+=mcon
+#SUBDIR+=vgaio
+#SUBDIR+=vttest

View File

@@ -0,0 +1,21 @@
$NetBSD: patch-ab,v 1.2 2011/10/01 21:42:16 dholland Exp $
- use modern C
- use the right include files for netbsd with wscons
--- kbdio/kbdio.y.orig Mon Dec 4 13:57:07 2000
+++ kbdio/kbdio.y
@@ -40,7 +40,13 @@
#include <math.h>
#include <sys/fcntl.h>
#include <machine/cpufunc.h>
+#include <unistd.h>
+#if WSCONS
+#include <sys/ioctl.h>
+#include <dev/wscons/wsdisplay_usl_io.h>
+#else
#include <machine/pcvt_ioctl.h>
+#endif
#ifdef __NetBSD__
#include <machine/pio.h>

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-ac,v 1.2 2011/10/01 21:42:16 dholland Exp $
- use pkgsrc curses
--- fed/Makefile.orig Mon Dec 4 13:49:07 2000
+++ fed/Makefile
@@ -1,6 +1,6 @@
PROG= fed
SRCS= fed.c select.c edit.c misc.c
-LDADD= -lncurses
+LDADD= -lcurses
-BINDIR= /usr/local/bin
+BINDIR?= /usr/local/bin
MKMAN= no

View File

@@ -0,0 +1,29 @@
$NetBSD: patch-ad,v 1.3 2011/10/01 21:42:16 dholland Exp $
- use pkgsrc curses
- void main
- use const for clean build
--- fed/fed.h.orig 1995-10-07 21:44:48.000000000 +0000
+++ fed/fed.h
@@ -32,7 +32,7 @@
* fed.h, 3.00, last edit-date: [Sun Jan 2 20:10:31 1994]
*/
-#include <ncurses.h>
+#include <curses.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -109,9 +113,9 @@ void invert ( void );
void setchr ( char type );
void setrow ( char type );
void setcol ( char type );
-void main ( int argc, char *argv[] );
+int main ( int argc, char *argv[] );
void readfont ( char *filename );
-void dis_cmd ( char *strg );
+void dis_cmd ( const char *strg );
void clr_cmd ( void );
void save_ch ( void );
void move_ch ( int src, int dest );

View File

@@ -0,0 +1,57 @@
$NetBSD: patch-ae,v 1.2 2011/10/01 21:42:16 dholland Exp $
- avoid symbol name conflict on "sr"
--- fed/select.c.orig 1995-10-07 21:44:51.000000000 +0000
+++ fed/select.c
@@ -46,9 +46,8 @@
#include "fed.h"
-int sc, sr, scurchar;
-
-int edit();
+/* "sr" is defined in <curses.h> for some terminal capability?!? */
+int sc, fed_sr, scurchar;
void sel_mode(void)
{
@@ -153,12 +152,12 @@ int selectc()
case 'g':
case 'G':
dis_cmd(" Exchange: select Destination, then press RETURN or any other Key to ABORT");
- sr = r;
+ fed_sr = r;
sc = c;
scurchar = curchar;
if((curchar = sel_dest()) == -1)
{ /* failsafe */
- r = sr;
+ r = fed_sr;
c = sc;
curchar = scurchar;
}
@@ -174,12 +173,12 @@ int selectc()
case 'm':
case 'M':
dis_cmd(" Move: select Destination, then press RETURN or any other Key to ABORT");
- sr = r;
+ fed_sr = r;
sc = c;
scurchar = curchar;
if((curchar = sel_dest()) == -1)
{ /* failsafe */
- r = sr;
+ r = fed_sr;
c = sc;
curchar = scurchar;
}
@@ -320,7 +319,7 @@ void normal_uset(int r, int c)
mvwprintw(set_win,(r+1),((c*2)+1),"%c%c",h,l);
wmove(set_win,(r+1),((c*2)+1));
- if((r==sr) && (c==sc))
+ if((r==fed_sr) && (c==sc))
{
wattron(set_win,A_REVERSE);
mvwprintw(set_win,(r+1),((c*2)+1),"%c%c",h,l);

View File

@@ -0,0 +1,87 @@
$NetBSD: patch-af,v 1.3 2011/10/01 21:42:16 dholland Exp $
Use standard C.
--- demo/playvt.c.orig 1997-11-01 06:49:36.000000000 +0000
+++ demo/playvt.c
@@ -30,7 +30,7 @@
*
*/
-static char *id =
+const char id[] =
"@(#)playvt.c, 1.00, Last Edit-Date: [Sun Jan 1 18:32:22 1995]";
/*---------------------------------------------------------------------------*
@@ -42,22 +42,21 @@ static char *id =
*---------------------------------------------------------------------------*/
#include <stdio.h>
+#include <string.h>
#include <unistd.h>
+#include <stdlib.h>
+#include <err.h>
-main(argc,argv)
-int argc;
-char *argv[];
-{
- extern int optind;
- extern int opterr;
- extern char *optarg;
+void usage(void);
+int
+main(int argc, char *argv[])
+{
int c;
FILE *fp = stdin;
volatile int i;
int delay = 0;
- int fflag = -1;
- char *filename;
+ char *filename = NULL;
while( (c = getopt(argc, argv, "d:f:")) != -1)
{
@@ -69,7 +68,6 @@ char *argv[];
case 'f':
filename = optarg;
- fflag = 1;
break;
case '?':
@@ -79,15 +77,11 @@ char *argv[];
}
}
- if(fflag == 1)
+ if(filename != NULL)
{
if((fp = fopen(filename, "r")) == NULL)
{
- char buffer[80];
- strcpy(buffer,"ERROR opening file ");
- strcat(buffer,filename);
- perror(buffer);
- exit(1);
+ err(1, "ERROR opening file %s", filename);
}
}
@@ -100,7 +94,8 @@ char *argv[];
}
-usage()
+void
+usage(void)
{
fprintf(stderr,"\nplayvt - play a VT animation with programmable delay\n");
fprintf(stderr,"usage: playvt -f [filename] -d [delay]\n");
@@ -108,4 +102,3 @@ usage()
fprintf(stderr," -d <delay> delay between characters\n");
exit(1);
}
-

View File

@@ -0,0 +1,25 @@
$NetBSD: patch-ag,v 1.2 2011/10/01 21:42:16 dholland Exp $
- void main
- fix printf format gcc objects to
--- fed/fed.c.orig 1995-10-07 21:44:47.000000000 +0000
+++ fed/fed.c
@@ -48,7 +48,7 @@
#include "fed.h"
-void main(int argc, char *argv[])
+int main(int argc, char *argv[])
{
int i;
int row, col;
@@ -142,7 +142,7 @@ void main(int argc, char *argv[])
for(i=0; i<256; i++)
{
- mvwprintw(set_win,row+1,col+1,"%02.2X",i);
+ mvwprintw(set_win,row+1,col+1,"%2.2X",i);
if(++row > 15)
{
row = 0;

View File

@@ -0,0 +1,362 @@
$NetBSD: patch-ah,v 1.3 2011/10/01 21:42:16 dholland Exp $
- use modern C
- declare functions properly
- use const for a clean build
- use signed/unsigned consistently
--- fontedit/fontedit.c.orig 1995-10-07 21:44:58.000000000 +0000
+++ fontedit/fontedit.c
@@ -22,24 +22,26 @@
* - eap@bucsf.bu.edu
*/
-void clear_screen();
#include <stdio.h>
#ifdef SYSV
#include <sys/termio.h>
-#endif SYSV
+#endif /* SYSV */
#ifdef BSD
#include <sys/ioctl.h>
-#endif BSD
+#endif /* BSD */
#if defined (__NetBSD__) || defined (__FreeBSD__)
#include <sys/termios.h>
#include <sys/ioctl.h>
#endif /* __NetBSD__ || __FreeBSD__ */
#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#ifdef CURFIX
#define CURSORON "\033[?25h"
#define CURSOROFF "\033[?25l"
-#endif CURFIX
+#endif /* CURFIX */
#define MAX_ROWS 10
#define MAX_COLS 8
@@ -103,33 +105,51 @@ unsigned int current_entry;
#ifdef SYSV
struct termio old_stty, new_stty;
-#endif SYSV
+#endif /* SYSV */
#ifdef BSD
struct sgttyb old_stty, new_stty;
-#endif BSD
+#endif /* BSD */
#if defined (__NetBSD__) || defined (__FreeBSD__)
struct termios old_stty, new_stty;
#endif /* __NetBSD__ || __FreeBSD__ */
FILE * font_file = (FILE *)0;
+void interrupt(void);
+void command(void);
+void pad(void);
+void init_restore(void);
+void clear_screen(void);
+void save_table(FILE *);
+void get_table(FILE *);
+void build_entry(unsigned);
+void extract_entry(unsigned);
+void send_entry(unsigned);
+void print_entry(unsigned, bool);
+void highlight(unsigned, unsigned, bool);
+void draw_current(void);
+void init_restore(void);
+void help(void);
+void warning(const char *);
+void move(int, int);
+int get_key(void);
/*
* Interrupt
* Exit gracefully.
*/
-interrupt()
+void
+interrupt(void)
{
- void clear_screen();
#ifdef CURFIX
printf("%s\n",CURSORON);
-#endif CURFIX
+#endif /* CURFIX */
#ifdef SYSV
ioctl( 0, TCSETA, &old_stty );
-#endif SYSV
+#endif /* SYSV */
#ifdef BSD
ioctl( 0, TIOCSETP, &old_stty );
-#endif BSD
+#endif /* BSD */
#if defined (__NetBSD__) || defined (__FreeBSD__)
ioctl( 0, TIOCSETA, &old_stty );
#endif /* __NetBSD__ || __FreeBSD__ */
@@ -142,13 +162,10 @@ interrupt()
* Main
* Grab input/output file and call main command processor.
*/
-
-main( argc, argv )
-int argc;
-char *argv[];
+
+int
+main( int argc, char *argv[] )
{
- void command(), init_restore(), clear_screen();
- void save_table(), get_table(), extract_entry();
if ( argc != 2 ) {
fprintf( stderr, "usage: fontedit filename\n" );
@@ -180,13 +197,13 @@ char *argv[];
}
#ifdef CURFIX
printf("%s\n",CURSOROFF);
-#endif CURFIX
+#endif /* CURFIX */
#ifdef SYSV
ioctl( 0, TCGETA, &old_stty );
-#endif SYSV
+#endif /* SYSV */
#ifdef BSD
ioctl( 0, TIOCGETP, &old_stty );
-#endif BSD
+#endif /* BSD */
#if defined (__NetBSD__) || defined (__FreeBSD__)
ioctl( 0, TIOCGETA, &old_stty );
#endif /* __NetBSD__ || __FreeBSD__ */
@@ -196,7 +213,7 @@ char *argv[];
new_stty.c_lflag &= ~ICANON;
new_stty.c_cc[VMIN] = 1;
ioctl( 0, TCSETA, &new_stty );
-#endif SYSV
+#endif /* SYSV */
#if defined (__NetBSD__) || defined (__FreeBSD__)
new_stty.c_lflag &= ~ICANON;
new_stty.c_lflag &= ~ECHO;
@@ -207,17 +224,17 @@ char *argv[];
new_stty.sg_flags |= CBREAK;
new_stty.sg_flags &= ~ECHO;
ioctl( 0, TIOCSETP, &new_stty );
-#endif BSD
+#endif /* BSD */
current_entry = 1;
extract_entry( current_entry );
init_restore();
command();
#ifdef SYSV
ioctl( 0, TCSETA, &old_stty );
-#endif SYSV
+#endif /* SYSV */
#ifdef BSD
ioctl( 0, TIOCSETP, &old_stty );
-#endif BSD
+#endif /* BSD */
#if defined (__NetBSD__) || defined (__FreeBSD__)
ioctl( 0, TIOCSETA, &old_stty );
#endif /* __NetBSD__ || __FreeBSD__ */
@@ -230,7 +247,7 @@ char *argv[];
fclose( font_file );
#ifdef CURFIX
printf("%s\n",CURSORON);
-#endif CURFIX
+#endif /* CURFIX */
}
@@ -243,17 +260,13 @@ char *argv[];
*/
void
-command()
+command(void)
{
register int c;
register int row, col;
register int i, j;
bool change, error, override;
- void build_entry(), extract_entry(), send_entry(), print_entry();
- void highlight(), draw_current(), init_restore(), help();
- void warning();
-
change = false;
error = false;
override = false;
@@ -437,7 +450,7 @@ command()
-char *key_table[] = {
+const char *key_table[] = {
"\033[1~", /* Find */
"\033[2~", /* Insert */
"\033[3~", /* Remove */
@@ -471,7 +484,7 @@ char *key_table[] = {
*/
int
-get_key()
+get_key(void)
{
register char *p;
char s[10];
@@ -501,7 +514,8 @@ get_key()
* Emit nulls so that the terminal can catch up.
*/
-pad()
+void
+pad(void)
{
int i;
@@ -518,13 +532,11 @@ pad()
*/
void
-init_restore()
+init_restore(void)
{
register int row, col;
- register int i;
+ register unsigned i;
- void draw_current(), clear_screen(), print_entry();
-
clear_screen();
for ( col = 0; col < MAX_COLS; ++col ) {
@@ -585,7 +597,7 @@ init_restore()
*/
void
-draw_current()
+draw_current(void)
{
register int row, col;
@@ -656,7 +668,7 @@ bool on;
*/
void
-clear_screen()
+clear_screen(void)
{
printf( "\033[H\033[J" ); /* Clear screen. */
fflush( stdout );
@@ -668,6 +680,7 @@ clear_screen()
* move
*/
+void
move( y, x )
int y, x;
{
@@ -769,11 +782,11 @@ unsigned int entry_no;
void
send_entry( entry_no )
-int entry_no;
+unsigned entry_no;
{
register char *fp = font_table[entry_no];
- printf( "\033P1;%d;1;0;0;0{ @%c%c%c%c%c%c%c%c/%c%c%c%c%c%c%c%c\033\\",
+ printf( "\033P1;%u;1;0;0;0{ @%c%c%c%c%c%c%c%c/%c%c%c%c%c%c%c%c\033\\",
entry_no,
fp[ 0], fp[ 1], fp[ 2], fp[ 3], fp[ 4], fp[ 5], fp[ 6], fp[ 7],
fp[ 8], fp[ 9], fp[10], fp[11], fp[12], fp[13], fp[14], fp[15] );
@@ -790,9 +803,9 @@ int entry_no;
*/
void
-print_entry( entry_no, highlight )
+print_entry( entry_no, dohighlight )
register unsigned int entry_no;
-bool highlight;
+bool dohighlight;
{
register int y, x;
@@ -803,14 +816,14 @@ bool highlight;
move( y * 2 + TABLE_ROW, x * 2 + TABLE_COL );
- if ( highlight )
+ if ( dohighlight )
printf( "\033[7m" );
printf( "\033* @" ); /* select DRCS into G2 */
printf( "\033N" ); /* select single shift */
printf( "%c", entry_no ); /* Draw the character */
- if ( highlight )
+ if ( dohighlight )
printf( "\033[0m" );
}
@@ -822,15 +835,15 @@ bool highlight;
*/
void
-save_table( font_file )
-FILE *font_file;
+save_table( the_font_file )
+FILE *the_font_file;
{
register char *fp;
register int i;
for ( i = 0; i < TOTAL_ENTRIES; ++i ) {
fp = font_table[i];
- fprintf( font_file, "\033P1;%d;1;0;0;0{ @%c%c%c%c%c%c%c%c/%c%c%c%c%c%c%c%c\033\\\n",
+ fprintf( the_font_file, "\033P1;%d;1;0;0;0{ @%c%c%c%c%c%c%c%c/%c%c%c%c%c%c%c%c\033\\\n",
i,
fp[ 0], fp[ 1], fp[ 2], fp[ 3], fp[ 4], fp[ 5], fp[ 6], fp[ 7],
fp[ 8], fp[ 9], fp[10], fp[11], fp[12], fp[13], fp[14], fp[15] );
@@ -845,8 +858,8 @@ FILE *font_file;
*/
void
-get_table( font_file )
-FILE *font_file;
+get_table( the_font_file )
+FILE *the_font_file;
{
char s[256];
register char *p;
@@ -854,7 +867,7 @@ FILE *font_file;
int i;
register int j;
- while( fgets( s, 255, font_file ) ) {
+ while( fgets( s, 255, the_font_file ) ) {
if ( strncmp( s, "\033P1;", 4 ) != 0 )
continue; /* Bogus line */
p = &s[4];
@@ -890,7 +903,7 @@ FILE *font_file;
*/
void
-help()
+help(void)
{
printf( "Font editor\n\n" );
printf( "F6 - Pixel on\n" );
@@ -915,8 +928,7 @@ help()
*/
void
-warning( s )
-char *s;
+warning( const char *s )
{
move( ERROR_ROW, ERROR_COL );
printf( "Warning: %s!\n", s );

View File

@@ -0,0 +1,26 @@
$NetBSD: patch-ai,v 1.2 2011/10/01 21:42:16 dholland Exp $
configure for pkgsrc
--- Makefile.inc.orig 1999-06-04 14:47:33.000000000 -0400
+++ Makefile.inc
@@ -4,8 +4,8 @@ ECHO ?= echo
BINDIR ?= /usr/bin
FONTDIR = /usr/share/pcvt/fonts
-LIBDIR = /usr/lib
-LIBMODE = 644
+LIBDIR ?= /usr/lib
+LIBMODE ?= 644
INCDIR= ${DESTDIR}/usr/include/machine
@@ -15,7 +15,7 @@ MAN3EXT = 3
MAN4EXT = 4
MAN5EXT = 5
MAN8EXT = 8
-MANDIR = /usr/share/man
+MANDIR ?= /usr/share/man
MAN = ${MAN1} ${MAN3} ${MAN4} ${MAN5} ${MAN8}

View File

@@ -0,0 +1,120 @@
$NetBSD: patch-fed_misc_c,v 1.1 2011/10/01 21:42:16 dholland Exp $
- use const for clean build
- don't use sprintf (or perror)
- fix wrong printf formats
--- fed/misc.c.orig 1995-10-07 21:44:49.000000000 +0000
+++ fed/misc.c
@@ -46,14 +46,15 @@
#include "fed.h"
-#include <stdlib.h>
-#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <stdlib.h>
+#include <string.h>
+#include <err.h>
static unsigned char *fonttab; /* ptr to font in core memory */
-static char *bitmask[] = {
+static const char *bitmask[] = {
"....", /* 0 */
"...*", /* 1 */
"..*.", /* 2 */
@@ -83,22 +84,17 @@ void readfont(char *filename)
FILE *in;
struct stat sbuf, *sbp;
int ret;
- char buffer[1024];
sbp = &sbuf;
if((in = fopen(filename, "r")) == NULL)
{
- sprintf(buffer, "cannot open file %s for reading", filename);
- perror(buffer);
- exit(1);
+ err(1, "cannot open file %s for reading", filename);
}
if((fstat(fileno(in), sbp)) != 0)
{
- sprintf(buffer, "cannot fstat file %s", filename);
- perror(buffer);
- exit(1);
+ err(1, "cannot fstat file %s", filename);
}
switch(sbp->st_size)
@@ -129,7 +125,7 @@ void readfont(char *filename)
break;
default:
- fprintf(stderr,"error, file %s is no valid font file, size=%d\n",filename,sbp->st_size);
+ fprintf(stderr,"error, file %s is no valid font file, size=%lld\n",filename,(long long)sbp->st_size);
exit(1);
}
@@ -144,9 +140,7 @@ void readfont(char *filename)
if((ret = fread(fonttab, sizeof(*fonttab), sbp->st_size, in)) != sbp->st_size)
{
- sprintf(buffer,"error reading file %s, size = %d, ret = %d\n",filename,sbp->st_size, ret);
- perror(buffer);
- exit(1);
+ err(1, "error reading file %s, size = %lld, ret = %d\n",filename,(long long)sbp->st_size, ret);
}
}
@@ -156,8 +150,7 @@ void readfont(char *filename)
void writefont()
{
FILE *in, *out;
- int ret;
- char buffer[1024];
+ size_t ret;
if((in = fopen(lfilename, "r")) != NULL)
{
@@ -168,9 +161,7 @@ void writefont()
strcat(wfn, ".BAK");
if((out = fopen(wfn, "w")) == NULL)
{
- sprintf(buffer, "cannot open file %s for writing", wfn);
- perror(buffer);
- exit(1);
+ err(1, "cannot open file %s for writing", wfn);
}
while(( c = fgetc(in) ) != EOF )
@@ -182,23 +173,19 @@ void writefont()
if((out = fopen(lfilename, "w")) == NULL)
{
- sprintf(buffer, "cannot open file %s for writing", lfilename);
- perror(buffer);
- exit(1);
+ err(1, "cannot open file %s for writing", lfilename);
}
if((ret = fwrite(fonttab, sizeof(*fonttab), lfilesize, out)) != lfilesize)
{
- sprintf(buffer,"error writing file %s, size=%d, ret=%d\n",lfilename,lfilesize, ret);
- perror(buffer);
- exit(1);
+ err(1, "error writing file %s, size=%d, ret=%lu\n",lfilename,lfilesize, ret);
}
}
/*---------------------------------------------------------------------------*
* display a string
*---------------------------------------------------------------------------*/
-void dis_cmd(char *strg)
+void dis_cmd(const char *strg)
{
move(22,0);
clrtoeol();