Mercurial > sdl-ios-xcode
comparison src/loadso/os2/SDL_sysloadso.c @ 1668:4da1ee79c9af SDL-1.3
more tweaking indent options
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 29 May 2006 04:04:35 +0000 |
parents | 782fd950bd46 |
children |
comparison
equal
deleted
inserted
replaced
1667:1fddae038bc8 | 1668:4da1ee79c9af |
---|---|
32 #include <os2.h> | 32 #include <os2.h> |
33 | 33 |
34 #include "SDL_loadso.h" | 34 #include "SDL_loadso.h" |
35 | 35 |
36 void * | 36 void * |
37 SDL_LoadObject (const char *sofile) | 37 SDL_LoadObject(const char *sofile) |
38 { | 38 { |
39 HMODULE handle = NULL; | 39 HMODULE handle = NULL; |
40 char buf[512]; | 40 char buf[512]; |
41 APIRET ulrc = DosLoadModule (buf, sizeof (buf), (char *) sofile, &handle); | 41 APIRET ulrc = DosLoadModule(buf, sizeof(buf), (char *) sofile, &handle); |
42 | 42 |
43 /* Generate an error message if all loads failed */ | 43 /* Generate an error message if all loads failed */ |
44 if ((ulrc != NO_ERROR) || (handle == NULL)) | 44 if ((ulrc != NO_ERROR) || (handle == NULL)) |
45 SDL_SetError ("Failed loading %s: %s", sofile, buf); | 45 SDL_SetError("Failed loading %s: %s", sofile, buf); |
46 | 46 |
47 return ((void *) handle); | 47 return ((void *) handle); |
48 } | 48 } |
49 | 49 |
50 void * | 50 void * |
51 SDL_LoadFunction (void *handle, const char *name) | 51 SDL_LoadFunction(void *handle, const char *name) |
52 { | 52 { |
53 const char *loaderror = "Unknown error"; | 53 const char *loaderror = "Unknown error"; |
54 void *symbol = NULL; | 54 void *symbol = NULL; |
55 APIRET ulrc = | 55 APIRET ulrc = |
56 DosQueryProcAddr ((HMODULE) handle, 0, (char *) name, &symbol); | 56 DosQueryProcAddr((HMODULE) handle, 0, (char *) name, &symbol); |
57 if (ulrc == ERROR_INVALID_HANDLE) | 57 if (ulrc == ERROR_INVALID_HANDLE) |
58 loaderror = "Invalid module handle"; | 58 loaderror = "Invalid module handle"; |
59 else if (ulrc == ERROR_INVALID_NAME) | 59 else if (ulrc == ERROR_INVALID_NAME) |
60 loaderror = "Symbol not found"; | 60 loaderror = "Symbol not found"; |
61 | 61 |
62 if (symbol == NULL) | 62 if (symbol == NULL) |
63 SDL_SetError ("Failed loading %s: %s", name, loaderror); | 63 SDL_SetError("Failed loading %s: %s", name, loaderror); |
64 | 64 |
65 return (symbol); | 65 return (symbol); |
66 } | 66 } |
67 | 67 |
68 void | 68 void |
69 SDL_UnloadObject (void *handle) | 69 SDL_UnloadObject(void *handle) |
70 { | 70 { |
71 if (handle != NULL) | 71 if (handle != NULL) |
72 DosFreeModule ((HMODULE) handle); | 72 DosFreeModule((HMODULE) handle); |
73 } | 73 } |
74 | 74 |
75 #endif /* SDL_LOADSO_OS2 */ | 75 #endif /* SDL_LOADSO_OS2 */ |
76 /* vi: set ts=4 sw=4 expandtab: */ | 76 /* vi: set ts=4 sw=4 expandtab: */ |