[comp.sys.amiga.tech] A Manx question

warren@hpindda.HP.COM (Warren Burnett) (11/17/89)

Hi there.  I am having a problem wint Manx 3.6a that I hope someone can help
me with.  I am trying to process RAWKEY events through the console.device
routine RawKeyConvert().  To do this, the docs say that I need to declare

	struct Device *ConsoleDevice;

and initialize it from a field in the structure returned by OpenDevice().
That is fine; I have no problems doing that.  I am also including the file
functions.h so that I don't have to cast all of the OS routine return 
values.  My problem is that in functions.h there is the following declaration:

	long	ConsoleDevice();

Does anyone know what this is?  I cannot find any reference to this routine
in any documentation that I have (Amiga OS or Manx) or in any of the Manx
libraries.  For now, I have made my own copy of functions.h with the above
line commented out.  Is there a reason for this declaration?  Thanks.

		Warren Burnett
		warren@hpindip%hp-sde.sde.hp.com

acs@pccuts.pcc.amdahl.com (Tony Sumrall) (11/22/89)

In article <7450001@hpindda.HP.COM> warren@hpindda.HP.COM (Warren Burnett) writes:
}Hi there.  I am having a problem wint Manx 3.6a that I hope someone can help
}me with.  I am trying to process RAWKEY events through the console.device
}routine RawKeyConvert().  To do this, the docs say that I need to declare
}
}	struct Device *ConsoleDevice;
}
}and initialize it from a field in the structure returned by OpenDevice().
}That is fine; I have no problems doing that.

Good, the docs are correct.

}                                              I am also including the file
}functions.h so that I don't have to cast all of the OS routine return 
}values.  My problem is that in functions.h there is the following declaration:
}
}	long	ConsoleDevice();
}
}Does anyone know what this is?

Yeah, it's an error -- functions.h is messed up here.  I ran across this
bug while working on an old version of VT100.  I simply commented the
definition out of functions.h and define it in my source modules in the
manner that the docs suggest.

}                                I cannot find any reference to this routine
}in any documentation that I have (Amiga OS or Manx) or in any of the Manx
}libraries.

You need it if you're gonna call, e.g., RawKeyConvert().  You initialize
it like so:

    struct IOStdReq ConReq;
    struct Device *ConsoleDevice;
	.
	.
	.
    if(OpenDevice("console.device", -1L, &ConReq, 0L))
	cleanup("can't open console", 4);
    ConsoleDevice = ConReq.io_Device;

}		Warren Burnett
}		warren@hpindip%hp-sde.sde.hp.com
---
Tony Sumrall   author of VT100 2.9 (and 2.8a and 2.8 and...)
acs@pccuts.pcc.amdahl.com <=> amdahl!pccuts!acs

[ Opinions expressed herein are the author's and should not be construed
  to reflect the views of Amdahl Corp. ]

phorgan@cup.portal.com (Patrick John Horgan) (11/24/89)

>values.  My problem is that in functions.h there is the following declaration:
>
>	long	ConsoleDevice();

This is an error...just comment it out, (or delete it) and you'll be fine.

warren@hpindda.HP.COM (Warren Burnett) (11/28/89)

Thanks to everyone who responded to my question.  I did what was suggested
and commented out the line in functions.h.

		Warren Burnett
		warren%hpindip@hp-sde.sde.hp.com