+/* $OpenBSD: crt0.c,v 1.2 1996/12/21 22:23:36 millert Exp $ */
/* $NetBSD: crt0.c,v 1.20 1995/06/03 13:16:08 pk Exp $ */
+
/*
* Copyright (c) 1993 Paul Kranenburg
* All rights reserved.
argv = &kfp->kargv[0];
environ = argv + kfp->kargc + 1;
- if (ap = argv[0])
+ if ((ap = argv[0]))
if ((__progname = _strrchr(ap, '/')) == NULL)
__progname = ap;
else
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: getwd.c,v 1.3 1996/12/17 02:38:39 deraadt Exp $";
+static char *rcsid = "$OpenBSD: getwd.c,v 1.4 1996/12/21 22:23:37 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
{
char *p;
- if (p = getcwd(buf, MAXPATHLEN))
+ if ((p = getcwd(buf, MAXPATHLEN)))
return(p);
(void)strncpy(buf, strerror(errno), MAXPATHLEN-1);
buf[MAXPATHLEN-1] = '\0';
-/* $OpenBSD: aperture.c,v 1.1 1996/03/05 11:25:29 mickey Exp $ */
+/* $OpenBSD: aperture.c,v 1.2 1996/12/21 22:23:38 millert Exp $ */
/*
* Copyright 1994 the XFree86 Project Inc.
int
apopen(dev_t dev, int oflags, int devtype, struct proc *p)
{
- struct pcred *pc = p->p_cred;
-
if (suser(p->p_ucred, &p->p_acflag) != 0) {
return(EPERM);
}
printf("apmmap: addr 0x%x\n", offset);
#endif
if ((minor(dev) == 0)
- && (offset >= VGA_START && offset <= VGA_END
+ && ((offset >= VGA_START && offset <= VGA_END)
|| (unsigned)offset > (unsigned)ctob(physmem))) {
return i386_btop(offset);
} else {
-/* $OpenBSD: aptest.c,v 1.1 1996/03/05 11:25:46 mickey Exp $ */
+/* $OpenBSD: aptest.c,v 1.2 1996/12/21 22:23:39 millert Exp $ */
/*
* Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com
*
printf("%c",addr[i]);
/* printf("addr[%d]=%c\n",i,addr[i]);
*/
- printf("\nDONE displaying memory contents (%d bytes)\n",stop);
+ printf("\nDONE displaying memory contents (%ld bytes)\n",stop);
/* unmap and close */
printf("UNMAPPING [0x%x ,size=%d) to addr=0x%x... and closing...",
int TEST_LENGTH;
#define DECL_TEST_LENGTH 37 /* a mostly random number */
+int
main(int argc, char *argv[])
{
void clearbits();
void printbits();
- int b, i;
+ int i;
bitstr_t *bs;
bitstr_t bit_decl(bss, DECL_TEST_LENGTH);
static volatile const double huge = DBL_MAX;
static volatile const double tiny = DBL_MIN;
+int
main()
{
volatile double x;
fprintf(d, ">");
break;
default:
- fprintf(d, "!%d(%d)!", OP(*s), opnd);
+ fprintf(d, "!%ld(%ld)!", (long)OP(*s), (long)opnd);
break;
}
if (!done)
+/* $OpenBSD: main.c,v 1.2 1996/12/21 22:23:42 millert Exp $ */
/* $NetBSD: main.c,v 1.2 1995/04/20 22:39:51 cgd Exp $ */
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <regex.h>
#include <assert.h>
+#include <unistd.h>
#include "main.ih"
/*
- main - do the simple case, hand off to regress() for regression
*/
+int
main(argc, argv)
int argc;
char *argv[];
exit(status);
}
if (!(copts®_NOSUB)) {
- len = (int)(subs[0].rm_eo - subs[0].rm_so);
+ len = (size_t)(subs[0].rm_eo - subs[0].rm_so);
if (subs[0].rm_so != -1) {
if (len != 0)
- printf("match `%.*s'\n", len,
+ printf("match `%.*s'\n", (int)len,
argv[optind] + subs[0].rm_so);
else
printf("match `'@%.1s\n",
char *name;
{
static char efbuf[100];
- size_t n;
regex_t re;
sprintf(efbuf, "REG_%s", name);
*/
#include <sys/types.h>
+#include <err.h>
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
printf("%s\n", strerror(errno));
exit(1);
}
+
+ exit(0);
}
*
*---------------------------------------------------------------------------*/
-#include <stdio.h>
#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <sys/stat.h>
#include <machine/pcvt_ioctl.h>
#define DEFAULTFD 0
+void usage __P((void));
+
+int
main(argc,argv)
int argc;
char *argv[];
int start = -1;
int end = -1;
int dflag = -1;
- char *device;
+ char *device = NULL;
while( (c = getopt(argc, argv, "d:n:s:e:")) != EOF)
{
exit(0);
}
+void
usage()
{
fprintf(stderr,"\ncursor - set cursor shape for pcvt video driver\n");
fprintf(stderr," -e <line> ending scan line (bottom scan line)\n\n");
exit(1);
}
-
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=%ld\n",filename,(long)sbp->st_size);
exit(1);
}
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);
+ sprintf(buffer,"error reading file %s, size = %ld, ret = %d\n",filename,(long)sbp->st_size, ret);
perror(buffer);
exit(1);
}
#include <sys/ioctl.h>
#endif /* __NetBSD__ || __OpenBSD__ || __FreeBSD__ */
#include <signal.h>
+#include <string.h>
+#include <unistd.h>
#ifdef CURFIX
#define CURSORON "\033[?25h"
#endif /* __NetBSD__ || __OpenBSD__ || __FreeBSD__ */
FILE * font_file = (FILE *)0;
+#ifdef __P
+void interrupt __P((void));
+void command __P((void));
+int get_key __P((void));
+void pad __P((void));
+void init_restore __P((void));
+void draw_current __P((void));
+void highlight __P((unsigned int, unsigned int, bool));
+void clear_screen __P((void));
+void move __P((int, int));
+void build_entry __P((unsigned int));
+void extract_entry __P((unsigned int));
+void send_entry __P((int));
+void print_entry __P((register unsigned int, bool));
+void save_table __P((FILE *));
+void get_table __P((FILE *));
+void help __P((void));
+void warning __P((char *));
+#endif
/*
* Interrupt
* Exit gracefully.
*/
+void
interrupt()
{
void clear_screen();
* Grab input/output file and call main command processor.
*/
+int
main( argc, argv )
int argc;
char *argv[];
#ifdef CURFIX
printf("%s\n",CURSORON);
#endif CURFIX
+ exit(0);
}
* Emit nulls so that the terminal can catch up.
*/
+void
pad()
{
int i;
* move
*/
+void
move( y, x )
int y, x;
{
*
*---------------------------------------------------------------------------*/
-#include <stdio.h>
#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <machine/pcvt_ioctl.h>
#define DEFAULTFD 0
+void next __P((void));
+void usage __P((void));
+
+int
main(argc,argv)
int argc;
char *argv[];
int config = 0;
int dflag = 0;
int fd;
- char *device;
+ char *device = NULL;
while( (c = getopt(argc, argv, "vcd:")) != EOF)
{
fprintf(stderr,"BSD Version = %u\n", pcvtinfo.opsys);
fprintf(stderr,"PCVT_NSCREENS = %u\n", pcvtinfo.nscreens);
fprintf(stderr,"PCVT_SYSBEEPF = %u\n", pcvtinfo.sysbeepf);
- fprintf(stderr,"Compile options = 0x%08X\n", pcvtinfo.compile_opts);
+ fprintf(stderr,"Compile options = 0x%08X\n", (unsigned int)pcvtinfo.compile_opts);
}
+ exit(0);
}
+void
usage()
{
fprintf(stderr,"\nispcvt - verify current video driver is the pcvt-driver\n");
exit(5);
}
+void
next()
{
static int i = 0;
*
*---------------------------------------------------------------------------*/
+#include <fcntl.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <machine/pcvt_ioctl.h>
int xf = 0;
int sf = 0;
+void usage __P((void));
+void showtypeamatic __P((int));
+void listcurrent __P((int));
+void setrepeat __P((int, int));
+void settypeam __P((int, int, int));
+void remapkeys __P((int, char *));
+void set_lock __P((char keyflag[], int));
+void set_shift __P((char keyflag[], int));
+void set_char __P((char keyflag[], int));
+
/*---------------------------------------------------------------------------*
* main entry
*---------------------------------------------------------------------------*/
+int
main(argc, argv)
int argc;
char *argv[];
int rate = -1;
int delay = -1;
- char *map;
+ char *map = NULL;
int kbfd;
while((c = getopt(argc, argv, "Rd:lm:opr:st:x")) != EOF)
/*---------------------------------------------------------------------------*
* display usage info & exit
*---------------------------------------------------------------------------*/
+void
usage()
{
fprintf(stderr, "\nkcon: keyboard control and remapping utility for pcvt video driver\n");
/*---------------------------------------------------------------------------*
* convert control char in string to printable values
*---------------------------------------------------------------------------*/
-char *showcntrl(s)
+char *
+showcntrl(s)
u_char *s;
{
static char res_str[80];
/*---------------------------------------------------------------------------*
* list the current keyboard mapping
*---------------------------------------------------------------------------*/
+void
listcurrent(kbfd)
int kbfd;
{
/*---------------------------------------------------------------------------*
* show delay and rate values for keyboard
*---------------------------------------------------------------------------*/
+void
showtypeamatic(kbfd)
int kbfd;
{
/*---------------------------------------------------------------------------*
* set repeat feature on/off
*---------------------------------------------------------------------------*/
+void
setrepeat(kbfd, tf)
int kbfd;
int tf;
/*---------------------------------------------------------------------------*
* set delay and rate values for keyboard
*---------------------------------------------------------------------------*/
+void
settypeam(kbfd, delay, rate)
int kbfd;
int delay;
/*---------------------------------------------------------------------------*
* remap keyboard from keycap entry
*---------------------------------------------------------------------------*/
+void
remapkeys(kbfd, map)
int kbfd;
char *map;
/*---------------------------------------------------------------------------*
* care for lock keys
*---------------------------------------------------------------------------*/
+void
set_lock(keyflag, kbfd)
char keyflag[];
int kbfd;
{
- int i, j;
+ int i;
char cap[16];
struct kbd_ovlkey entry;
u_short typ;
} lock[] =
{
- "ca", KBD_CAPS,
- "sh", KBD_SHFTLOCK,
- "nl", KBD_NUMLOCK,
- "sc", KBD_SCROLL
+ { "ca", KBD_CAPS },
+ { "sh", KBD_SHFTLOCK },
+ { "nl", KBD_NUMLOCK },
+ { "sc", KBD_SCROLL }
};
/*---------------------------------------------------------------------------*
* care for shifting keys
*---------------------------------------------------------------------------*/
+void
set_shift(keyflag, kbfd)
char keyflag[];
int kbfd;
u_short typ;
} shift[] =
{
- 'm', KBD_META,
- 'l', KBD_ALTGR,
- 'h', KBD_SHIFT,
- 't', KBD_CTL
+ { 'm', KBD_META },
+ { 'l', KBD_ALTGR },
+ { 'h', KBD_SHIFT },
+ { 't', KBD_CTL }
};
for(i = 0; i < 4; i++)
/*---------------------------------------------------------------------------*
* care for normal keys
*---------------------------------------------------------------------------*/
+void
set_char(keyflag, kbfd)
char keyflag[];
int kbfd;
char *addr;
char ch;
} standard[] = {
- 0, 'D',
- &entry.unshift[0], 'K',
- &entry.shift[0], 'S',
- &entry.ctrl[0], 'C',
- &entry.altgr[0], 'A'
+ { 0, 'D' },
+ { &entry.unshift[0], 'K' },
+ { &entry.shift[0], 'S' },
+ { &entry.ctrl[0], 'C' },
+ { &entry.altgr[0], 'A' }
};
for(i = 1; i < KBDMAXKEYS; i++)
else
{
addr_str = standard[j].addr;
- if(new_str = kgetstr(cap, &addr_str))
+ if((new_str = kgetstr(cap, &addr_str)))
{
if(strlen(new_str) > KBDMAXOVLKEYSIZE)
{
*
*---------------------------------------------------------------------------*/
-#include <stdio.h>
#include <ctype.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
#include "keycap.h"
char *getenv();
-static FILE *pfp = NULL; /* keycap data base file pointer */
static char *tbuf;
static int hopcount; /* detect infinite loops in keycap, init 0 */
register char *c = cstr+n;
if (strncmp(id,cstr,n)==0 &&
- (*c==':' || *c=='|' || *c=='=' || *c=='#') || *c=='@')
+ (*c==':' || *c=='|' || *c=='=' || *c=='#' || *c=='@'))
return c;
return 0;
}
* Get an entry for keyboard name in buffer bp from the keycap file.
* Parse is very rudimentary, we just notice escaped newlines.
*---------------------------------------------------------------------------*/
-kgetent(bp, name)
+int kgetent(bp, name)
char *bp, *name;
{
register char *cp;
register int c;
register int i = 0, cnt = 0;
char ibuf[KEYCAP_BUFSIZ];
- char *cp2;
int tf;
tbuf = bp;
*
*---------------------------------------------------------------------------*/
-#include <stdio.h>
-#include <fcntl.h>
#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <machine/pcvt_ioctl.h>
static void printheader(void);
static void usage(void);
+int
main(int argc, char **argv)
{
extern int optind;
int scan_lines = -1;
int c;
int chr_set = -1;
- char *filename;
+ char *filename = NULL;
int fflag = -1;
int info = -1;
int dflag = 0;
- char *device;
+ char *device = NULL;
while( (c = getopt(argc, argv, "c:d:f:is:")) != EOF)
{
if(chr_height * 256 != sbp->st_size ||
chr_height < 8 || chr_height > 20) {
fprintf(stderr,
- "File is no valid font file, size = %d.\n",
- sbp->st_size);
+ "File is no valid font file, size = %ld.\n",
+ (long)sbp->st_size);
exit(1);
}
sbp->st_size)
{
fprintf(stderr,
- "error reading file %s, size = %d, read = %d, "
+ "error reading file %s, size = %ld, read = %d, "
"errno %d\n",
- argv[1], sbp->st_size, ret, errno);
+ argv[1], (long)sbp->st_size, ret, errno);
exit(1);
}
*
*---------------------------------------------------------------------------*/
-#include <stdio.h>
#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <machine/pcvt_ioctl.h>
#define DEFAULTFD 0
static void parsepopt(char *arg, unsigned *idx,
unsigned *r, unsigned *g, unsigned *b);
static void printpalette(int fd);
+void printinfo(int fd);
+void printadaptor(int fd);
+void printmonitor(int fd);
+void usage();
-main(argc,argv)
+int main(argc,argv)
int argc;
char *argv[];
{
exit(0);
}
-usage()
+void usage()
{
fprintf(stderr,"\nscon - screen control utility for the pcvt video driver\n");
fprintf(stderr,"usage: scon -a -l -m -v -c [n] -d [dev] -f [on|off] -V -H -s [n]\n");
exit(1);
}
-printadaptor(fd)
+void printadaptor(fd)
int fd;
{
if(ioctl(fd, VGAGETSCREEN, &screeninfo) == -1)
}
}
-printmonitor(fd)
+void printmonitor(fd)
int fd;
{
if(ioctl(fd, VGAGETSCREEN, &screeninfo) == -1)
return(vga_tab[number]);
}
-printinfo(fd)
+void printinfo(fd)
int fd;
{
if(ioctl(fd, VGAGETSCREEN, &screeninfo) == -1)
const char *cp;
printf("%5d %5d %5d %5d",
idx, palette[idx].r, palette[idx].g, palette[idx].b);
- if(cp = findname(idx))
+ if((cp = findname(idx)))
printf(" %s\n", cp);
else
putchar('\n');
*/
-#include <stdio.h>
#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
/*
* The default toupper() macro is stupid, will toupper anything
char *name ;
char *string ;
} keys[] = {
- "F6", "17",
- "F7", "18",
- "F8", "19",
- "F9", "20",
- "F10", "21",
- "F11", "23",
- "ESC", "23",
- "F12", "24",
- "BS", "24",
- "F13", "25",
- "LF", "25",
- "F14", "26",
- "HELP", "28",
- "DO", "29",
- "F17", "31",
- "F18", "32",
- "F19", "33",
- "F20", "34",
- NULL, NULL
+ { "F6", "17" },
+ { "F7", "18" },
+ { "F8", "19" },
+ { "F9", "20" },
+ { "F10", "21" },
+ { "F11", "23" },
+ { "ESC", "23" },
+ { "F12", "24" },
+ { "BS", "24" },
+ { "F13", "25" },
+ { "LF", "25" },
+ { "F14", "26" },
+ { "HELP", "28" },
+ { "DO", "29" },
+ { "F17", "31" },
+ { "F18", "32" },
+ { "F19", "33" },
+ { "F20", "34" },
+ { NULL, NULL }
};
char prog[BUFSIZ];
-main(argc,argv)
+void usage __P((void));
+void clearkeys __P((void));
+void getinit __P((void));
+void dokey __P((char *, char *));
+void lockkeys __P((void));
+
+int main(argc,argv)
int argc;
char *argv[];
{
* for each pair, who cares, really.
*/
-dokey(nm,val) char *nm, *val;
+void dokey(nm,val) char *nm, *val;
{
register char *scr;
register struct keynames *kp;
- for(scr = nm; *scr = toupper(*scr); scr++)
+ for(scr = nm; (*scr = toupper(*scr)); scr++)
;
for(kp = keys; kp->name != NULL; kp++)
if(strcmp(nm,kp->name) == 0) {
/****************************************************************************/
-clearkeys()
+void clearkeys()
{
printf("%cP0;1|%c\\",ESC,ESC);
fflush(stdout);
/****************************************************************************/
-lockkeys()
+void lockkeys()
{
printf("%cP1;0|%c\\",ESC,ESC);
fflush(stdout);
/****************************************************************************/
-usage()
+void usage()
{
int i;
#include <sys/types.h>
#include <sys/stat.h>
-getinit()
+void getinit()
{
char *home; /* user's home directory */
char path[BUFSIZ]; /* full path name of init file */