Bochs/bochs-testing/plugin-test/test8-execlass/module1.cc
Bryce Denney 4cbcd6550b - add test8-execlass, which defines a C++ class in the executable, and
tests that the modules can access it
2002-10-16 13:28:17 +00:00

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;
}