23 #include "helpfile.h" |
23 #include "helpfile.h" |
24 #include <f32file.h> |
24 #include <f32file.h> |
25 #include <e32std.h> |
25 #include <e32std.h> |
26 #include <pls.h> // For emulator WSD API |
26 #include <pls.h> // For emulator WSD API |
27 #include <glib.h> |
27 #include <glib.h> |
|
28 #include <config.h> |
|
29 #include <stdlib.h> |
28 |
30 |
29 extern "C" char* libgstreamer_get_dll_path(char* dllName) |
31 extern "C" char* libgstreamer_get_dll_path(char* dllName) |
30 { |
32 { |
31 TUint ch = TUint('A'); |
33 char* dllFullPath = NULL; |
32 char* fullPath = dllName; |
|
33 #ifdef __WINSCW__ |
|
34 char* dllPath = "z:\\sys\\bin\\plugins"; |
|
35 fullPath = g_strjoin ("\\", dllPath,dllName, NULL); |
|
36 #else |
|
37 char* dllPath = "sys\\bin"; |
|
38 |
|
39 char* filename; |
|
40 TInt i; |
|
41 RFs fs; |
34 RFs fs; |
42 TDriveList driveList; |
35 CDir* directory=NULL; |
43 //err = fs.Connect(); |
|
44 if( !(fs.Connect()) ) |
36 if( !(fs.Connect()) ) |
45 { |
37 { |
46 //err = fs.DriveList(driveList); |
38 TFindFile findFile(fs); |
47 if( !(fs.DriveList(driveList)) ) |
39 TFileName file; |
|
40 TPtrC8 filename; |
|
41 filename.Set( reinterpret_cast<TUint8*>( dllName ) ); |
|
42 file.Copy( filename ); |
|
43 if( ! findFile.FindWildByDir(file,KResFileNamePath,directory) ) |
48 { |
44 { |
49 for( i = 0; i< KMaxDrives; i++ ) |
45 TBuf8<KMaxFileName> fileName; |
50 { |
46 fileName.Copy( findFile.File() ); |
51 |
47 TInt length = fileName.Size() + 1; |
52 if( driveList[i] != 0 ) |
48 dllFullPath = (char*)malloc( length ); |
53 { |
49 memcpy( dllFullPath, fileName.PtrZ(), length ); |
54 char temp[3]; |
50 delete directory; |
55 temp[0]= char(ch); |
|
56 temp[1]= ':'; |
|
57 temp[2]= '\0'; |
|
58 |
|
59 filename = g_strjoin ("\\", temp,dllPath,dllName, NULL); |
|
60 if (g_file_test (filename, G_FILE_TEST_EXISTS)) |
|
61 { |
|
62 fullPath = filename; |
|
63 break; |
|
64 } |
|
65 } |
|
66 ch++; |
|
67 } |
|
68 } |
51 } |
69 fs.Close(); |
52 fs.Close(); |
70 } |
53 } |
71 #endif |
54 return dllFullPath; |
72 return fullPath; |
|
73 } |
55 } |
74 |
56 |