RE: [BLACKBOX] structured return types

From: CFB Software <"CFB>
Date: Fri, 3 Jul 2009 17:37:22 +0930

----boundary-LibPST-iamunique-887666695_-_-
Content-type: text/plain

Hi Bernhard,

Either I'm not explaining myself well enough or I'm missing something? You
don't *need* to know how C handles it - you just need to use C to transform
it into a form that you *can* access from BlackBox.

1. Suppose you had a function in C e.g.

  void SomeFunction(gsl_complex z)

would you be then able to access that yourself using BlackBox?

2. If the answer to (1) is yes, then you could write a function

  void ComplexAdd(gsl_complex a, gsl_complex b, gsl_complex sum);
  {
    sum = gsl_complex_add (a, b);
  }

and then call that from BlackBox couldn't you?

P.S. I'm not happy that you've tricked me into writing some C code .... ;-)

--------------------------------------------------

"Information on the Oberon day 2009 will be announced here."

http://www.oberon.ethz.ch/news/index

I posted a message asking about Oberon Day 2009 on the ETH newsgroup. I also
sent a message to Ulrike Glavitsch if she knew when it was going to be but I
haven't had any replies yet. Ulrike had sent an invitation to the Embedded
Computing Conference 2009 in Winterthur that included three
Oberon/A2-related talks. We're past the June 12th date when the previous
Oberon Day was announced so I'm beginning to suspect that it is not going to
happen.

Regards,
Chris

Chris Burrows
CFB Software
http://www.cfbsoftware.com
 

>-----Original Message-----
>From: Treutwein Bernhard
>[mailto:Bernhard.Treutwein{([at]})nowhere.xy
>Sent: Friday, 3 July 2009 5:12 PM
>To: info{([at]})nowhere.xy
>Subject: RE: [BLACKBOX] structured return types
>
>Hi Chris,
>
>> It has to work otherwise you wouldn't be able to access structured
>> results in a C program either.
>
>but the calling C function knows that there are (e.g. for
>Complex as defined here:
>http://www.gnu.org/software/gsl/manual/html_node/Representation
>-of-complex-nu
>mbers.html)
>two doubles (i.e. 16 byte) left on the stack, so the caller
>can clean up the stack.
>
>For our case (interface module to CP for a library implemented
>in C, stdcall calling convention, see:
>http://en.wikipedia.org/wiki/X86_calling_conventions#stdcall)
>I have no idea, what is given back and where ...).
>
>[...]
>>
>> The more I think about it the more I uderstand the reluctance to
>> implement structured results ;-)
>
>hmm, that was the reason for saying: We need a long(er)
>testing phase and I would like to see two compiler ...
>
>>
>> How are you by the way?
>
>quite fine, if there would be more time for ideas & plans,
>which are pushed on the stack / laying on the heap, I'd feel
>even finer ...
>
>> I was hoping I might be able to catch up with you at another Oberon
>> Day this year but time is running out ...
>>
>>
>
>is there one?
>
>cheers
>--
> Bernhard
>


----boundary-LibPST-iamunique-887666695_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEhpIEJlcm5oYXJkLFxwYXINClxwYXINCkVpdGhl
ciBJJ20gbm90IGV4cGxhaW5pbmcgbXlzZWxmIHdlbGwgZW5vdWdoIG9yIEknbSBtaXNzaW5nIHNv
bWV0aGluZz8gWW91XHBhcg0KZG9uJ3QgKm5lZWQqIHRvIGtub3cgaG93IEMgaGFuZGxlcyBpdCAt
IHlvdSBqdXN0IG5lZWQgdG8gdXNlIEMgdG8gdHJhbnNmb3JtXHBhcg0KaXQgaW50byBhIGZvcm0g
dGhhdCB5b3UgKmNhbiogYWNjZXNzIGZyb20gQmxhY2tCb3guXHBhcg0KXHBhcg0KMS4gU3VwcG9z
ZSB5b3UgaGFkIGEgZnVuY3Rpb24gaW4gQyBlLmcuXHBhcg0KXHBhcg0KICB2b2lkIFNvbWVGdW5j
dGlvbihnc2xfY29tcGxleCB6KVxwYX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pbmc6IFdlIG5l
ZWQgYSBsb25nKGVyKSBccGFyDQo+dGVzdGluZyBwaGFzZSBhbmQgSSB3b3VsZCBsaWtlIHRvIHNl
ZSB0d28gY29tcGlsZXIgLi4uXHBhcg0KPlxwYXINCj4+IFxwYXINCj4+IEhvdyBhcmUgeW91IGJ5
IHRoZSB3YXk/IFxwYXINCj5ccGFyDQo+cXVpdGUgZmluZSwgaWYgdGhlcmUgd291bGQgYmUgbW9y
ZSB0aW1lIGZvciBpZGVhcyAmIHBsYW5zLCBccGFyDQo+d2hpY2ggYXJlIHB1c2hlZCBvbiB0aGUg
c3RhY2sgLyBsYXlpbmcgb24gdGhlIGhlYXAsIEknZCBmZWVsIFxwYXINCj5ldmVuIGZpbmVyIC4u
LlxwYXINCj5ccGFyDQo+PiBJIHdhcyBob3BpbmcgSSBtaWdodCBiZSBhYmxlIHRvIGNhdGNoIHVw
IHdpdGggeW91IGF0IGFub3RoZXIgT2Jlcm9uIFxwYXINCj4+IERheSB0aGlzIHllYXIgYnV0IHRp
bWUgaXMgcnVubmluZyBvdXQgLi4uXHBhcg0KPj4gXHBhcg0KPj4gXHBhcg0KPlxwYXINCj5pcyB0
aGVyZSBvbmU/XHBhcg0KPlxwYXINCj5jaGVlcnNccGFyDQo+LS1ccGFyDQo+ICBCZXJuaGFyZCBc
cGFyDQo+XHBhcg0KXHBhcg0KfQ==


----boundary-LibPST-iamunique-887666695_-_---
Received on Fri Jul 03 2009 - 10:07:22 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:46 UTC