Mercurial > sdl-ios-xcode
diff src/loadso/macos/SDL_sysloadso.c @ 1662:782fd950bd46 SDL-1.3
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid.
The code is now run through a consistent indent format:
indent -i4 -nut -nsc -br -ce
The headers are being converted to automatically generate doxygen documentation.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 28 May 2006 13:04:16 +0000 |
parents | 92947e3a18db |
children | 4da1ee79c9af |
line wrap: on
line diff
--- a/src/loadso/macos/SDL_sysloadso.c Sun May 21 17:27:13 2006 +0000 +++ b/src/loadso/macos/SDL_sysloadso.c Sun May 28 13:04:16 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: */