OS3.x FD files with #private functions

5 posts / 0 new
Last post
afxgroup
afxgroup's picture
Offline
Last seen: 5 months 1 week ago
Joined: 2011-02-03 15:26
OS3.x FD files with #private functions

Hello
I'm rewriting a library written for os3 and all seems ok but in the original fd file there are three functions within the #private clausole.
If i use fd2pragma that is needed to create my xml interface file those funcions are not included.
So, my question is. What are these #private functions? Are they always called using its base library?
I'm sure these are not like other static functions that are private and callable only within the library, since the program that use this library call them.
Can i safely add them to the #public part of the FD file?

hypex
hypex's picture
Offline
Last seen: 3 months 2 weeks ago
Joined: 2011-09-09 16:20
I hazard a guess that these

I hazard a guess that these "#private" functions are for use internally by the library but are called as part of the jump table. So they are still normal library functions but not used for public use. I note that graphics.library had a few private functions not intended for the casual programmer but for the OS.

Do you still need them? Yes. Because if the library calls a function that isn't in the table it either won't compile or in the worse case would crash as the function pointers are all out of order.

I wonder if you can somehow put in dummy entries for the public profile. Or if fd2pragma has any more options for dealing with this. Possibly the easiest would be to change them to be public, get it compiling and working, then in the public include files replace the private functions with dummy entries such as Private1(), Private2(), etc.

afxgroup
afxgroup's picture
Offline
Last seen: 5 months 1 week ago
Joined: 2011-02-03 15:26
yes, they was needed by the

yes, they was needed by the main program (that is the only one that really know them). so i've removed them by the #private zone otherwise a crash was inevitable..
Now all is working correctly..

hypex
hypex's picture
Offline
Last seen: 3 months 2 weeks ago
Joined: 2011-09-09 16:20
That's good to know. But I

That's good to know. But I wonder why the main program which is external to the library in a sense is using private functions? And, OTOH, why the functions needed to be called externally are declared private?

afxgroup
afxgroup's picture
Offline
Last seen: 5 months 1 week ago
Joined: 2011-02-03 15:26
indeed.. that's the strange

indeed.. that's the strange thing.. and not only. If a function is "Private" in a library i suppose that no one could call it except the library itself.. but i assure you that this program is working correctly with this kind of libraries.. Could be that the 68k library however has the functions in the jump table but only the main program knows them..
This is the only solution.. (i think..)

Log in or register to post comments