Mercurial > sdl-ios-xcode
diff src/loadso/macos/SDL_sysloadso.c @ 1895:c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 10 Jul 2006 21:04:37 +0000 |
parents | 92947e3a18db |
children |
line wrap: on
line diff
--- a/src/loadso/macos/SDL_sysloadso.c Thu Jul 06 18:01:37 2006 +0000 +++ b/src/loadso/macos/SDL_sysloadso.c Mon Jul 10 21:04:37 2006 +0000 @@ -35,72 +35,76 @@ #include "SDL_loadso.h" -void *SDL_LoadObject(const char *sofile) +void * +SDL_LoadObject(const char *sofile) { - void *handle = NULL; - const char *loaderror = NULL; - CFragConnectionID library_id; - Ptr mainAddr; - Str255 errName; - OSErr error; - char psofile[512]; + void *handle = NULL; + const char *loaderror = NULL; + CFragConnectionID library_id; + Ptr mainAddr; + Str255 errName; + OSErr error; + char psofile[512]; - SDL_strlcpy(psofile, sofile, SDL_arraysize(psofile)); - error = GetSharedLibrary(C2PStr(psofile), kCompiledCFragArch, - kLoadCFrag, &library_id, &mainAddr, errName); - switch (error) { - case noErr: - loaderror = NULL; - break; - case cfragNoLibraryErr: - loaderror = "Library not found"; - break; - case cfragUnresolvedErr: - loaderror = "Unabled to resolve symbols"; - break; - case cfragNoPrivateMemErr: - case cfragNoClientMemErr: - loaderror = "Out of memory"; - break; - default: - loaderror = "Unknown Code Fragment Manager error"; - break; - } - if ( loaderror == NULL ) { - handle = (void *)(library_id); - } else { - SDL_SetError("Failed loading %s: %s", sofile, loaderror); - } - return(handle); + SDL_strlcpy(psofile, sofile, SDL_arraysize(psofile)); + error = GetSharedLibrary(C2PStr(psofile), kCompiledCFragArch, + kLoadCFrag, &library_id, &mainAddr, errName); + switch (error) { + case noErr: + loaderror = NULL; + break; + case cfragNoLibraryErr: + loaderror = "Library not found"; + break; + case cfragUnresolvedErr: + loaderror = "Unabled to resolve symbols"; + break; + case cfragNoPrivateMemErr: + case cfragNoClientMemErr: + loaderror = "Out of memory"; + break; + default: + loaderror = "Unknown Code Fragment Manager error"; + break; + } + if (loaderror == NULL) { + handle = (void *) (library_id); + } else { + SDL_SetError("Failed loading %s: %s", sofile, loaderror); + } + return (handle); } -void *SDL_LoadFunction(void *handle, const char *name) +void * +SDL_LoadFunction(void *handle, const char *name) { - void *symbol = NULL; - const char *loaderror = NULL; - CFragSymbolClass class; - CFragConnectionID library_id = (CFragConnectionID)handle; - char pname[512]; + void *symbol = NULL; + const char *loaderror = NULL; + CFragSymbolClass class; + CFragConnectionID library_id = (CFragConnectionID) handle; + char pname[512]; - SDL_strlcpy(pname, name, SDL_arraysize(pname)); - if ( FindSymbol(library_id, C2PStr(pname), - (char **)&symbol, &class) != noErr ) { - loaderror = "Symbol not found"; - } + SDL_strlcpy(pname, name, SDL_arraysize(pname)); + if (FindSymbol(library_id, C2PStr(pname), + (char **) &symbol, &class) != noErr) { + loaderror = "Symbol not found"; + } - if ( symbol == NULL ) { - SDL_SetError("Failed loading %s: %s", name, loaderror); - } - return(symbol); + if (symbol == NULL) { + SDL_SetError("Failed loading %s: %s", name, loaderror); + } + return (symbol); } -void SDL_UnloadObject(void *handle) +void +SDL_UnloadObject(void *handle) { - CFragConnectionID library_id; - if ( handle != NULL ) { - library_id = (CFragConnectionID)handle; - CloseConnection(&library_id); - } + CFragConnectionID library_id; + if (handle != NULL) { + library_id = (CFragConnectionID) handle; + CloseConnection(&library_id); + } } #endif /* SDL_LOADSO_MACOS */ +/* vi: set ts=4 sw=4 expandtab: */