4cbcd6550b
tests that the modules can access it
26 lines
599 B
C++
26 lines
599 B
C++
#include <stdio.h>
|
|
#include "main.h"
|
|
|
|
void module_init ()
|
|
{
|
|
printf ("module1 init for main version %s\n", version_string);
|
|
register_module ("module1");
|
|
if (widgets[2] != NULL) {
|
|
printf ("module1 is examining widgets[2]\n");
|
|
printf ("module1: widgets[2] name is '%s'\n", widgets[2]->getName ());
|
|
}
|
|
printf ("module1 will print every widget that it can find\n");
|
|
for (int i=0; i<MAX_WIDGETS; i++) {
|
|
if (widgets[i]) {
|
|
printf ("module1: widgets[%d] is ", i);
|
|
widgets[i]->print (stdout);
|
|
printf ("\n");
|
|
}
|
|
}
|
|
}
|
|
|
|
int operate (int a, int b)
|
|
{
|
|
return a + b;
|
|
}
|