Changeset 2fe5a2c748b2c568ac4977bc1a73309fedc68266
- Timestamp:
- 17/02/03 06:50:31
(6 years ago)
- Author:
- Sam Hocevar <sam@videolan.org>
- git-committer:
- Sam Hocevar <sam@videolan.org> 1045461031 +0000
- git-parent:
[b42e431cad7b298e96c9ed4d6e1338fc89297a84]
- git-author:
- Sam Hocevar <sam@videolan.org> 1045461031 +0000
- Message:
- ./src/misc/win32_specific.c: under Win32 we retrieve the executable's
directory whenever possible, to use it for the spudec font or to load
plugins.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r0e93bc6 |
r2fe5a2c |
|
| 4 | 4 | ***************************************************************************** |
|---|
| 5 | 5 | * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN |
|---|
| 6 | | * $Id: main.h,v 1.52 2003/01/19 03:16:24 sam Exp $ |
|---|
| | 6 | * $Id: main.h,v 1.53 2003/02/17 05:50:31 sam Exp $ |
|---|
| 7 | 7 | * |
|---|
| 8 | 8 | * Authors: Vincent Seguin <seguin@via.ecp.fr> |
|---|
| … | … | |
| 65 | 65 | vlc_bool_t b_fast_mutex; |
|---|
| 66 | 66 | int i_win9x_cv; |
|---|
| | 67 | char * psz_vlcpath; |
|---|
| 67 | 68 | #endif |
|---|
| 68 | 69 | }; |
|---|
| r98bd3d5 |
r2fe5a2c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2000-2001 VideoLAN |
|---|
| 5 | | * $Id: spudec.c,v 1.14 2003/01/30 16:36:04 gbazin Exp $ |
|---|
| | 5 | * $Id: spudec.c,v 1.15 2003/02/17 05:50:31 sam Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 55 | 55 | vlc_module_begin(); |
|---|
| 56 | 56 | add_category_hint( N_("subtitles"), NULL ); |
|---|
| 57 | | #if defined(SYS_DARWIN) || defined(SYS_BEOS) |
|---|
| | 57 | #if defined(SYS_DARWIN) || defined(SYS_BEOS) \ |
|---|
| | 58 | || (defined(WIN32) && !defined(UNDER_CE)) |
|---|
| 58 | 59 | add_file( "spudec-font", NULL, NULL, |
|---|
| 59 | 60 | FONT_TEXT, FONT_LONGTEXT ); |
|---|
| 60 | 61 | #else |
|---|
| 61 | | add_file( "spudec-font", "./share/" DEFAULT_FONT, NULL, |
|---|
| | 62 | add_file( "spudec-font", "share/" DEFAULT_FONT, NULL, |
|---|
| 62 | 63 | FONT_TEXT, FONT_LONGTEXT ); |
|---|
| 63 | 64 | #endif |
|---|
| … | … | |
| 136 | 137 | sprintf(psz_font, "%s/share/" DEFAULT_FONT, psz_vlcpath); |
|---|
| 137 | 138 | } |
|---|
| | 139 | #elif defined(WIN32) && !defined(UNDER_CE) |
|---|
| | 140 | if ( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL ) |
|---|
| | 141 | { |
|---|
| | 142 | char * psz_vlcpath = p_fifo->p_libvlc->psz_vlcpath; |
|---|
| | 143 | psz_font = malloc( strlen(psz_vlcpath) + strlen("\\share\\") |
|---|
| | 144 | + strlen(DEFAULT_FONT) + 1 ); |
|---|
| | 145 | sprintf(psz_font, "%s\\share\\" DEFAULT_FONT, psz_vlcpath); |
|---|
| | 146 | } |
|---|
| 138 | 147 | #else |
|---|
| 139 | 148 | if( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL ) |
|---|
| rf716766 |
r2fe5a2c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: modules.c,v 1.111 2003/01/27 17:41:01 ipkiss Exp $ |
|---|
| | 5 | * $Id: modules.c,v 1.112 2003/02/17 05:50:31 sam Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 552 | 552 | char ** ppsz_path = path; |
|---|
| 553 | 553 | char * psz_fullpath; |
|---|
| 554 | | #if defined( SYS_BEOS ) || defined( SYS_DARWIN ) |
|---|
| | 554 | #if defined( SYS_BEOS ) || defined( SYS_DARWIN ) \ |
|---|
| | 555 | || ( defined( WIN32 ) && !defined( UNDER_CE ) ) |
|---|
| 555 | 556 | int i_vlclen = strlen( p_this->p_libvlc->psz_vlcpath ); |
|---|
| 556 | 557 | vlc_bool_t b_notinroot; |
|---|
| … | … | |
| 567 | 568 | for( ; *ppsz_path != NULL ; ppsz_path++ ) |
|---|
| 568 | 569 | { |
|---|
| 569 | | #if defined( SYS_BEOS ) || defined( SYS_DARWIN ) |
|---|
| | 570 | #if defined( SYS_BEOS ) || defined( SYS_DARWIN ) \ |
|---|
| | 571 | || ( defined( WIN32 ) && !defined( UNDER_CE ) ) |
|---|
| 570 | 572 | /* Store strlen(*ppsz_path) for later use. */ |
|---|
| 571 | 573 | int i_dirlen = strlen( *ppsz_path ); |
|---|
| … | … | |
| 574 | 576 | /* Under BeOS, we need to add beos_GetProgramPath() to access |
|---|
| 575 | 577 | * files under the current directory */ |
|---|
| 576 | | if( ( i_dirlen > 1 ) && strncmp( *ppsz_path, "/", 1 ) ) |
|---|
| | 578 | #ifdef WIN32 |
|---|
| | 579 | if( i_dirlen < 3 || ppsz_path[3] != '\\' ) |
|---|
| | 580 | #else |
|---|
| | 581 | if( ppsz_path[0] != '/' ) |
|---|
| | 582 | #endif |
|---|
| 577 | 583 | { |
|---|
| 578 | 584 | i_dirlen += i_vlclen + 2; |
|---|
| r0e93bc6 |
r2fe5a2c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: win32_specific.c,v 1.20 2003/01/19 03:16:24 sam Exp $ |
|---|
| | 5 | * $Id: win32_specific.c,v 1.21 2003/02/17 05:50:31 sam Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 40 | 40 | WSADATA Data; |
|---|
| 41 | 41 | int i_err; |
|---|
| | 42 | |
|---|
| | 43 | /* Get our full path */ |
|---|
| | 44 | if( ppsz_argv[0] ) |
|---|
| | 45 | { |
|---|
| | 46 | char psz_path[MAX_PATH]; |
|---|
| | 47 | char *psz_vlc; |
|---|
| | 48 | |
|---|
| | 49 | GetFullPathName( ppsz_argv[0], MAX_PATH, psz_path, &psz_vlc ); |
|---|
| | 50 | |
|---|
| | 51 | if( psz_vlc > psz_path && psz_vlc[-1] == '\\' ) |
|---|
| | 52 | { |
|---|
| | 53 | psz_vlc[-1] = '\0'; |
|---|
| | 54 | p_this->p_libvlc->psz_vlcpath = strdup( psz_path ); |
|---|
| | 55 | } |
|---|
| | 56 | else |
|---|
| | 57 | { |
|---|
| | 58 | p_this->p_libvlc->psz_vlcpath = strdup( "" ); |
|---|
| | 59 | } |
|---|
| | 60 | } |
|---|
| | 61 | else |
|---|
| | 62 | { |
|---|
| | 63 | p_this->p_libvlc->psz_vlcpath = strdup( "" ); |
|---|
| | 64 | } |
|---|
| 42 | 65 | |
|---|
| 43 | 66 | /* WinSock Library Init. */ |
|---|