[BACK]Return to file.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / builtin

Diff for /OpenXM_contrib2/asir2000/builtin/file.c between version 1.6 and 1.7

version 1.6, 2000/08/25 08:06:19 version 1.7, 2000/11/08 06:21:17
Line 45 
Line 45 
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  *   *
  * $OpenXM: OpenXM_contrib2/asir2000/builtin/file.c,v 1.5 2000/08/22 05:03:57 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/builtin/file.c,v 1.6 2000/08/25 08:06:19 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
Line 374  Obj *rp;
Line 374  Obj *rp;
         ox_file_io = 0;          ox_file_io = 0;
 }  }
   
   static struct oSTRING rootdir;
   
 #if defined(VISUAL)  #if defined(VISUAL)
 void get_rootdir(name,len)  void get_rootdir(name,len)
 char *name;  char *name;
Line 382  int len;
Line 384  int len;
         LONG    ret;          LONG    ret;
         HKEY    hOpenKey;          HKEY    hOpenKey;
         DWORD   Type;          DWORD   Type;
           char    *slash;
   
           if ( rootdir.body ) {
                   strcpy(name,rootdir.body);
                   return;
           }
         name[0] = 0;          name[0] = 0;
         ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, ECGEN_KEYNAME, 0,          ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, ECGEN_KEYNAME, 0,
                 KEY_QUERY_VALUE, &hOpenKey);                  KEY_QUERY_VALUE, &hOpenKey);
Line 392  int len;
Line 399  int len;
         if( ret == ERROR_SUCCESS ) {          if( ret == ERROR_SUCCESS ) {
                 RegQueryValueEx(hOpenKey, "Directory", NULL, &Type, name, &len);                  RegQueryValueEx(hOpenKey, "Directory", NULL, &Type, name, &len);
                 RegCloseKey(hOpenKey);                  RegCloseKey(hOpenKey);
           } else {
                   GetCurrentDirectory(len,name);
                   slash = strrchr(name,'\\');
                   if ( slash )
                           *slash = 0;
         }          }
 }  }
   
   void set_rootdir(name)
   char *name;
   {
           static char DirName[BUFSIZ];
   
           strcpy(DirName,name);
           rootdir.id = O_STR;
           rootdir.body = DirName;
           asir_libdir = DirName;
           /* XXX */
           env_init();
   }
   
 #else  #else
 void get_rootdir(name,len)  void get_rootdir(name,len)
 char *name;  char *name;
Line 401  int len;
Line 427  int len;
 {  {
         strcpy(name,asir_libdir);          strcpy(name,asir_libdir);
 }  }
   
   void set_rootdir(name)
   char *name;
   {
           static char DirName[BUFSIZ];
   
           strcpy(DirName,name);
           asir_libdir = DirName;
           /* XXX */
           env_init();
   }
   
 #endif  #endif
   
 void Pget_rootdir(rp)  void Pget_rootdir(rp)
 STRING *rp;  STRING *rp;
 {  {
         static struct oSTRING rootdir;  
         static char DirName[BUFSIZ];          static char DirName[BUFSIZ];
         int DirNameLen;          int DirNameLen;
   

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>