Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the use of UPP and compiled libraries



On Thursday, May 29, 2003, at 10:03 PM, Jim Mooney wrote:

static library becomes part of your
executable code.<<<<

This is the part I am wondering about. Not to get into linkers and the compiler.....but in general terms...... If I were to add a few Quicktime function calls..... I assume during compilation some data types and executables functions will be read from the static library (Quicktime) and added to my standalone code. The additional functions not used or called but are included in the declaration of Quicktime.h are not going to added?

Ummm, sure, close enough. Most linkers have the option to remove "dead" code - code
that cannot be called by anything. The typically includes code from static libraries.

But, to confuse things a bit, system services like Quicktime are often shared between
more than one program, so what your program has is a link to routines somewhere else.
My rule is to ignore all that stuff as much as possible.

On the function in a function, I picked up an old C book and there were 3 buried pages that covered it. The passing of parameters and going through the code is a bit mind twisting. There is one issue I am working on and that is "when" the function passed get's executed.............. presidence of execution... will run test.....

It's really pretty simple.

You have a pointer. When you use it like this...

(*funcPtr)(i);

Then the compiler generates code to put the parameter on the stack and jump
to the address you've specified. That's all it is.

And since the C language treats all function names as pointers, you can also
write the above as
funcPtr(i);

----
Ray Fischer
Adobe Systems
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: the use of UPP and compiled libraries (From: Jim Mooney <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.