#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
Go to the source code of this file.
|
typedef int(* | fntype) (const char *) |
|
|
int | main (int argc, char *argv[]) |
|
◆ fntype
typedef int(* fntype) (const char *) |
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 25 of file testloadso.c.
References NULL, retval, SDL_GetError, SDL_Init, SDL_LoadFunction(), SDL_LoadObject, SDL_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LogError, SDL_Quit, and SDL_UnloadObject.
29 const char *libname =
NULL;
30 const char *symname =
NULL;
35 const char *app = argv[0];
36 SDL_Log(
"USAGE: %s <library> <functionname>\n", app);
37 SDL_Log(
" %s --hello <lib with puts()>\n", app);
47 if (strcmp(argv[1],
"--hello") == 0) {
68 SDL_Log(
"Found %s in %s at %p\n", symname, libname, fn);
70 SDL_Log(
"Calling function...\n");
72 fn(
" HELLO, WORLD!\n");
73 SDL_Log(
"...apparently, we survived. :)\n");
74 SDL_Log(
"Unloading library...\n");
int(* fntype)(const char *)
void * SDL_LoadFunction(void *handle, const char *name)