The Alert module is a part of the core as the rest of the core files depend on it. Hence the definition of the module must be provided either by the internal or an external definition. A C Library module can be overriding by redefining all external references (normally declared in the include file) by new definitions in an application module. By doing this the linker takes the new definition of the module instead of the Library version and links it into the final executable file. The declaration (the include file) stays the same, but the definition has changed. The application module does not need to be called the same as the Library module, only the external references. External references are both global variables and public functions visible to other modules. As an example, the following module:
/* Library.c */ char GlobalFlag; int GlobalFunction(void) { /* Library src */ }with the declaration file:
/* Library.h */ extern char GlobalFlag; extern int GlobalFunction(void);can get a new definition module
/* Application.c */ char GlobalFlag; int GlobalFunction(void) { /* Application src */ }which will then be linked into the executable program. By using this method, the application can easily provide its own user interface (if any) and still be able to use the Library.