[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-Toolbox] Re: [MacPerl] IN, OUT, INOUT parameters



> For Brian's edification, I think it's worth adding that for functions
> of the form
>
> resultCode = func(in, out)
>
> which is essentially what WENew is like, where the "out" is a pointer, the
> obvious Perl equivalent is
>
> $out = func($in);
>
>where the "resultCode" gets subsumed into the output, by setting $out to
>zero on error. A pointer won't be zero and hence signals error. This
>assumes that the particular type of error is of no consequence. But if
>that is really needed too, then we can set a global error variable.

I'm admittedly no great shakes at C (I manage), but my understanding was that this was implicit in Matthias' example.  The clarification is helpful, though, as I'm sitting here, unsure if I actually "got" it (my lack of formal training showing through). :-)

Aside: Vicki Brown was asking if MPW perl works from ToolServer within BBEdit.  I ran Matthias' MakeToolboxModule from my Toolserver Worksheet in BBEdit, and can emphatically say YES, it does work.  Output follows:

'MyrmiDonna:Applications:Development_Tools:MacPerl Ÿ:MacPerl_Src:perl:ext:Mac:ExtUtils:MakeToolboxModule' WASTELib

# Looks ok, go ahead
Directory WASTELib
::::perl Makefile.PL
Open WASTE.pm
Open WASTE.xs
Open Makefile.PL
New typemap
::ExtUtils:ExtractCalls {MWCIncludes}WASTE.h
::ExtUtils:ExtractConstants {MWCIncludes}WASTE.h
::ExtUtils:ExtractFunctions WASTE.xs

Yee-Hah!

So now where I see:

{MWCIncludes}WASTE.h

I substitute:

'MyrmiDonna:Applications:Development_Tools:WASTE 1.3 Distribution:WASTE C/C++ Headers:WASTE.h'

YEEE-HAH!

except that when I run ExtractConstants, I get simply:

		WASTE_VERSION

sub WASTE_VERSION ()               { 0x01308000; }

I know there's more in there than that!  Is this all MacPerl needs?

and then Matthias say:

> Edit the files.

And this is the point where I am at this very moment.

--B


# Fungal Parataxonomy                   Mycology Information (Mycoinfo)
# Webmaster, Staff Writer      **The World's First Mycology E-Journal**   
# <mailto:webmaster@mycoinfo.com>            <http://www.mycoinfo.com/> 
#
# First they ignore you. Then they laugh at you. Then they fight you.
# Then you win.                                     --Mohandas Gandhi


==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org