diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp index 3c45e182..d26a8843 100644 --- a/src/cpu/cpu.cpp +++ b/src/cpu/cpu.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: cpu.cpp,v 1.113 2008-08-06 18:31:26 c2woody Exp $ */ +/* $Id: cpu.cpp,v 1.114 2009-02-01 14:24:36 qbix79 Exp $ */ #include #include @@ -26,6 +26,7 @@ #include "debug.h" #include "mapper.h" #include "setup.h" +#include "programs.h" #include "paging.h" #include "lazyflags.h" #include "support.h" diff --git a/src/dos/dos_keyboard_layout.cpp b/src/dos/dos_keyboard_layout.cpp index 90d55d84..704f80ac 100644 --- a/src/dos/dos_keyboard_layout.cpp +++ b/src/dos/dos_keyboard_layout.cpp @@ -16,10 +16,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_keyboard_layout.cpp,v 1.18 2009-01-29 23:17:59 c2woody Exp $ */ +/* $Id: dos_keyboard_layout.cpp,v 1.19 2009-02-01 14:24:36 qbix79 Exp $ */ #include "dosbox.h" #include "bios.h" +#include "bios_disk.h" #include "setup.h" #include "support.h" #include "../ints/int10.h" diff --git a/src/dos/dos_mscdex.cpp b/src/dos/dos_mscdex.cpp index 55e942ed..ac2046ce 100644 --- a/src/dos/dos_mscdex.cpp +++ b/src/dos/dos_mscdex.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_mscdex.cpp,v 1.56 2008-11-06 19:31:21 c2woody Exp $ */ +/* $Id: dos_mscdex.cpp,v 1.57 2009-02-01 14:24:36 qbix79 Exp $ */ #include #include @@ -26,7 +26,7 @@ #include "dos_inc.h" #include "setup.h" #include "support.h" -#include "bios.h" +#include "bios_disk.h" #include "cpu.h" #include "cdrom.h" diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index eee5c927..c8795282 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_programs.cpp,v 1.90 2008-11-22 14:24:11 c2woody Exp $ */ +/* $Id: dos_programs.cpp,v 1.91 2009-02-01 14:24:36 qbix79 Exp $ */ #include "dosbox.h" #include @@ -35,11 +35,7 @@ #include "dos_inc.h" #include "bios.h" #include "setup.h" - -#if defined HAVE_SYS_TYPES_H && defined HAVE_PWD_H -#include -#include -#endif +#include "control.h" #if defined(OS2) @@ -54,24 +50,6 @@ Bitu DEBUG_EnableDebugger(void); void MSCDEX_SetCDInterface(int intNr, int forceCD); -//Helper function for mount and imgmount to correctly find the path -static void ResolveHomedir(std::string & temp_line) { - if(!temp_line.size() || temp_line[0] != '~') return; //No ~ - - if(temp_line.size() == 1 || temp_line[1] == CROSS_FILESPLIT) { //The ~ and ~/ variant - char * home = getenv("HOME"); - if(home) temp_line.replace(0,1,std::string(home)); -#if defined HAVE_SYS_TYPES_H && defined HAVE_PWD_H - } else { // The ~username variant - std::string::size_type namelen = temp_line.find(CROSS_FILESPLIT); - if(namelen == std::string::npos) namelen = temp_line.size(); - std::string username = temp_line.substr(1,namelen - 1); - struct passwd* pass = getpwnam(username.c_str()); - if(pass) temp_line.replace(0,namelen,pass->pw_dir); //namelen -1 +1(for the ~) -#endif // USERNAME lookup code - } -} - class MOUNT : public Program { public: @@ -227,7 +205,7 @@ public: #else if (stat(temp_line.c_str(),&test)) { failed = true; - ResolveHomedir(temp_line); + Cross::ResolveHomedir(temp_line); //Try again after resolving ~ if(!stat(temp_line.c_str(),&test)) failed = false; } @@ -480,7 +458,7 @@ private: if(tmpfile) return tmpfile; //File not found on mounted filesystem. Try regular filesystem std::string filename_s(filename); - ResolveHomedir(filename_s); + Cross::ResolveHomedir(filename_s); tmpfile = fopen(filename_s.c_str(),"rb+"); if(!tmpfile) { if( (tmpfile = fopen(filename_s.c_str(),"rb")) ) { @@ -1101,7 +1079,7 @@ public: if (stat(temp_line.c_str(),&test)) { //See if it works if the ~ are written out std::string homedir(temp_line); - ResolveHomedir(homedir); + Cross::ResolveHomedir(homedir); if(!stat(homedir.c_str(),&test)) { temp_line = homedir; } else { diff --git a/src/dos/drives.h b/src/dos/drives.h index c6febda2..a657a0c4 100644 --- a/src/dos/drives.h +++ b/src/dos/drives.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drives.h,v 1.39 2007-11-01 12:15:34 qbix79 Exp $ */ +/* $Id: drives.h,v 1.40 2009-02-01 14:24:36 qbix79 Exp $ */ #ifndef _DRIVES_H__ #define _DRIVES_H__ @@ -25,7 +25,7 @@ #include #include "dos_system.h" #include "shell.h" /* for DOS_Shell */ -#include "bios.h" /* for fatDrive */ +#include "bios_disk.h" /* for fatDrive */ bool WildFileCmp(const char * file, const char * wild); void Set_Label(char const * const input, char * const output, bool cdrom); diff --git a/src/gui/render.cpp b/src/gui/render.cpp index 7b0f9cfd..8e7311a5 100644 --- a/src/gui/render.cpp +++ b/src/gui/render.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: render.cpp,v 1.57 2008-08-06 18:32:34 c2woody Exp $ */ +/* $Id: render.cpp,v 1.58 2009-02-01 14:24:36 qbix79 Exp $ */ #include #include @@ -27,6 +27,7 @@ #include "video.h" #include "render.h" #include "setup.h" +#include "control.h" #include "mapper.h" #include "cross.h" #include "hardware.h" diff --git a/src/gui/sdl_gui.cpp b/src/gui/sdl_gui.cpp index 938b5a08..6c6a96e3 100644 --- a/src/gui/sdl_gui.cpp +++ b/src/gui/sdl_gui.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: sdl_gui.cpp,v 1.7 2008-08-06 18:32:34 c2woody Exp $ */ +/* $Id: sdl_gui.cpp,v 1.8 2009-02-01 14:24:36 qbix79 Exp $ */ #include "SDL.h" #include "../libs/gui_tk/gui_tk.h" @@ -27,6 +27,7 @@ #include "render.h" #include "mapper.h" #include "setup.h" +#include "control.h" #include "shell.h" #include diff --git a/src/hardware/cmos.cpp b/src/hardware/cmos.cpp index f5ff406e..25e0ba2d 100644 --- a/src/hardware/cmos.cpp +++ b/src/hardware/cmos.cpp @@ -16,6 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $Id: cmos.cpp,v 1.25 2009-02-01 14:24:37 qbix79 Exp $ */ + #include #include "dosbox.h" @@ -23,7 +25,7 @@ #include "pic.h" #include "inout.h" #include "mem.h" -#include "bios.h" +#include "bios_disk.h" #include "setup.h" static struct { diff --git a/src/hardware/serialport/nullmodem.cpp b/src/hardware/serialport/nullmodem.cpp index c11186d6..f343ace7 100644 --- a/src/hardware/serialport/nullmodem.cpp +++ b/src/hardware/serialport/nullmodem.cpp @@ -16,13 +16,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: nullmodem.cpp,v 1.5 2008-12-19 15:20:35 qbix79 Exp $ */ +/* $Id: nullmodem.cpp,v 1.6 2009-02-01 14:24:37 qbix79 Exp $ */ #include "dosbox.h" #if C_MODEM -#include "setup.h" // CommandLine +#include "control.h" #include "serialport.h" #include "nullmodem.h" diff --git a/src/ints/bios_keyboard.cpp b/src/ints/bios_keyboard.cpp index 46d70585..9a4a89af 100644 --- a/src/ints/bios_keyboard.cpp +++ b/src/ints/bios_keyboard.cpp @@ -23,6 +23,7 @@ #include "keyboard.h" #include "regs.h" #include "inout.h" +#include "dos_inc.h" /* SDL by default treats numlock and scrolllock different from all other keys. * Some linux distros disable this bad behaviour. (for example debian) diff --git a/src/ints/mouse.cpp b/src/ints/mouse.cpp index 08df6103..65cfe06c 100644 --- a/src/ints/mouse.cpp +++ b/src/ints/mouse.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: mouse.cpp,v 1.74 2008-08-03 15:52:06 qbix79 Exp $ */ +/* $Id: mouse.cpp,v 1.75 2009-02-01 14:24:38 qbix79 Exp $ */ #include #include @@ -32,7 +32,7 @@ #include "inout.h" #include "int10.h" #include "bios.h" - +#include "dos_inc.h" static Bitu call_int33,call_int74,int74_ret_callback,call_mouse_bd; static Bit16u ps2cbseg,ps2cbofs; diff --git a/src/ints/xms.cpp b/src/ints/xms.cpp index e6d91b86..8aafcf83 100644 --- a/src/ints/xms.cpp +++ b/src/ints/xms.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: xms.cpp,v 1.53 2008-10-05 14:44:52 qbix79 Exp $ */ +/* $Id: xms.cpp,v 1.54 2009-02-01 14:24:38 qbix79 Exp $ */ #include #include @@ -24,7 +24,7 @@ #include "callback.h" #include "mem.h" #include "regs.h" -#include "dos_system.h" +#include "dos_inc.h" #include "setup.h" #include "inout.h" #include "xms.h"