diff options
author | František Dvořák <valtri@users.sourceforge.net> | 2004-04-06 19:20:15 +0000 |
---|---|---|
committer | František Dvořák <valtri@users.sourceforge.net> | 2004-04-06 19:20:15 +0000 |
commit | 21aa4eed6d0e90f9a9b548c1adaad7dccf2f4862 (patch) | |
tree | b76be854bb41e0b0469dca57ec4100aeff99504c /src | |
parent | 81de862996c8af79e73f550b0160e9c091722a71 (diff) | |
download | xine-lib-21aa4eed6d0e90f9a9b548c1adaad7dccf2f4862.tar.gz xine-lib-21aa4eed6d0e90f9a9b548c1adaad7dccf2f4862.tar.bz2 |
Prepare for MinGW port:
move M$VC specific header files into sparate directory
regenerate config.h for M$VC
compilation fixes
add some getchar()s into xineui.exe (popup dialogs would be better)
CVS patchset: 6338
CVS date: 2004/04/06 19:20:15
Diffstat (limited to 'src')
-rw-r--r-- | src/input/libreal/rmff.h | 9 | ||||
-rw-r--r-- | src/xine-utils/utils.c | 82 | ||||
-rw-r--r-- | src/xine-utils/xineutils.h | 6 |
3 files changed, 88 insertions, 9 deletions
diff --git a/src/input/libreal/rmff.h b/src/input/libreal/rmff.h index 38893e8d1..4f33d93a5 100644 --- a/src/input/libreal/rmff.h +++ b/src/input/libreal/rmff.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: rmff.h,v 1.4 2003/12/09 00:02:30 f1rmb Exp $ + * $Id: rmff.h,v 1.5 2004/04/06 19:20:16 valtri Exp $ * * some functions for real media file headers * adopted from joschkas real tools @@ -32,6 +32,7 @@ #include <fcntl.h> #include <stdlib.h> #include <string.h> +#include <inttypes.h> #ifndef HAVE_RMFF_H @@ -62,12 +63,6 @@ #define PN_PERFECT_PLAY_ENABLED 0x02 #define PN_LIVE_BROADCAST 0x04 -#ifdef __CYGWIN__ -#define uint32_t unsigned int -#define uint16_t unsigned short int -#define uint8_t unsigned char -#endif - /* * rm header data structs */ diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index f9db9893f..98f2ed2c4 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: utils.c,v 1.25 2004/03/29 19:10:36 mroi Exp $ + * $Id: utils.c,v 1.26 2004/04/06 19:20:16 valtri Exp $ * */ #define _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */ @@ -246,6 +246,86 @@ void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) { return ptr; } +#if defined(WIN32) + +/* Ridiculous hack to return valid xine support + * directories. These should be read from + * a registry entry set at install time. + */ + +char *exec_path_append_subdir(char *string) { + static char tmp_win32_path[1024]; + char *tmpchar; + char *cmdline; + char *back_slash; + char *fore_slash; + char *last_slash; + + /* get program exec command line */ + cmdline = GetCommandLine(); + + /* check for " at beginning of string */ + if( *cmdline == '\"' ) { + /* copy command line, skip first quote */ + strcpy(tmp_win32_path, cmdline + 1); + + /* terminate at second set of quotes */ + tmpchar = strchr(tmp_win32_path, '\"'); + if (tmpchar) *tmpchar = 0; + } else { + /* copy command line */ + strcpy(tmp_win32_path, cmdline); + + /* terminate at first space */ + tmpchar = strchr(tmp_win32_path, ' '); + if (tmpchar) *tmpchar = 0; + } + + /* find the last occurance of a back + * slash or fore slash + */ + back_slash = strrchr(tmp_win32_path, '\\'); + fore_slash = strrchr(tmp_win32_path, '/'); + + /* make sure the last back slash was not + * after a drive letter + */ + if(back_slash > tmp_win32_path) + if(*( back_slash - 1 ) == ':') + back_slash = 0; + + /* which slash was the latter slash */ + if(back_slash > fore_slash) + last_slash = back_slash; + else + last_slash = fore_slash; + + /* detect if we had a relative or + * distiguished path ( had a slash ) + */ + if(last_slash) { + /* we had a slash charachter in our + * command line + */ + *(last_slash + 1) = 0; + + /* if had a string to append to the path */ + if(string) + strcat(tmp_win32_path, string); + } else { + if(string) { + /* if had a string to append to the path */ + strcpy(tmp_win32_path, string); + } else { + /* no slash, assume local directory */ + strcpy(tmp_win32_path, "."); + } + } + + return tmp_win32_path; +} +#endif + #ifndef BUFSIZ #define BUFSIZ 256 #endif diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 2825b2d64..2e9c2edd8 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xineutils.h,v 1.83 2004/03/29 19:10:36 mroi Exp $ + * $Id: xineutils.h,v 1.84 2004/04/06 19:20:17 valtri Exp $ * */ #ifndef XINEUTILS_H @@ -1096,6 +1096,10 @@ char *xine_get_system_encoding(void); char *basename (char const *name); #endif +#ifdef WIN32 +char *exec_path_append_subdir(char * string); +#endif + #ifdef __cplusplus } |