If I have a function 'int f1(void)' defined in 'file1.c'. If I declared at the begining of another file 'file2.c' : 'extern int f1(void);' , and use it later in this file (without declaring it in a '.h' file) . Will it work ?
He he, 'extern' is a way to say that the function is defined somewhere else. It is therefore public. http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/...
Alexandre
NB: I am now away until this evening. without internet.
2010/1/22 Alexandre Bergel alexandre@bergel.eu Hi Cyrille,
This is not quite exact. A static function is a function that is visible only in the file that defines it. It is true that it could be assimilated as a private function. But the privacy is also obtained by not having the function signature in the .h file. Contrary to Java, there is no such a keyword in C that says if a function is private a or public, but there is a number of technical conventions.
Alexandre
On 22 Jan 2010, at 07:18, Cyrille Delaunay wrote:
Hello,
A thing I want to do when importing C code in moose , is to see if a function is Private or Public. After reading some documentations about C, a private function ( A function that can't be used outside the module in which it's defined) is a function declared with 'Static'. Am I wrong ?
If this is ok, the first thing is: => FAMIXFunction > isPublic just check if the function is called outside the module. This does not really correspond to the description above.
the secong thing is: => How can I see if a function is declared with 'static' ? For the moment I can have this information in the signatiure of the function. But to retrieve that, I have to parse the string.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev