Quote from Tanenbaum Design and implementation of Minix Book operating systems Third edition Page 140 paragraph 3
PRIVATE is defined as a synonym for static. Procedures and data that are not specified outside the file in which they were declared are always declared as PRIVATE to prevent them from being visible outside the file in which they were declared. Generally, all variables and procedures should be declared with a local scope, if possible. PUBLIC is defined as a null string. An example from the kernel /proc.c can help make this clear. Ad
PUBLIC void lock_dequeue (rp)
exits preprocessor C as
void lock_dequeue (rp)
static global variables have the scope of the file. Therefore, if you define a global variable or set the static function, they will be visible only inside this file. That is, you can only access those that are inside this file in a multi-file environment.
extern glapals are visible / accessible from outside the file. extern is optional for defining functions, because by default they are visible from outside the file area.
A hash defining these things before PRIVATE and PUBLIC is nothing more than adding an abstraction layer to better interpret and understand what is actually intended. As in OOP design, private and public interpretations, adding the same name indicates what properties they have.
source share