1 #ifdef RCSID
2 static char RCSid[] =
3 "$Header$";
4 #endif
5 
6 /*
7  *   Copyright (c) 1999, 2002 Michael J. Roberts.  All Rights Reserved.
8  *
9  *   Please see the accompanying license file, LICENSE.TXT, for information
10  *   on using and copying this software.
11  */
12 /*
13 Name
14   vmhostsi.cpp - stdio-based VM host application environment
15 Function
16 
17 Notes
18 
19 Modified
20   08/06/99 MJRoberts  - Creation
21 */
22 
23 #include "t3std.h"
24 #include "os.h"
25 #include "resload.h"
26 #include "vmhost.h"
27 #include "vmhostsi.h"
28 
29 /*
30  *   initialize
31  */
CVmHostIfcStdio(const char * argv0)32 CVmHostIfcStdio::CVmHostIfcStdio(const char *argv0)
33 {
34     char buf[OSFNMAX];
35 
36 
37     /*
38      *   Create the resource loader for character mapping files in the
39      *   same directory as the executable.
40      */
41     os_get_special_path(buf, sizeof(buf), argv0, OS_GSP_T3_RES);
42     cmap_loader_ = new CResLoader(buf);
43 
44     /* set the executable filename in the loader, if available */
45     if (os_get_exe_filename(buf, sizeof(buf), argv0))
46         cmap_loader_->set_exe_filename(buf);
47 
48     /*
49      *   the default safety level allows reading and writing to the current
50      *   directory only
51      */
52     io_safety_ = VM_IO_SAFETY_READWRITE_CUR;
53 }
54 
55 /*
56  *   delete
57  */
~CVmHostIfcStdio()58 CVmHostIfcStdio::~CVmHostIfcStdio()
59 {
60     /* delete our character map resource loader */
61     delete cmap_loader_;
62 }
63