Mac::Memory, Mac::Carbon

| | Comments (0)
Warning: everything here is subject to change. I am just picking names and moving code around arbitrarily, more as a proof of concept.

In Mac OS X:

pudge% perl -Iblib/arch -Iblib/lib -MMac::Carbon -MMac::Memory -wle '$x = new Handle "abc"; print $x->get(0, -1); $y = new Handle ("x" x 2**30); print Mac::Carbon::Error(); print $y->size'
abc
-116
Can't call method "size" on an undefined value at -e line 1.

In MacPerl on Classic, to look up the error:

print $^E = -116
 
Size check failed (OS error -116)

So I got everything to compile and work. It'd be nice to have Error() be $^E, but that isn't likely for right now, as I believe it needs core support, and even then, I don't know if it would be feasible (are Carbon/Cocoa values compatible? how do you tell them apart, if not?). If they are the same, great, I can set $^E now via SETERRNO, and perhaps add the needed support later to get the text of the error message, and in the meantime supply a function to look up the text of the error message.

I am probably going to implement the missing C functions in Mac::Carbon (name, like everything else, subject to change), and require Mac::Carbon be loaded at the beginning of all other modules that need it. That'll work.

So the next step is to implement those missing GUSI functions and compile more extensions.

I'll need to redo most of this, though; I am modifying the generated C files, because MacPerl uses a custom xsubpp, and these .xs files won't currently work. Matthias at one point suggested a separate preprocessor, such as macxsubpp or somesuch, to generate the XS files. I think that might be the way to go.

Again, this is all subject to change. :-) use.perl.org

Leave a comment

<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Entry

This page contains a single entry by pudge published on August 1, 2002 3:10 PM.

Mac:: on Mac OS X was the previous entry in this site.

perl on Mac OS Slides is the next entry in this site.

Find recent content on the main index or look in the archives to find all content.