Mac::Memory, Mac::Carbon
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:
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. :-)
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'In MacPerl on Classic, to look up the error:
abc
-116
Can't call method "size" on an undefined value at -e line 1.
print $^E = -116So 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.
Size check failed (OS error -116)
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
Again, this is all subject to change.
Leave a comment