From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6e016ae58737f34 X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: win32ada design question/problem Date: 1998/11/16 Message-ID: #1/1 X-Deja-AN: 412471639 References: <364C5EDE.4F402D13@elca-matrix.ch> <72i3r9$o1r$1@nnrp1.dejanews.com> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Newsgroups: comp.lang.ada Date: 1998-11-16T00:00:00+00:00 List-Id: dennison@telepath.com writes: > In article <364C5EDE.4F402D13@elca-matrix.ch>, > Mats.Weber@elca-matrix.ch wrote: > > I just had a look at the win32ada binding and found that I could not use > > it as I would like. Lets take this function as an example: > > > > > function WriteFile(hFile : Win32.Winnt.HANDLE; > > > lpBuffer : Win32.LPCVOID; > > > nNumberOfBytesToWrite : Win32.DWORD; > > > lpNumberOfBytesWritten: Win32.LPDWORD; > > > lpOverlapped : Win32.Winbase.LPOVERLAPPED) > > > return Win32.BOOL; > (snip) > > Of course I can use 'Unchecked_Access to circumvent this, but then I > > don't think that the binding is well designed if it requires > > 'Unchecked_Access all over the place in code that uses it. > > It wasn't designed at all. (by Ada folk, anway) Its a *thin* binding. If you > want something that doesn't require unchecked programming to use, then you > want a thick binding. While I agree it wasn't well designed, I don't agree you need to go to a thick binding. The binding should use 'out' parameter modes in the places where C uses pointers to achieve output parameters. Most compilers will map an 'out' parameter to a C pointer, since that's what 'by reference' means. -- Stephe