[comp.sources.games.bugs] Missing functions in mdg program

chris@attron.ruhr.sub.org (Christian Schlichtherle) (02/27/91)

Hmm... Im running SCO Xenix/286 2.2.1 and had a little problem
compiling mdg. My library misses the following functions:

tigetstr()
curs_set()

I guess these functions are non-standard, are they?
They are used in gmain.c:

gmain.c:	curs_set(0);
gmain.c:	tputs(tigetstr("clear"), 1, eputc);
gmain.c:	tputs(tigetstr("clear"), 1, eputc);

I assumed curs_set(0) is used to home the cursor and tigetstr is the
same as tgetstr() but without an area pointer (the second argument to
tgetstr). So I coded two short functions to emulate these:


char	*tigetstr(id)
char	*id;
{
	static char	buf[20];
	char		*ptr = buf;

	tgetstr(id, &ptr);
	*ptr = '\0';

	return buf;
}


void	curs_set(dummy)
int	dummy;
{
	int	eputc();
	
	tputs(tgoto(tigetstr("cup"), 0, 0), 1, eputc);
}


Hope this works!

Currently "mdg" and "mdg_daemon" keep dying with:

     Connecting, please wait... sh: 872 Memory fault
you are unknown.

What the hell is the reason for this?

Chris
-- 
Snail: Christian Schlichtherle, Elbscheweg 20, 5802 Wetter 4, Germany
Email: chris@attron.ruhr.sub.org	Tel.: +49 2335 7550
"Der Tod ist ein Meister aus Deutschland" -- Paul Celan

root@attron.ruhr.sub.org (Christian Schlichtherle) (02/27/91)

Nope, the functions I used did not work. But these work:

char	*tigetstr(id)
char	*id;
{
	extern char	*tgetstr();
	static char	buf[20];
	char		*ptr = buf;

	return tgetstr(id, &ptr);
}

void	curs_set(dummy)
int	dummy;
{
	refresh();
	
	/* int	eputc();
	tputs(tgoto(tigetstr("cup"), 1, 1), 1, eputc); */
}

Can somebody tell me what the original functions should do?
Why are they missing?

For now, mdg seems to work...

Chris
-- 
Snail: Christian Schlichtherle, Elbscheweg 20, 5802 Wetter 4, Germany
Email: chris@attron.ruhr.sub.org	Tel.: +49 2335 7550
"Der Tod ist ein Meister aus Deutschland" -- Paul Celan

root@nas102.ttb.dec.com (System PRIVILEGED Account) (03/01/91)

Thanks for the functions curs_set and tigetstr but I still have one
undefined sybol left:

setupterm

Any help would be appreciated

Paul