Big cleanup part 1.
[SDL.s60v3.git] / src / main / symbian / SDL_env.cpp
blobbe43c4cb3d25fe8e098a197428c1439fe8b8c25a
1 #include<e32std.h>
3 void* SDL_LoadObject(const char *sofile)
5 RLibrary* lib = new RLibrary();
6 if(lib == NULL)
7 return NULL;
8 TFileName name;
9 name.Copy(TPtrC8((const TUint8*)sofile));
10 if(KErrNone == lib->Load(name))
11 return lib;
12 delete lib;
13 return NULL;
17 void* SDL_LoadFunction(void *handle, const char *name)
19 TLex8 v((const TUint8*)(name));
20 TInt ord;
22 if(KErrNone != v.Val(ord))
23 return NULL;
25 const RLibrary* lib = reinterpret_cast<RLibrary*>(handle);
26 TLibraryFunction f = lib->Lookup(ord);
27 return (void*)(f);
30 void SDL_UnloadObject(void *handle)
32 RLibrary* lib = reinterpret_cast<RLibrary*>(handle);
33 lib->Close();
34 delete lib;