SDL-News: Problem with TYPE between C and SDL


Subject: SDL-News: Problem with TYPE between C and SDL
From: Alain Servais (alain.servais#lagrit.etsmtl.ca)
Date: Wed Jun 18 2003 - 16:40:13 GMT


Become an SDL Forum Society member <http://www.sdl-forum.org/Society/members.htm>
The originator of this message is responsible for its content.
-----From "Alain Servais" <alain.servais#lagrit.etsmtl.ca> to sdlnews -----

Hi SDL expert.

I'm using Telelogic Tau SDL 4.4.

I try to pass in argument to a C function the address memory of a buffer
declared in SDL. But, I have a problem with TYPE in SDL that I don't know
how to solve.

* A .PR file is generated by CPP2SDL with the following signature of the
GetDataNext function:

NEWTYPE global_namespace /*##NOTYPE*/
  OPERATORS
    GetDataNext : int, ptr_unsigned_char -> int;
ENDNEWTYPE global_namespace;EXTERNAL 'C';
NEWTYPE ptr_unsigned_char Ref( unsigned_char);
  OPERATORS
    ptr_unsigned_char : ->
    ptr_unsigned_char;/* implicit parameter-less constructor */
    ptr_unsigned_char : ptr_unsigned_char ->
    ptr_unsigned_char;/* implicit copy constructor */
ENDNEWTYPE ptr_unsigned_char;EXTERNAL 'C';

* I define in SDL, the following types:

SYNTYPE SizeDataBuff = Integer
  constants 0:216
ENDSYNTYPE;
NEWTYPE DataBuffType Array(SizeDataBuff,Octet)
ENDNEWTYPE;

* I try many things but the following operations seems to me correct:

DCL dataBuff DataBuffType;
DCL ptBuff ptr_unsigned_char;

task ptBuff := &<<TYPE Octet>>dataBuff;
task nDataLen := GetDataNext( 217, ptBuff );

* I got this error:

1: ERROR 372 No visible variable, formal parameter, synonym, literal or
operator with this name
ptBuff := & <<type Octet>> ? dataBuff

Do you have an idea or suggestions which could help me to solve my problem?

Thanks.
AS

---
email: alain.servais#lagrit.etsmtl.ca
       alain_servais_1#yahoo.ca
phone: (514) 842-1352
. ..   ...  ....     ... ..... .....
  |    _ \   __\  _ \_ _|_  _|    (__)
  |_  ___ | |_-     /  |   |   \\\'',)
 ___|_|  _|\___|_|\_\___| _| o   \/  \ ^
. .... .. .... ...   ..   ... .  .\._/_)
"Meeting requirements and walking on water
 are equally easy -- if both are frozen." adage

--End text from "Alain Servais" <alain.servais#lagrit.etsmtl.ca> to sdlnews --- For extra SDL Forum Society benefits join at <http://www.sdl-forum.org/Society/members.htm>



This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:49 GMT