Use visibility("protected") for PMOD_EXPORT functions. This means that even though the functions will be externally visible, local calls will be made when they are referenced in the same source-file. This means that overriding with LD_PRELOAD or similar is not all that reliable (to say the least), but that should not be an issue, really.