[BACK]Return to io.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / windows / asir32gui

Diff for /OpenXM_contrib2/windows/asir32gui/io.c between version 1.5 and 1.7

version 1.5, 2009/08/25 08:01:03 version 1.7, 2013/08/30 18:18:11
Line 38  char *errmsg;
Line 38  char *errmsg;
         LONG    ret;          LONG    ret;
         HKEY    hOpenKey;          HKEY    hOpenKey;
         DWORD   Type,dw;          DWORD   Type,dw;
         char    dir[BUFSIZ],message[BUFSIZ];          char    dir[BUFSIZ],message[BUFSIZ],engine[BUFSIZ];
         char    *slash;          char    *slash;
         int             ldir;          size_t  ldir;
         static  char rootdir[BUFSIZ];          static  char rootdir[BUFSIZ];
         static  int rootdir_is_initialized;          static  int rootdir_is_initialized;
   
Line 49  char *errmsg;
Line 49  char *errmsg;
                 return TRUE;                  return TRUE;
         }          }
   
       if(GetModuleFileName(NULL,dir,BUFSIZ)) {
           slash = strrchr(dir,'\\');
           *slash = 0;
           sprintf(engine,"%s\\engine.exe", dir);
           if ( access(engine,0) >= 0 ) {
               slash = strrchr(dir,'\\');
               if ( slash ) {
                   *slash = 0;
               }
               use_current_dir = 1;
               strcpy(rootdir,dir);
               strcpy(name,dir);
               rootdir_is_initialized = 1;
               return TRUE;
           }
       }
         GetCurrentDirectory(BUFSIZ,dir);          GetCurrentDirectory(BUFSIZ,dir);
         slash = strrchr(dir,'\\');          slash = strrchr(dir,'\\');
         if ( slash )          if ( slash )
Line 86  char *errmsg;
Line 102  char *errmsg;
                                 NULL);                                  NULL);
                         return FALSE;                          return FALSE;
                 }                  }
                 if ( ret = RegSetValueEx(hOpenKey,"Directory",NULL,REG_SZ,dir,ldir) ) {                  if ( ret = RegSetValueEx(hOpenKey,"Directory",0,REG_SZ,dir,ldir) ) {
                         FormatMessage(                          FormatMessage(
                                 FORMAT_MESSAGE_FROM_SYSTEM |                                  FORMAT_MESSAGE_FROM_SYSTEM |
                                 FORMAT_MESSAGE_IGNORE_INSERTS,                                  FORMAT_MESSAGE_IGNORE_INSERTS,
Line 104  char *errmsg;
Line 120  char *errmsg;
         strcpy(rootdir,name);          strcpy(rootdir,name);
         rootdir_is_initialized = 1;          rootdir_is_initialized = 1;
         return TRUE;          return TRUE;
   }
   
   const char *get_helpdir() {
       static char helpdir[BUFSIZ];
       static int helpdir_is_initialized;
       char lang[BUFSIZ];
       char file[BUFSIZ];
       char root[BUFSIZ];
       char errmsg[BUFSIZ];
   
       if( !helpdir_is_initialized ) {
           get_rootdir(root,sizeof(root),errmsg);
           GetLocaleInfo(GetUserDefaultLCID(), LOCALE_SISO639LANGNAME, lang, BUFSIZ);
           sprintf(helpdir, "%s\\help\\%s", root, lang);
           sprintf(file, "%s\\asirhelp.chm", helpdir);
           if ( access(file,0) < 0 ) {
               sprintf(helpdir, "%s\\help", root);
           }
           helpdir_is_initialized = 1;
       }
       return helpdir;
 }  }
   
 BOOL Init_IO(char *errmsg) {  BOOL Init_IO(char *errmsg) {

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

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