Re: [BLACKBOX] structured return types

From: [at]} <Chris>
Date: Fri, 3 Jul 2009 15:55:48 +0930

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

>-----Original Message-----
>From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
>Sent: Friday, 3 July 2009 4:11 AM
>To: BLACKBOX{([at]})nowhere.xy
>Subject: Re: [BLACKBOX] structured return types - was:
>BlackBox 1.6 final version? - Complex numbers
>
>the missing "structured" return types (even in interface
>modules) turn the task of creating interface modules to
>foreign DLLs (e.g. GSL, see http://www.gnu.org/software/gsl/ and/or
>http://www.gnu.org/software/gsl/manual/html_node/) very difficult.
>
>GSL returns complex numbers on the stack, I am still searching
>for a solution in the interface module for GSL. One solution I
>have been thinking of, would be some code procedure, which
>takes as argument an allocated pointer to complex and pops the
>values which are left by the foreign function into these
>addresses, but I did not find the time to dig into assembler
>and test this idea.
>
>Structured return values would solve that.
>

I don't think the following suggestion will be much help to you in this case
but hopefully it might help to trigger some other ideas:

If there were only a couple of functions involved a simple workaround would
be to write a wrapper in C that took the returned value and passed it back
via a parameter. You could then call the wrapper function from Component
Pascal. e.g something like: (pretend the following is all coded in C)

PROCEDURE Xyz(): SomeStructuredType;
BEGIN
...
END Xyz;

PROCEDURE XyzWrapper(VAR result: SomeStructuredType);
BEGIN
  result := Xyz()
END XyzWrapper;

Regards,
Chris Burrows

CFB Software
Armaide v2.0: ARM Oberon-07 Development System
http://www.cfbsoftware.com/armaide


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1304812229_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaG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WxkIHRoZW4gY2FsbCB0aGUgd3JhcHBlciBmdW5j
dGlvbiBmcm9tIENvbXBvbmVudFxwYXINClBhc2NhbC4gZS5nIHNvbWV0aGluZyBsaWtlOiAocHJl
dGVuZCB0aGUgZm9sbG93aW5nIGlzIGFsbCBjb2RlZCBpbiBDKVxwYXINClxwYXINClBST0NFRFVS
RSBYeXooKTogU29tZVN0cnVjdHVyZWRUeXBlO1xwYXINCkJFR0lOXHBhcg0KLi4uXHBhcg0KRU5E
IFh5ejtccGFyDQpccGFyDQpQUk9DRURVUkUgWHl6V3JhcHBlcihWQVIgcmVzdWx0OiBTb21lU3Ry
dWN0dXJlZFR5cGUpO1xwYXINCkJFR0lOXHBhcg0KICByZXN1bHQgOj0gWHl6KClccGFyDQpFTkQg
WHl6V3JhcHBlcjtccGFyDQpccGFyDQpSZWdhcmRzLFxwYXINCkNocmlzIEJ1cnJvd3NccGFyDQpc
cGFyDQpDRkIgU29mdHdhcmVccGFyDQpBcm1haWRlIHYyLjA6IEFSTSBPYmVyb24tMDcgRGV2ZWxv
cG1lbnQgU3lzdGVtXHBhcg0KaHR0cDovL3d3dy5jZmJzb2Z0d2FyZS5jb20vYXJtYWlkZVxwYXIN
ClxwYXINClxwYXINCi0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwgc2VuZCBhIG1lc3NhZ2Ugd2l0
aCBib2R5ICJTSUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST04uQ0hcfX0A
VG86
----boundary-LibPST-iamunique-1304812229_-_---
Received on Fri Jul 03 2009 - 08:25:48 UTC

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