void InitOutput(pScreenInfo, argc, argv) ScreenInfo 	  *pScreenInfo; int     	  argc; char    	  **argv; { int     	i, scr; int		nonBlockConsole = 0; char	**devList; static int	setup_on_exit = 0; extern Bool	RunFromSmartParent;  if (!monitorResolution) monitorResolution = 90; if (RunFromSmartParent) nonBlockConsole = 1; for (i = 1; i < argc; i++) { if (!strcmp(argv[i],"-debug")) nonBlockConsole = 0; }  pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER; pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;  pScreenInfo->numPixmapFormats = NUMFORMATS; for (i=0; i< NUMFORMATS; i++) pScreenInfo->formats[i] = formats[i]; #if 0
InitKbdMouse(void){    static int inited;    int i;    if (inited)        return;    inited = 1;    if (decKbdDev == NULL)        decKbdDev = "/dev/wskbd0";    if (decPtrDev == NULL) {       decPtrDev = "/dev/wsmouse0";    /* warn(3) isn't X11 API, but we know we are on NetBSD */    if((decKbdPriv.fd = open (decKbdDev, O_RDWR, 0)) == -1)	warn("Keyboard device %s", decKbdDev);    else if((decPtrPriv.fd = open (decPtrDev, O_RDWR, 0)) == -1)	warn("Pointer device %s", decPtrDev);    (void) ioctl (decKbdPriv.fd, WSKBDIO_GTYPE, &decKbdPriv.type);}/*- *----------------------------------------------------------------------- * InitOutput -- *	Initialize screenInfo for all actually accessible framebuffers. *	The * * Results: *	screenInfo init proc field set * * Side Effects: *	None * *----------------------------------------------------------------------- */void InitOutput(pScreenInfo, argc, argv)    ScreenInfo 	  *pScreenInfo;    int     	  argc;    char    	  **argv;{    int     	i, scr;    int		nonBlockConsole = 0;    char	**devList;    static int	setup_on_exit = 0;    extern Bool	RunFromSmartParent;    if (!monitorResolution)	monitorResolution = 90;    if (RunFromSmartParent)	nonBlockConsole = 1;    for (i = 1; i < argc; i++) {	if (!strcmp(argv[i],"-debug"))	    nonBlockConsole = 0;    }    pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;    pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;    pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;    pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;    pScreenInfo->numPixmapFormats = NUMFORMATS;    for (i=0; i< NUMFORMATS; i++)        pScreenInfo->formats[i] = formats[i];#if 0 /* XXX */#ifdef XKB    if (noXkbExtension)#endif    sunAutoRepeatHandlersInstalled = FALSE;#endif    if (!decDevsInited) {	/* first time ever */	for (scr = 0; scr < MAXSCREENS; scr++)	    decFbs[scr].fd = -1;	devList = GetDeviceList (argc, argv);	for (i = 0, scr = 0; devList[i] != NULL && scr < MAXSCREENS; i++)	    if (OpenFrameBuffer (devList[i], scr))		scr++;	decDevsInited = TRUE;	xfree (devList);    }    for (scr = 0; scr < MAXSCREENS; scr++)	if (decFbs[scr].fd != -1) {	    ErrorF("XdecNetBSD: screen %d: %s, %dx%d\n", scr,	        decFbs[scr].fbData->name, decFbs[scr].width,	        decFbs[scr].height);	    (void) AddScreen (decFbs[scr].fbData->init, argc, argv);	}    (void) OsSignal(SIGWINCH, SIG_IGN);}/*- *----------------------------------------------------------------------- * InitInput -- *	Initialize all supported input devices...what else is there *	besides pointer and keyboard? * * Results: *	None. * * Side Effects: *	Two DeviceRec's are allocated and registered as the system pointer *	and keyboard devices. * *----------------------------------------------------------------------- */void InitInput(argc, argv)    int     	  argc;    char    	  **argv;{    DeviceIntPtr	p, k;    extern Bool mieqInit();    InitKbdMouse();    p = AddInputDevice(decMouseProc, TRUE);    k = AddInputDevice(decKbdProc, TRUE);    if (!p || !k)	FatalError("failed to create input devices in InitInput");    RegisterPointerDevice(p);    RegisterKeyboardDevice(k);    miRegisterPointerDevice(screenInfo.screens[0], p);    (void) mieqInit (k, p);#define SET_FLOW(fd) fcntl(fd, F_SETFL, FNDELAY | FASYNC)    (void) OsSignal(SIGIO, SigIOHandler);#define WANT_SIGNALS(fd) fcntl(fd, F_SETOWN, getpid())    if (decKbdPriv.fd >= 0) {	if (SET_FLOW(decKbdPriv.fd) == -1 || WANT_SIGNALS(decKbdPriv.fd) == -1) {		    (void) close (decKbdPriv.fd);	    decKbdPriv.fd = -1;	    FatalError("Async kbd I/O failed in InitInput");	}    }    if (decPtrPriv.fd >= 0) {	if (SET_FLOW(decPtrPriv.fd) == -1 || WANT_SIGNALS(decPtrPriv.fd) == -1) {	#if 0	    (void) close (decPtrPriv.fd);	    decPtrPriv.fd = -1;	    FatalError("Async mouse I/O failed in InitInput");#endif	    ErrorF("Async mouse I/O failed in InitInput");	}    }}