toaruos/modules/test.c

20 lines
503 B
C
Raw Normal View History

extern char * special_thing;
2014-03-10 09:37:49 +04:00
char test_module_string[] = "I am a char[] in the module.\n";
char * test_module_string_ptr = "I am a char * in the module.\n";
2014-03-10 09:31:34 +04:00
static int a_function(void (*callback)(char *)) {
2014-03-10 09:37:49 +04:00
callback("I am a static function in the module.\n");
return 42;
}
int b_function(void (*callback)(char *)) {
2014-03-10 09:37:49 +04:00
callback("I am a global function in a module!\n");
callback(special_thing);
2014-03-10 09:31:34 +04:00
a_function(callback);
2014-03-10 09:37:49 +04:00
callback(test_module_string);
callback(test_module_string_ptr);
return 25;
}