comparison src/loadso/beos/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
comparison
equal deleted inserted replaced
1661:281d3f4870e5 1662:782fd950bd46
29 #include <stdio.h> 29 #include <stdio.h>
30 #include <be/kernel/image.h> 30 #include <be/kernel/image.h>
31 31
32 #include "SDL_loadso.h" 32 #include "SDL_loadso.h"
33 33
34 void *SDL_LoadObject(const char *sofile) 34 void *
35 SDL_LoadObject (const char *sofile)
35 { 36 {
36 void *handle = NULL; 37 void *handle = NULL;
37 const char *loaderror = "Unknown error"; 38 const char *loaderror = "Unknown error";
38 image_id library_id = load_add_on(sofile); 39 image_id library_id = load_add_on (sofile);
39 if ( library_id == B_ERROR ) { 40 if (library_id == B_ERROR) {
40 loaderror = "BeOS error"; 41 loaderror = "BeOS error";
41 } else { 42 } else {
42 handle = (void *)(library_id); 43 handle = (void *) (library_id);
43 } 44 }
44 45
45 if ( handle == NULL ) { 46 if (handle == NULL) {
46 SDL_SetError("Failed loading %s: %s", sofile, loaderror); 47 SDL_SetError ("Failed loading %s: %s", sofile, loaderror);
47 } 48 }
48 return(handle); 49 return (handle);
49 } 50 }
50 51
51 void *SDL_LoadFunction(void *handle, const char *name) 52 void *
53 SDL_LoadFunction (void *handle, const char *name)
52 { 54 {
53 void *symbol = NULL; 55 void *symbol = NULL;
54 const char *loaderror = "Unknown error"; 56 const char *loaderror = "Unknown error";
55 image_id library_id = (image_id)handle; 57 image_id library_id = (image_id) handle;
56 if ( get_image_symbol(library_id, 58 if (get_image_symbol (library_id,
57 name, B_SYMBOL_TYPE_TEXT, &symbol) != B_NO_ERROR ) { 59 name, B_SYMBOL_TYPE_TEXT, &symbol) != B_NO_ERROR) {
58 loaderror = "Symbol not found"; 60 loaderror = "Symbol not found";
59 } 61 }
60 62
61 if ( symbol == NULL ) { 63 if (symbol == NULL) {
62 SDL_SetError("Failed loading %s: %s", name, loaderror); 64 SDL_SetError ("Failed loading %s: %s", name, loaderror);
63 } 65 }
64 return(symbol); 66 return (symbol);
65 } 67 }
66 68
67 void SDL_UnloadObject(void *handle) 69 void
70 SDL_UnloadObject (void *handle)
68 { 71 {
69 image_id library_id; 72 image_id library_id;
70 if ( handle != NULL ) { 73 if (handle != NULL) {
71 library_id = (image_id)handle; 74 library_id = (image_id) handle;
72 unload_add_on(library_id); 75 unload_add_on (library_id);
73 } 76 }
74 } 77 }
75 78
76 #endif /* SDL_LOADSO_BEOS */ 79 #endif /* SDL_LOADSO_BEOS */
80 /* vi: set ts=4 sw=4 expandtab: */