standards: Libraries
1
1 4.3 Library Behavior
1 ====================
1
1 Try to make library functions reentrant. If they need to do dynamic
1 storage allocation, at least try to avoid any nonreentrancy aside from
1 that of 'malloc' itself.
1
1 Here are certain name conventions for libraries, to avoid name
1 conflicts.
1
1 Choose a name prefix for the library, more than two characters long.
1 All external function and variable names should start with this prefix.
1 In addition, there should only be one of these in any given library
1 member. This usually means putting each one in a separate source file.
1
1 An exception can be made when two external symbols are always used
1 together, so that no reasonable program could use one without the other;
1 then they can both go in the same file.
1
1 External symbols that are not documented entry points for the user
1 should have names beginning with '_'. The '_' should be followed by the
1 chosen name prefix for the library, to prevent collisions with other
1 libraries. These can go in the same files with user entry points if you
1 like.
1
1 Static functions and variables can be used as you like and need not
1 fit any naming convention.
1