plugin primitive with 32 bit parameters, how?

Ragnar Hojland Espinosa ragnar at linalco.com
Thu Sep 25 16:07:49 UTC 2003


I'm attempting to build an ncurses plugin (along with a rough guide on
the swiki) and I'm suck.

Prototype of the function is:

	  int echochar (unsigned long char);

and this is what I have


primitiveCursesEchoChar: aChar 
        | result |
	  
        self var: #result declareC: 'int result'.
        self primitive: 
		'primitiveCursesEchoChar' 
		parameters: #(SmallInteger).
        self cCode: 
		'result = ncurses_echochar (aChar)' 
		inSmalltalk: [result _ nil].
        ^ result asOop: Boolean.

does that mean the parameter passed to ncurses_echochar will be only
SmallInteger long?  If so, is there a way to pass a 32 bit value other
than getting aChar as a LongInteger and then copying the bytes?

-- 
Ragnar Hojland - Project Manager
Linalco "Specialists in Linux and Free Software"
http://www.linalco.com Tel: +34-91-5970074 Fax: +34-91-5970083



More information about the Squeak-dev mailing list