This commit is contained in:
augustss 2001-10-13 16:05:42 +00:00
parent 04b1440239
commit b079ab789b
3 changed files with 37 additions and 66 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsfont.c,v 1.21 2001/09/03 17:04:11 drochner Exp $ */
/* $NetBSD: wsfont.c,v 1.22 2001/10/13 16:05:42 augustss Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wsfont.c,v 1.21 2001/09/03 17:04:11 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: wsfont.c,v 1.22 2001/10/13 16:05:42 augustss Exp $");
#include "opt_wsfont.h"
@ -187,16 +187,15 @@ static const u_char reverse[256] = {
0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff,
};
static struct font *wsfont_find0 __P((int));
static void wsfont_revbit __P((struct wsdisplay_font *));
static void wsfont_revbyte __P((struct wsdisplay_font *));
static struct font *wsfont_find0(int);
static void wsfont_revbit(struct wsdisplay_font *);
static void wsfont_revbyte(struct wsdisplay_font *);
/*
* Reverse the bit order of a font
*/
static void
wsfont_revbit(font)
struct wsdisplay_font *font;
wsfont_revbit(struct wsdisplay_font *font)
{
u_char *p, *m;
@ -211,8 +210,7 @@ wsfont_revbit(font)
* Reverse the byte order of a font
*/
static void
wsfont_revbyte(font)
struct wsdisplay_font *font;
wsfont_revbyte(struct wsdisplay_font *font)
{
int x, l, r, nr;
u_char *rp;
@ -242,8 +240,7 @@ wsfont_revbyte(font)
* Enumarate the list of fonts
*/
void
wsfont_enum(cb)
void (*cb) __P((char *, int, int, int));
wsfont_enum(void (*cb)(char *, int, int, int))
{
struct wsdisplay_font *f;
struct font *ent;
@ -282,8 +279,7 @@ wsfont_init(void)
* Find a font by cookie. Called at splhigh.
*/
static struct font *
wsfont_find0(cookie)
int cookie;
wsfont_find0(int cookie)
{
struct font *ent;
@ -295,10 +291,8 @@ wsfont_find0(cookie)
}
int
wsfont_matches(font, name, width, height, stride)
struct wsdisplay_font *font;
char *name;
int width, height, stride;
wsfont_matches(struct wsdisplay_font *font, char *name,
int width, int height, int stride)
{
if (height != 0 && font->fontheight != height)
@ -320,9 +314,7 @@ wsfont_matches(font, name, width, height, stride)
* Find a font.
*/
int
wsfont_find(name, width, height, stride)
char *name;
int width, height, stride;
wsfont_find(char *name, int width, int height, int stride)
{
struct font *ent;
int s;
@ -344,9 +336,7 @@ wsfont_find(name, width, height, stride)
* Add a font to the list.
*/
int
wsfont_add(font, copy)
struct wsdisplay_font *font;
int copy;
wsfont_add(struct wsdisplay_font *font, int copy)
{
static int cookiegen = 666;
struct font *ent;
@ -398,8 +388,7 @@ wsfont_add(font, copy)
* Remove a font.
*/
int
wsfont_remove(cookie)
int cookie;
wsfont_remove(int cookie)
{
struct font *ent;
int s;
@ -443,10 +432,8 @@ wsfont_remove(cookie)
* requested by the caller differs.
*/
int
wsfont_lock(cookie, ptr, bitorder, byteorder)
int cookie;
struct wsdisplay_font **ptr;
int bitorder, byteorder;
wsfont_lock(int cookie, struct wsdisplay_font **ptr,
int bitorder, int byteorder)
{
struct font *ent;
int s, lc;
@ -485,8 +472,7 @@ wsfont_lock(cookie, ptr, bitorder, byteorder)
* Get font flags and lockcount.
*/
int
wsfont_getflg(cookie, flg, lc)
int cookie, *flg, *lc;
wsfont_getflg(int cookie, int *flg, int *lc)
{
struct font *ent;
int s;
@ -506,8 +492,7 @@ wsfont_getflg(cookie, flg, lc)
* Unlock a given font and return new lockcount.
*/
int
wsfont_unlock(cookie)
int cookie;
wsfont_unlock(int cookie)
{
struct font *ent;
int s, lc;
@ -706,9 +691,7 @@ static struct wsfont_level1_glyphmap encodings[] = {
* Remap Unicode character to glyph
*/
int
wsfont_map_unichar(font, c)
struct wsdisplay_font *font;
int c;
wsfont_map_unichar(struct wsdisplay_font *font, int c)
{
if (font->encoding == WSDISPLAY_FONTENC_ISO) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsfont.h,v 1.14 2001/09/03 17:04:11 drochner Exp $ */
/* $NetBSD: wsfont.h,v 1.15 2001/10/13 16:05:42 augustss Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -72,17 +72,17 @@ struct wsdisplay_font;
#define WSFONT_RDONLY (0x04)
/* wsfont.c */
void wsfont_init __P((void));
int wsfont_matches __P((struct wsdisplay_font *, char *, int, int, int));
int wsfont_find __P((char *, int, int, int));
int wsfont_add __P((struct wsdisplay_font *, int));
int wsfont_remove __P((int));
void wsfont_enum __P((void (*) __P((char *, int, int, int))));
int wsfont_lock __P((int, struct wsdisplay_font **, int, int));
int wsfont_unlock __P((int));
int wsfont_getflg __P((int, int *, int *));
int wsfont_map_unichar __P((struct wsdisplay_font *, int));
int wsfont_add __P((struct wsdisplay_font *, int));
int wsfont_remove __P((int));
void wsfont_init(void);
int wsfont_matches(struct wsdisplay_font *, char *, int, int, int);
int wsfont_find(char *, int, int, int);
int wsfont_add(struct wsdisplay_font *, int);
int wsfont_remove(int);
void wsfont_enum(void (*)(char *, int, int, int));
int wsfont_lock(int, struct wsdisplay_font **, int, int);
int wsfont_unlock(int);
int wsfont_getflg(int, int *, int *);
int wsfont_map_unichar(struct wsdisplay_font *, int);
int wsfont_add(struct wsdisplay_font *, int);
int wsfont_remove(int);
#endif /* !_WSFONT_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsfontdev.c,v 1.1 2001/09/03 17:05:20 drochner Exp $ */
/* $NetBSD: wsfontdev.c,v 1.2 2001/10/13 16:05:42 augustss Exp $ */
/*
* Copyright (c) 2001
@ -41,18 +41,14 @@ cdev_decl(wsfont);
static int wsfont_isopen;
void
wsfontattach(n)
int n;
wsfontattach(int n)
{
wsfont_init();
}
int
wsfontopen(dev, flag, mode, p)
dev_t dev;
int flag, mode;
struct proc *p;
wsfontopen(dev_t dev, int flag, int mode, struct proc *p)
{
if (wsfont_isopen)
@ -62,10 +58,7 @@ wsfontopen(dev, flag, mode, p)
}
int
wsfontclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
struct proc *p;
wsfontclose(dev_t dev, int flag, int mode, struct proc *p)
{
wsfont_isopen = 0;
@ -73,12 +66,7 @@ wsfontclose(dev, flag, mode, p)
}
int
wsfontioctl(dev, cmd, data, flag, p)
dev_t dev;
u_long cmd;
caddr_t data;
int flag;
struct proc *p;
wsfontioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
char nbuf[16];
void *buf;