Modular C
Identifier visibility
#pragma CMOD intern id
#pragma CMOD extern id
#pragma CMOD declaration
#pragma CMOD definition

Default visibility

Modular C follows C's main lines of identifier visibility (called linkage in the C standard). If you don't do anything special, exactly the symbols with external linkage are visible to other modules:

  • Per default all extern functions and variable declarations are visible to other modules.

If for example your module proj∷arith contains something like

double add(double a, double b) {
return a + b;
static double add1(double a) {
return a + 1;

Other modules can use the identifier proj∷arith∷add and "see" a declaration that is equivalent to

extern double proj∷arith∷add(double a, double b);

In contrast to that, because it is static, add1 is hidden and cannot be used by another module than proj∷arith.

Next: Importing and abbreviating