On Apr 14, 2007, at 12:00 PM, Charles Yeomans wrote:

> On Apr 14, 2007, at 2:24 PM, Tim Jones wrote:
>
>> Anyone experiencing declare issues on Linux?  Is this a bug (the LibC
>> soft declare), or am I missing something?
>
> You're missing something.  Is there is a file called "libc"
> somewhere?  On my Ubuntu installation, the closest thing I can find
> is /usr/lib/libc.so, which is a loader script that refers to /lib/
> libc.so.6.  I think I explain this sort of stuff in my book on
> declares on my web site.

I understood that "LibC" is supposed to be the "generic" soft libc  
for all platforms so that you don't need to specifically define a  
libc path or version.  I've assigned a target-specific myLibC to  
point to "/usr/lib/libc.so" on Linux and "/usr/libc/libc.dylib" on  
Mac and changed that to use:

        Soft Declare Function pipe Lib myLibC (ByRef fd As Ptr) As Integer

And the function is now found.

> Also, you don't want to declare the parameter as ByRef.  The C
> prototype of pipe is the following.
>
> int pipe (int filedes[2])
>
> A C array is a nothing more than a block of memory, and an array
> variable is essentially a pointer to that block.  So you want to
> create a MemoryBlock of size 8 = 2*sizeOf(int), and pass a pointer to
> it to pipe.  Thus you declare the parameter in REALbasic to be of
> type Ptr.  Declaring it as ByRef should mean that you're passing a
> pointer to the address of the MemoryBlock.

I understand that, but I need to modify the contents of that  
memoryblock.  The filedes array contains the file descriptor values  
of the two pipes that are created by the call to pipe.  I understood  
that to modify the passed variable, you have to pass the pointer By  
Reference rather than by value (plus, this is working as expected).

Tim
--
Tim Jones
[EMAIL PROTECTED]



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to