<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Chris many of the X headers these days are generated from XML using Python.<BR>
  Seriously -- you need Python to build X these days.<BR>
You should look into adding a little to that system for Modula-3.<BR>
Cloning headers is tedious, therefore error-prone, therefore a recipe for bugs.<BR>
Please try to avoid it.<BR>
 <BR>
 <BR>
If you really can't go the XML route, there is also a fork of gcc<BR>
that is supposed to be adequate for header parsing, and spits out XML.<BR>
Look for "gccxml" or such. Maybe it is old/dead now?<BR>
 <BR>
 <BR>
There is also swig, which is a partial C compiler.<BR>
   Not a great idea to attempt.<BR>
   But it is there, you might try it.<BR>
 <BR>
I'd be far more interested in wrapping Qt than X though...<BR>
 <BR>
 - Jay<BR><BR> <BR>> Date: Wed, 3 Feb 2010 10:18:14 +0100<BR>> From: wagner@elegosoft.com<BR>> To: m3devel@elegosoft.com<BR>> Subject: Re: [M3devel] Shorthand type declarations?<BR>> <BR>> Quoting Chris <Highjinks@gmx.com>:<BR>> <BR>> > On Tue, 02 Feb 2010 21:37:33 -0600<BR>> > "Rodney M. Bates" <rodney_bates@lcwb.coop> wrote:<BR>> ><BR>> >> Unfortunately, this is the shortest you can get. I suppose the <BR>> >> language designers<BR>> >> thought that, while a whole lot of variables with the same type <BR>> >> were a likely<BR>> >> case:<BR>> >><BR>> >> VAR x, y, z, u, v, w, h, i, j, h, ... : INTEGER; ,<BR>> >><BR>> >> that more than just a few type names that are synonyms for the same <BR>> >> type would not be common.<BR>> >><BR>> >> You may think me certifiably masochist, but I go the more <BR>> >> longhanded way and write:<BR>> >><BR>> >> TYPE Window = unsigned_int;<BR>> >> TYPE Pixmap = unsigned_int;<BR>> >> TYPE Cursor = unsigned_int; ,<BR>> >><BR>> >> sacrificing writeability in favor of readability. (Yes, I repeat <BR>> >> VAR and CONST too,<BR>> >> almost every time.<BR>> ><BR>> > The reason I asked is because I'm doing the interface for <BR>> > /usr/include/xcb/xproto.h<BR>> ><BR>> > There are a lot of of typedefs in there that are defined as the same <BR>> > base type.<BR>> ><BR>> > I've shortened the Iterator types by using...<BR>> ><BR>> > TYPE T = UNTRACED ROOT OBJECT END;<BR>> > TYPE XCB_Iterator = T OBJECT<BR>> > Rem : INTEGER;<BR>> > Index : INTEGER<BR>> > END;<BR>> ><BR>> > TYPE XCBAtom = unsigned_int;<BR>> > TYPE Atom_Iterator = XCB_Iterator OBJECT<BR>> > Atom_Data : UNTRACED REF XCBAtom;<BR>> > END;<BR>> ><BR>> > But even this is gonna kill me. Heh. xproto.h is a HUGE file.<BR>> <BR>> What exactly is gained by defining all those aliases for unsigned_int?<BR>> In M3 all the types are structurally equivalent, so you can use a Cursor<BR>> where a Window would be required etc. It looks like a bit of facelifting<BR>> to me.<BR>> <BR>> And if it's only for readability and proper naming, all those should<BR>> surely be named <x>Handle, shouldn't they?<BR>> <BR>> The same level of abstraction could be achieved by defining just one<BR>> XProtoHandle as unsigned_int, couldn't it?<BR>> <BR>> I think I just have never understood the usefulness of interfaces<BR>> too large to remember, but that may be a general problem with X...<BR>> <BR>> Olaf<BR>> -- <BR>> Olaf Wagner -- elego Software Solutions GmbH<BR>> Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany<BR>> phone: +49 30 23 45 86 96 mobile: +49 177 2345 869 fax: +49 30 23 45 86 95<BR>> http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin<BR>> Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194<BR>> <BR>                                      </body>
</html>