[BLACKBOX] g_print interface

From: [at]} <Frank>
Date: Thu, 7 Apr 2011 16:54:25 -0300

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

Still struggling with interfaces. Now it is from
include\glib-2.0\glib\gmessages.h (of the gtk+-2.0 library):

   void g_print (const gchar *format, ...) G_GNUC_PRINTF (1, 2);

where gchar is 1 byte (I tested it with sizeof() and G_GNUC_PRINTF
leads into a macro jungle.

Not knowing how to handle the variable parameter list, I simply ignored
variability (has anyone a better idea?) and tried

----------------------------------------------------------------------
MODULE Glib ["libglib-2.0-0.dll"];
IMPORT SYSTEM;
PROCEDURE [ccall] print0* ["g_print"] (string:INTEGER);
END Glib.
---------------------------------------------------------------------

The test program is

---------------------------------------------------------------------
MODULE TestOut;
IMPORT SYSTEM, Glib;
VAR str: ARRAY [untagged] 32 OF SHORTCHAR;
BEGIN
   str:= "Hello, world!\n";
   Glib.print0 (SYSTEM.ADR(str));
END TestOut.
---------------------------------------------------------------------

I compiled and linked it with

DevCompiler.CompileThis TestOut
DevLinker.Link TestOut.exe := TestOut$

The execution in a Command prompt window (Windows XP) simply put out
nothing, no matter whether I used DevLinker.Link or DevLinker.LinkExe.

So,
  - What would be the interface of g_print?
  - When do I use DevLinker.Link and when DevLinker.LinkExe
    (in other words: when do I need the loader)?

-- 
Frank Hrebabetzky		+55 / 48 / 3235 1106
Florianopolis, Brazil
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-475908256_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZj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IG9mIGdfcHJpbnQ/XHBhcg0KICAtIFdoZW4gZG8gSSB1c2UgRGV2TGlua2VyLkxpbmsgYW5kIHdo
ZW4gRGV2TGlua2VyLkxpbmtFeGVccGFyDQogICAgKGluIG90aGVyIHdvcmRzOiB3aGVuIGRvIEkg
bmVlZCB0aGUgbG9hZGVyKT9ccGFyDQpccGFyDQotLSBccGFyDQpGcmFuayBIcmViYWJldHpreVx0
YWIgXHRhYiArNTUgLyA0OCAvIDMyMzUgMTEwNlxwYXINCkZsb3JpYW5vcG9saXMsIEJyYXppbFxw
YXINClxwYXINClxwYXINCi0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwgc2VuZCBhIG1lc3NhZ2Ug
d2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST04uQ0h9
fQB0dGVy
----boundary-LibPST-iamunique-475908256_-_---
Received on Thu Apr 07 2011 - 21:54:25 UTC

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