diff options
author | jimfcarroll <thecarrolls@jiminger.com> | 2011-04-06 22:39:39 -0400 |
---|---|---|
committer | Jim Carroll <thecarrolls@jiminger.com> | 2011-04-07 17:03:01 -0400 |
commit | a613b2351f51672315e963a0a64a7e65b38a6e3f (patch) | |
tree | 918aa30d79dcda6e56008c8db13bbd9d4df3675d | |
parent | 4acdc106e8d54a95a3d7e4d675d187fb6bbe3ff0 (diff) |
Updated windows projects and code to remove the last evil vestages of internal python and it's wrappers.
-rw-r--r-- | project/VS2010Express/XBMC.vcxproj | 2 | ||||
-rw-r--r-- | project/VS2010Express/XBMC.vcxproj.filters | 6 | ||||
-rw-r--r-- | xbmc/cores/DllLoader/Win32DllLoader.cpp | 39 | ||||
-rw-r--r-- | xbmc/cores/DllLoader/exports/exports_python_win32.cpp | 265 |
4 files changed, 0 insertions, 312 deletions
diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj index c74c893c70..9c0f180bb2 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj @@ -929,7 +929,6 @@ <ClCompile Include="..\..\xbmc\cores\DllLoader\exports\emu_dummy.cpp" /> <ClCompile Include="..\..\xbmc\cores\DllLoader\exports\emu_kernel32.cpp" /> <ClCompile Include="..\..\xbmc\cores\DllLoader\exports\emu_msvcrt.cpp" /> - <ClCompile Include="..\..\xbmc\cores\DllLoader\exports\exports_python_win32.cpp" /> <ClCompile Include="..\..\xbmc\cores\DllLoader\exports\win32-dirent.cpp" /> <ClCompile Include="..\..\xbmc\cores\DllLoader\exports\emu_socket\inet_aton.c"> <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">CompileAsCpp</CompileAs> @@ -1389,7 +1388,6 @@ <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\window.h" /> <ClInclude Include="..\..\xbmc\interfaces\python\xbmcmodule\winxml.h" /> <ClInclude Include="..\..\xbmc\interfaces\python\XBPython.h" /> - <ClInclude Include="..\..\xbmc\interfaces\python\XBPythonDll.h" /> <ClInclude Include="..\..\xbmc\interfaces\python\XBPyThread.h" /> <ClInclude Include="..\..\xbmc\IProgressCallback.h" /> <ClInclude Include="..\..\xbmc\LangInfo.h" /> diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters index 0464eb1502..694ba34288 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -561,9 +561,6 @@ <ClCompile Include="..\..\xbmc\cores\DllLoader\exports\emu_msvcrt.cpp"> <Filter>cores\DllLoader\exports</Filter> </ClCompile> - <ClCompile Include="..\..\xbmc\cores\DllLoader\exports\exports_python_win32.cpp"> - <Filter>cores\DllLoader\exports</Filter> - </ClCompile> <ClCompile Include="..\..\xbmc\cores\DllLoader\exports\win32-dirent.cpp"> <Filter>cores\DllLoader\exports</Filter> </ClCompile> @@ -4897,9 +4894,6 @@ <ClInclude Include="..\..\xbmc\interfaces\json-rpc\ServiceDescription.h"> <Filter>interfaces\json-rpc</Filter> </ClInclude> - <ClInclude Include="..\..\xbmc\interfaces\python\XBPythonDll.h"> - <Filter>interfaces\python</Filter> - </ClInclude> <ClInclude Include="..\..\xbmc\XBDateTime.h"> <Filter>utils</Filter> </ClInclude> diff --git a/xbmc/cores/DllLoader/Win32DllLoader.cpp b/xbmc/cores/DllLoader/Win32DllLoader.cpp index c4ac80e037..e1a419ed42 100644 --- a/xbmc/cores/DllLoader/Win32DllLoader.cpp +++ b/xbmc/cores/DllLoader/Win32DllLoader.cpp @@ -136,45 +136,6 @@ Export win32_exports[] = { NULL, -1, NULL, NULL } }; -// stuff for python -extern "C" -{ - char* xbp_getcwd(char *buf, int size); - int xbp_chdir(const char *dirname); - int xbp_access(const char *path, int mode); - int xbp_unlink(const char *filename); - int xbp_chmod(const char *filename, int pmode); - int xbp_rmdir(const char *dirname); - int xbp_utime(const char *filename, struct utimbuf *times); - int xbp_rename(const char *oldname, const char *newname); - int xbp_mkdir(const char *dirname); - int xbp_open(const char *filename, int oflag, int pmode); - FILE* xbp__wfopen(const wchar_t *filename, const wchar_t *mode); -}; - -Export win32_python_exports[] = -{ - // these just correct for path separators and call the base - { "access", -1, (void*)xbp_access, NULL }, - { "_access", -1, (void*)xbp_access, NULL }, - { "unlink", -1, (void*)xbp_unlink, NULL }, - { "chmod", -1, (void*)xbp_chmod, NULL }, - { "rmdir", -1, (void*)xbp_rmdir, NULL }, - { "utime", -1, (void*)xbp_utime, NULL }, - { "rename", -1, (void*)xbp_rename, NULL }, - { "mkdir", -1, (void*)xbp_mkdir, NULL }, - { "open", -1, (void*)xbp_open, NULL }, - { "_wfopen", -1, (void*)xbp__wfopen, NULL }, -// { "opendir", -1, (void*)xbp_opendir, NULL }, _LINUX only - - // special workaround just for python - { "_chdir", -1, (void*)xbp_chdir, NULL }, - { "_getcwd", -1, (void*)xbp_getcwd, NULL }, - { "_putenv", -1, (void*)dll_putenv, NULL }, - { "__p__environ", -1, (void*)dll___p__environ, NULL }, - { NULL, -1, NULL, NULL } -}; - Win32DllLoader::Win32DllLoader(const char *dll) : LibraryLoader(dll) { m_dllHandle = NULL; diff --git a/xbmc/cores/DllLoader/exports/exports_python_win32.cpp b/xbmc/cores/DllLoader/exports/exports_python_win32.cpp deleted file mode 100644 index 272ba48875..0000000000 --- a/xbmc/cores/DllLoader/exports/exports_python_win32.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include <io.h> -#include <direct.h> -#include <sys/utime.h> -#include <sys/stat.h> -#include <stdio.h> - -#include "Util.h" -#include "../DllLoader.h" -#include "../../../FileSystem/SpecialProtocol.h" -#include "utils/log.h" - -#include "../dll_tracker_file.h" -#include "emu_msvcrt.h" - -extern "C" FILE *fopen_utf8(const char *_Filename, const char *_Mode); - -// file io functions -#define CORRECT_SEP_STR(str) \ - if (strstr(str, "://") == NULL) \ - { \ - int iSize_##str = strlen(str); \ - for (int pos = 0; pos < iSize_##str; pos++) \ - if (str[pos] == '/') str[pos] = '\\'; \ - } \ - else \ - { \ - int iSize_##str = strlen(str); \ - for (int pos = 0; pos < iSize_##str; pos++) \ - if (str[pos] == '\\') str[pos] = '/'; \ - } - -#define CORRECT_SEP_WSTR(str) \ - if (wcsstr(str, L"://") == NULL) \ - { \ - int iSize_##str = wcslen(str); \ - for (int pos = 0; pos < iSize_##str; pos++) \ - if (str[pos] == '/') str[pos] = '\\'; \ - } \ - else \ - { \ - int iSize_##str = wcslen(str); \ - for (int pos = 0; pos < iSize_##str; pos++) \ - if (str[pos] == '\\') str[pos] = '/'; \ - } - -extern "C" -{ - static __declspec(thread) char xbp_cw_dir[MAX_PATH] = ""; - - char* xbp_getcwd(char *buf, int size) - { - if (buf == NULL) buf = (char *)malloc(size); - strcpy(buf, xbp_cw_dir); - return buf; - } - - int xbp_chdir(const char *dirname) - { - if (strlen(dirname) > MAX_PATH) return -1; - - strcpy(xbp_cw_dir, dirname); - CORRECT_SEP_STR(xbp_cw_dir); - - return 0; - } - - char* xbp__tempnam(const char *dir, const char *prefix) - { - char* p = strdup(dir); - CORRECT_SEP_STR(p); - char* res = _tempnam(p, prefix); - free(p); - return strdup(res); - } - - int xbp_unlink(const char *filename) - { - char* p = strdup(filename); - CORRECT_SEP_STR(p); - int res = unlink(_P(p).c_str()); - free(p); - return res; - } - - int xbp_access(const char *path, int mode) - { - char* p = strdup(path); - CORRECT_SEP_STR(p); - int res = access(_P(p).c_str(), mode); - free(p); - return res; - } - - int xbp_chmod(const char *filename, int pmode) - { - char* p = strdup(filename); - CORRECT_SEP_STR(p); - int res = chmod(_P(p).c_str(), pmode); - free(p); - return res; - } - - int xbp_rmdir(const char *dirname) - { - char* p = strdup(dirname); - CORRECT_SEP_STR(p); - int res = rmdir(_P(p).c_str()); - free(p); - return res; - } - - int xbp_utime(const char *filename, struct utimbuf *times) - { - char* p = strdup(filename); - CORRECT_SEP_STR(p); - int res = utime(_P(p).c_str(), times); - free(p); - return res; - } - - int xbp_rename(const char *oldname, const char *newname) - { - char* o = strdup(oldname); - char* n = strdup(newname); - CORRECT_SEP_STR(o); - CORRECT_SEP_STR(n); - int res = rename(_P(o).c_str(), _P(n).c_str()); - free(o); - free(n); - return res; - } - - int xbp_mkdir(const char *dirname) - { - char* p = strdup(dirname); - CORRECT_SEP_STR(p); - int res = mkdir(_P(p).c_str()); - free(p); - return res; - } - - int xbp_open(const char *filename, int oflag, int pmode) - { - CStdString strPath = CUtil::ValidatePath(_P(filename)); - - int res = open(strPath.c_str(), oflag, pmode); - return res; - } - - FILE* xbp_fopen(const char *filename, const char *mode) - { - //convert '/' to '\\' - char cName[1024]; - char* p; - - CStdString strPath = CUtil::ValidatePath(_P(filename)); - strcpy(cName, strPath.c_str()); - - //for each "\\..\\" remove the directory before it - while(p = strstr(cName, "\\..\\")) - { - char* file = p + 3; - *p = '\0'; - *strrchr(cName, '\\') = '\0'; - strcat(cName, file); - } - - // don't use emulated files, they do not work in python yet - return fopen_utf8(cName, mode); - } - - #if 0 // TODO: Is this needed? - FILE* xbp_fopen64(const char *filename, const char *mode) - { - CStdString strName = filename; - printf("....%s\n", strName.c_str()); - // don't use emulated files, they do not work in python yet - return fopen64(_P(strName).c_str(), mode); - } - #endif - - int xbp_fclose(FILE* stream) - { - return dll_fclose(stream); - } - - int xbp_close(int fd) - { - return dll_close(fd); - } - - FILE* xbp__wfopen(const wchar_t *filename, const wchar_t *mode) - { - CLog::Log(LOGERROR, "xbp__wfopen = untested"); - wchar_t* p = wcsdup(filename); - CORRECT_SEP_WSTR(p); - FILE* res = _wfopen(p, mode); - free(p); - return res; - } - - BOOL xbp_FindClose(HANDLE hFindFile) - { - return FindClose(hFindFile); - } - - HANDLE xbp_FindFirstFile(LPCTSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData) - { - char* p = strdup(lpFileName); - CORRECT_SEP_STR(p); - - // change default \\*.* into \\* which the xbox is using - char* e = strrchr(p, '.'); - if (e != NULL && strlen(e) > 1 && e[1] == '*') - { - e[0] = '\0'; - } - - HANDLE res = FindFirstFile(_P(p).c_str(), lpFindFileData); - free(p); - return res; - } - - BOOL xbp_FindNextFile(HANDLE hFindFile, LPWIN32_FIND_DATA lpFindFileData) - { - return FindNextFile(hFindFile, lpFindFileData); - } - - long xbp__get_osfhandle(int fd) - { - return _get_osfhandle(fd); - } - - int xbp_dup(int fd) - { - return dup(fd); - } - - int xbp_dup2(int fd1, int fd2) - { - return dup2(fd1, fd2); - } - -} // extern "C" |