# HG changeset patch # User diego # Date 1188300024 0 # Node ID 76f5d8892c04556e2daf40b3b85acc0c37b36769 # Parent e6c56a194610f1550778518cc49676a24a1e4fe8 Clean up the way get_path is handled: Compile get_path.c to an object to link against instead of directly #including the C file and replace the many extern declarations by a proper header file. diff -r e6c56a194610 -r 76f5d8892c04 Makefile --- a/Makefile Tue Aug 28 11:04:36 2007 +0000 +++ b/Makefile Tue Aug 28 11:20:24 2007 +0000 @@ -20,6 +20,7 @@ cpudetect.c \ edl.c \ find_sub.c \ + get_path.c \ m_config.c \ m_option.c \ m_struct.c \ diff -r e6c56a194610 -r 76f5d8892c04 command.c --- a/command.c Tue Aug 28 11:04:36 2007 +0000 +++ b/command.c Tue Aug 28 11:20:24 2007 +0000 @@ -28,6 +28,7 @@ #include "libmpcodecs/dec_video.h" #include "vobsub.h" #include "spudec.h" +#include "get_path.h" #ifdef USE_TV #include "stream/tv.h" #endif diff -r e6c56a194610 -r 76f5d8892c04 get_path.c --- a/get_path.c Tue Aug 28 11:04:36 2007 +0000 +++ b/get_path.c Tue Aug 28 11:20:24 2007 +0000 @@ -8,14 +8,17 @@ * by the caller. * */ + +#include +#include +#include +#include "mp_msg.h" + #ifdef MACOSX_BUNDLE #include #include #include -#include -#include #include -#include #endif char *get_path(const char *filename){ diff -r e6c56a194610 -r 76f5d8892c04 get_path.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get_path.h Tue Aug 28 11:20:24 2007 +0000 @@ -0,0 +1,27 @@ +/* + * Get path to config dir/file. + * + * This file is part of MPlayer. + * + * MPlayer 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 of the License, or + * (at your option) any later version. + * + * MPlayer 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 MPlayer; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef GET_PATH_H +#define GET_PATH_H + +char *get_path(const char *filename); +void set_path_env(); + +#endif /* GET_PATH_H */ diff -r e6c56a194610 -r 76f5d8892c04 gui/cfg.c --- a/gui/cfg.c Tue Aug 28 11:04:36 2007 +0000 +++ b/gui/cfg.c Tue Aug 28 11:20:24 2007 +0000 @@ -10,6 +10,7 @@ #include "mplayer.h" #include "m_config.h" #include "m_option.h" +#include "get_path.h" #include "libvo/sub.h" #include "libvo/video_out.h" #include "stream/stream.h" diff -r e6c56a194610 -r 76f5d8892c04 gui/interface.c --- a/gui/interface.c Tue Aug 28 11:04:36 2007 +0000 +++ b/gui/interface.c Tue Aug 28 11:20:24 2007 +0000 @@ -19,6 +19,7 @@ #include "app.h" #include "cfg.h" #include "help_mp.h" +#include "get_path.h" #include "libvo/x11_common.h" #include "libvo/video_out.h" #include "libvo/font_load.h" diff -r e6c56a194610 -r 76f5d8892c04 gui/interface.h --- a/gui/interface.h Tue Aug 28 11:04:36 2007 +0000 +++ b/gui/interface.h Tue Aug 28 11:20:24 2007 +0000 @@ -145,8 +145,6 @@ extern int use_gui; -extern char *get_path(const char *filename); - extern void guiInit( void ); extern void guiDone( void ); extern int guiGetEvent( int type,char * arg ); diff -r e6c56a194610 -r 76f5d8892c04 input/input.c --- a/input/input.c Tue Aug 28 11:04:36 2007 +0000 +++ b/input/input.c Tue Aug 28 11:20:24 2007 +0000 @@ -25,6 +25,7 @@ #include "help_mp.h" #include "m_config.h" #include "m_option.h" +#include "get_path.h" #include "joystick.h" @@ -1647,8 +1648,6 @@ return section; } -extern char *get_path(const char *filename); - void mp_input_init(int use_gui) { char* file; diff -r e6c56a194610 -r 76f5d8892c04 libaf/af_export.c --- a/libaf/af_export.c Tue Aug 28 11:04:36 2007 +0000 +++ b/libaf/af_export.c Tue Aug 28 11:20:24 2007 +0000 @@ -21,9 +21,7 @@ #include #include "af.h" - -extern char * get_path( const char * filename ); - +#include "get_path.h" #define DEF_SZ 512 // default buffer size (in samples) #define SHARED_FILE "mplayer-af_export" /* default file name diff -r e6c56a194610 -r 76f5d8892c04 libass/ass_mp.c --- a/libass/ass_mp.c Tue Aug 28 11:04:36 2007 +0000 +++ b/libass/ass_mp.c Tue Aug 28 11:20:24 2007 +0000 @@ -23,6 +23,7 @@ #include #include "mp_msg.h" +#include "get_path.h" #include "ass.h" #include "ass_utils.h" @@ -216,8 +217,6 @@ return track; } -char *get_path(char *); - void ass_configure(ass_renderer_t* priv, int w, int h, int unscaled) { int hinting; ass_set_frame_size(priv, w, h); diff -r e6c56a194610 -r 76f5d8892c04 libmpcodecs/dec_audio.c --- a/libmpcodecs/dec_audio.c Tue Aug 28 11:04:36 2007 +0000 +++ b/libmpcodecs/dec_audio.c Tue Aug 28 11:20:24 2007 +0000 @@ -202,8 +202,6 @@ return 0; } -extern char *get_path(const char *filename); - int init_best_audio_codec(sh_audio_t *sh_audio,char** audio_codec_list,char** audio_fm_list){ char* ac_l_default[2]={"",(char*)NULL}; // hack: diff -r e6c56a194610 -r 76f5d8892c04 libmpcodecs/dec_video.c --- a/libmpcodecs/dec_video.c Tue Aug 28 11:04:36 2007 +0000 +++ b/libmpcodecs/dec_video.c Tue Aug 28 11:20:24 2007 +0000 @@ -277,8 +277,6 @@ return 0; } -extern char *get_path(const char *filename); - int init_best_video_codec(sh_video_t *sh_video,char** video_codec_list,char** video_fm_list){ char* vc_l_default[2]={"",(char*)NULL}; // hack: diff -r e6c56a194610 -r 76f5d8892c04 libvo/font_load.c --- a/libvo/font_load.c Tue Aug 28 11:04:36 2007 +0000 +++ b/libvo/font_load.c Tue Aug 28 11:20:24 2007 +0000 @@ -10,8 +10,6 @@ #include "font_load.h" #include "mp_msg.h" -extern char *get_path ( char * ); - raw_file* load_raw(char *name,int verbose){ int bpp; raw_file* raw=malloc(sizeof(raw_file)); diff -r e6c56a194610 -r 76f5d8892c04 libvo/font_load_ft.c --- a/libvo/font_load_ft.c Tue Aug 28 11:04:36 2007 +0000 +++ b/libvo/font_load_ft.c Tue Aug 28 11:20:24 2007 +0000 @@ -33,14 +33,13 @@ #include "font_load.h" #include "mp_msg.h" #include "mplayer.h" +#include "get_path.h" #include "osd_font.h" #if (FREETYPE_MAJOR > 2) || (FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 1) #define HAVE_FREETYPE21 #endif -char *get_path(const char *filename); - char *subtitle_font_encoding = NULL; float text_font_scale_factor = 5.0; float osd_font_scale_factor = 6.0; diff -r e6c56a194610 -r 76f5d8892c04 libvo/vo_dxr2.c --- a/libvo/vo_dxr2.c Tue Aug 28 11:04:36 2007 +0000 +++ b/libvo/vo_dxr2.c Tue Aug 28 11:20:24 2007 +0000 @@ -18,6 +18,7 @@ #include "mp_msg.h" #include "m_option.h" #include "sub.h" +#include "get_path.h" #include "libmpdemux/mpeg_packetizer.h" #ifdef X11_FULLSCREEN @@ -27,8 +28,6 @@ #include -extern char *get_path(const char *filename); - extern float monitor_aspect; extern float movie_aspect; diff -r e6c56a194610 -r 76f5d8892c04 mencoder.c --- a/mencoder.c Tue Aug 28 11:04:36 2007 +0000 +++ b/mencoder.c Tue Aug 28 11:20:24 2007 +0000 @@ -48,7 +48,7 @@ #include "m_config.h" #include "parser-mecmd.h" -#include "get_path.c" +#include "get_path.h" #include "stream/stream.h" #include "libmpdemux/demuxer.h" diff -r e6c56a194610 -r 76f5d8892c04 mp_core.h --- a/mp_core.h Tue Aug 28 11:04:36 2007 +0000 +++ b/mp_core.h Tue Aug 28 11:20:24 2007 +0000 @@ -124,7 +124,6 @@ double playing_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio, ao_functions_t *audio_out); void exit_player_with_rc(const char* how, int rc); -char *get_path(const char *filename); void rm_osd_msg(int id); void add_subtitles(char *filename, float fps, int silent); int reinit_video_chain(void); diff -r e6c56a194610 -r 76f5d8892c04 mplayer.c --- a/mplayer.c Tue Aug 28 11:04:36 2007 +0000 +++ b/mplayer.c Tue Aug 28 11:20:24 2007 +0000 @@ -142,7 +142,7 @@ return m_config_parse_config_file(mconfig, filename); } -#include "get_path.c" +#include "get_path.h" //**************************************************************************// // XScreensaver diff -r e6c56a194610 -r 76f5d8892c04 stream/stream_dvb.c --- a/stream/stream_dvb.c Tue Aug 28 11:04:36 2007 +0000 +++ b/stream/stream_dvb.c Tue Aug 28 11:20:24 2007 +0000 @@ -44,6 +44,7 @@ #include "help_mp.h" #include "m_option.h" #include "m_struct.h" +#include "get_path.h" #include "libavutil/avstring.h" #include "dvbin.h" @@ -584,8 +585,6 @@ -extern char *get_path(const char *); - static void dvbin_close(stream_t *stream) { int i;