Bob Ippolito wrote:

>In the implementation, you do this:
>
>#define MAX_CSTRING_PATH_SIZE 32768 /* Because 32KB should be enough for 
>anyone... */
>
>32KB is *way* oversized and could actually cause a problem because the default 
>stack size on Mac OS X is rather small.  The right way is to just use 
>MAXPATHLEN.  MAXPATHLEN is defined in <sys/param.h>, but you're already 
>including python.h -- which should guarantee that it is defined (even on 
>platforms that don't on their own).

Yeah, it's pretty goofy; didn't know what to make it so just stuck in something 
big for the meantime. Fixed. (BTW, needed to include <sys/param.h> for some 
reason; compiler wasn't finding it without.)


>You #include <MacPythonOSA.h> -- which should actually be #include 
>"MacPythonOSA.h" -- because it's not a system header.  Though obviously it 
>doesn't make a difference in this case.

Fixed. Much appreciated; my C is not exactly great, as you can tell. Project's 
re-uploaded.


>The style you use for C code is totally whack, especially the indentation.  It 
>would be a lot more readable if you wrote it in a standard style, the obvious 
>choice would be PEP 7 <http://python.org/peps/pep-0007.html>.

That's just me; really don't care for either PEP7 or C syntax in general. It 
can always get run through a pretty printer later on. Spite just makes it 
tolerable in the meantime.:)


>You should refactor this so that it doesn't link to Python.framework directly, 
>and instead loads up all of the symbols at runtime based upon a configurable 
>Python library.  The biggest reason for this is: if the process is already 
>linked to Python, and you link in a different one by virtue of this component 
>being loaded into the process (not even initialized), it could very well 
>crash.  The py2app plugin template doesn't currently look for an existing 
>linked interpreter, but it will at some point soon because I have to refactor 
>it anyway.  If you detect an interpreter other than the one you expected, it 
>should probably prevent the component from being initialized -- since you need 
>the aem extension to be present.

Good advice, though I'm not sufficiently up on C programming or OS internals to 
have a clue how to do it. Any pointers?

Many thanks,

has
-- 
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to