Subject: Fixing curses problems -- Was: How to get XaoS 3.0 to compile on NetBSD i386 1.3.1
To: 'Jan Hubicka' <>
From: John A. Maier - MIS dept. <>
List: netbsd-bugs
Date: 06/04/1998 11:16:21
I found that NetBSD's curses doesn't support several macros that other 
seemingly do.

To get Xaos ui_curses.c to compile I have to do this:

(change to ui_curses.c)
#include <ncurses.h>
#include <curses.h>
#inlcude "./curses.hack.h>

(Create a include file to work around the netbsd curses.h)
*** Filename: curses.hack.h                                   ***
*** Author:   John A. Maier                                   ***
*** Date:     06/04/1998 10:54am CST                          ***
*** Some curses do not have these definitions in the curses.c ***
*** In particular I ran into this under NetBSD 1.3.x and this ***
*** fixes it.                                                 ***

#ifndef   A_BOLD
#define   A_BOLD          000400000000L
#ifndef   A_NORMAL
#define   A_NORMAL        000000000000L
#ifndef   A_REVERSE
#define   A_REVERSE       000040000000L
#ifndef   A_DIM
#define   A_DIM           000200000000L
#ifndef   KEY_UP
#define   KEY_UP          0403   /* Sent by terminal up arrow key */
#ifndef   KEY_DOWN
#define   KEY_DOWN        0402   /* Sent by terminal down arrow key */
#ifndef   KEY_LEFT
#define   KEY_LEFT        0404   /* Sent by terminal left arrow key */
#ifndef   KEY_RIGHT
#define   KEY_RIGHT       0405   /* Sent by terminal right arrow key */

I found the problem with _maxx and _maxy errors they are not (by default) 
part of the __window structure in NetBSD's curses.h, so I had to add it!

typedef struct __window {		/* Window structure. */
	struct __window	*nextp, *orig;	/* Subwindows list and parent. */
	size_t begy, begx;		/* Window home. */
	size_t cury, curx;		/* Current x, y coordinates. */
	size_t maxy, maxx;		/* Maximum values for curx, cury. */
	size_t _maxy, _maxx;		/* max coordinates */ /* added to fix Xaos compile 
	short ch_off;			/* x offset for firstch/lastch. */
	__LINE **lines;			/* Array of pointers to the lines */
	__LINE  *lspace;		/* line space (for cleanup) */
	__LDATA *wspace;		/* window space (for cleanup) */

I know that mucking around in system include files it not recomended, but I 
don't know (remember) how to do this cleanly.

So these will have to be my work arounds!


From: 	Jan Hubicka[]
Sent: 	Thursday, June 04, 1998 2:37 AM
Subject: 	Re: XaoS 3.0 on NetBSD i386 1.3.1 Assembler messages (errors?)

> Okay I got it to compile
OK :)
> I had to put:
> /* Asembler disable for NetBSD i386 */
> #ifdef __NetBSD__
> #undef __i386__
> #endif

Hmm, so it was problems of my hacks... BTW there is some macro for 
assembly (I think it is ASSEMBLY). I will try to fix them...
> at the VERY begining of the files:
> /src/engine/i386.c
> /src/engin/formula.c
> src/ui/ui_helper.c
> Now I'm fighting with src/ui/ui-drv/curses/ui_curses.c but that will have 
> wait until Monday, I'm taking a few days off.

OK, let me know, whats wrong... curses.c is removed in the new version,
but I would like to know whats wrong, to avoid it in the other programs..

> Thanks for he help, I hope my personal HACKs work.
> **********************************************************************
> *       John A. Maier          * Director of MIS                     *
> * E-mail:    * Kemper Military School and College  *
> *                              * (660) 882-3760                      *
> **********************************************************************

                      OK. Lets make some signature file.
|        Jan Hubicka (Jan Hubi\v{c}ka in TeX)         |
|         Czech free software foundation:          |
| AA project - the new way for comupter graphics -|
|  homepage:, games koules, Xonix, fast  |
|  fractal zoomer XaoS, index of Czech GNU/Linux/UN*X documentation etc.  |