[M3devel] Constant to Constant?

Coleburn, Randy rcolebur at SCIRES.COM
Fri Mar 12 02:46:13 CET 2010


Chris:

You may also want to look at pkg\m3core\src\win32\WinUser.i3

Regards,
Randy

-----Original Message-----
From: Chris [mailto:Highjinks at gmx.com]
Sent: Thursday, March 11, 2010 7:35 PM
To: m3devel at elegosoft.com
Subject: [M3devel] Constant to Constant?


Things are progressing here, slowly but steadily.

I'm curious...

When writing an interface for something like this ...

/* C Type */
const C_Foo_t  *Bar = get_foo_data(misc);

Is it better to do it this way...

<* EXTERNAL get_foo_data:C *>
TYPE Foo_Data = PROCEDURE(get_foo_data(somemisc : misctype) : C_Foo_t;

Or should I just do...
UNSAFE INTERFACE Foo;

(* Translating the C typedef struct over to Modula3 code. *)
TYPE C_Foo_T = UNTRACED REF RECORD .... END;

<* EXTERNAL get_foo_data:C *>
PROCEDURE get_foo_data(somemisc : misctype) : C_foo_t;
END Foo.

Main.m3
IMPORT Foo;
Foo_Data := Foo.get_foo_data(Misc);
END Main.

C_Foo_t is known, and has a Modula 3 representation in the Interface. But as the C Code shows, it has to be a constant value.

What's the best way to do this without hosing the Interface for everyone else that might want to use it? Variable expressions are no problem, it's making it a constant that's giving me trouble. It's constant because the data structure is managed by the supporting library, not by the Modula3 Code.

Tips...pointers?

--
Chris <Highjinks at gmx.com>

CONFIDENTIALITY NOTICE:  This email and any attachments are intended solely for the use of the named recipient(s).  This email may contain confidential and/or proprietary information of Scientific Research Corporation.  If you are not a named recipient, you are prohibited from reviewing, copying, using, disclosing or distributing to others the information in this email and attachments.  If you believe you have received this email in error, please notify the sender immediately and permanently delete the email, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the email or attachments.

EXPORT COMPLIANCE NOTICE:  This email and any attachments may contain technical data subject to U.S export restrictions under the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR).  Export or transfer of this technical data and/or related information to any foreign person(s) or entity(ies), either within the U.S. or outside of the U.S., may require advance export authorization by the appropriate U.S. Government agency prior to export or transfer.  In addition, technical data may not be exported or transferred to certain countries or specified designated nationals identified by U.S. embargo controls without prior export authorization.  By accepting this email and any attachments, all recipients confirm that they understand and will comply with all applicable ITAR, EAR and embargo compliance requirements.



More information about the M3devel mailing list