Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/ttpset/ttset.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9429 by zmatsuo, Sun Sep 19 15:13:51 2021 UTC revision 9431 by zmatsuo, Sun Sep 19 15:14:16 2021 UTC
# Line 3593  void PASCAL WriteIniFile(const wchar_t * Line 3593  void PASCAL WriteIniFile(const wchar_t *
3593          WriteInt(Section, "UnicodeEmojiWidth", FName, ts->UnicodeEmojiWidth);          WriteInt(Section, "UnicodeEmojiWidth", FName, ts->UnicodeEmojiWidth);
3594  }  }
3595    
3596  void PASCAL CopySerialList(PCHAR IniSrcA, PCHAR IniDestA, PCHAR section,  void PASCAL CopySerialList(const wchar_t *IniSrc, const wchar_t *IniDest, const wchar_t *section,
3597                                 PCHAR key, int MaxList)                                                     const wchar_t *key, int MaxList)
3598  {  {
3599          int i, j;          int i, j;
3600          char EntName[10], EntName2[10];          wchar_t EntName[10], EntName2[10];
3601          char TempHost[HostNameMaxLength + 1];          wchar_t TempHost[HostNameMaxLength + 1];
 #if     INI_FILE_IS_UNICODE  
         const wchar_t *IniSrc = ToWcharA(IniSrcA);  
         const wchar_t *IniDest = ToWcharA(IniDestA);  
 #else  
         const char *IniSrc = IniSrcA;  
         const char *IniDest = IniDestA;  
 #endif  
3602    
 #if     INI_FILE_IS_UNICODE  
3603          if (_wcsicmp(IniSrc, IniDest) == 0)          if (_wcsicmp(IniSrc, IniDest) == 0)
3604                  return;                  return;
 #else  
         if (_stricmp(IniSrc, IniDest) == 0)  
                 return;  
 #endif  
3605    
3606          WritePrivateProfileString(section, NULL, NULL, IniDest);          WritePrivateProfileStringW(section, NULL, NULL, IniDest);
3607    
3608          i = j = 1;          i = j = 1;
3609          do {          do {
3610                  _snprintf_s(EntName, sizeof(EntName), _TRUNCATE, "%s%i", key, i);                  _snwprintf_s(EntName, _countof(EntName), _TRUNCATE, L"%s%i", key, i);
3611                  _snprintf_s(EntName2, sizeof(EntName2), _TRUNCATE, "%s%i", key, j);                  _snwprintf_s(EntName2, _countof(EntName2), _TRUNCATE, L"%s%i", key, j);
3612    
3613                  /* Get one hostname from file IniSrc */                  /* Get one hostname from file IniSrc */
3614                  GetPrivateProfileString(section, EntName, "",                  GetPrivateProfileStringW(section, EntName, L"",
3615                                          TempHost, sizeof(TempHost), IniSrc);                                          TempHost, _countof(TempHost), IniSrc);
3616                  /* Copy it to the file IniDest */                  /* Copy it to the file IniDest */
3617                  if (strlen(TempHost) > 0) {                  if (TempHost[0] != 0) {
3618                          WritePrivateProfileString(section, EntName2, TempHost, IniDest);                          WritePrivateProfileStringW(section, EntName2, TempHost, IniDest);
3619                          j++;                          j++;
3620                  }                  }
3621                  i++;                  i++;
# Line 3635  void PASCAL CopySerialList(PCHAR IniSrcA Line 3623  void PASCAL CopySerialList(PCHAR IniSrcA
3623          while (i <= MaxList);          while (i <= MaxList);
3624    
3625          /* update file */          /* update file */
3626          WritePrivateProfileString(NULL, NULL, NULL, IniDest);          WritePrivateProfileStringW(NULL, NULL, NULL, IniDest);
3627  }  }
3628    
3629  void PASCAL AddValueToList(PCHAR FNameA, PCHAR Host, PCHAR section,  void PASCAL AddValueToList(PCHAR FNameA, PCHAR Host, PCHAR section,
# Line 3704  void PASCAL AddValueToList(PCHAR FNameA, Line 3692  void PASCAL AddValueToList(PCHAR FNameA,
3692  }  }
3693    
3694   /* copy hostlist from source IniFile to dest IniFile */   /* copy hostlist from source IniFile to dest IniFile */
3695  void PASCAL CopyHostList(PCHAR IniSrc, PCHAR IniDest)  void PASCAL CopyHostList(const wchar_t *IniSrc, const wchar_t *IniDest)
3696  {  {
3697          CopySerialList(IniSrc, IniDest, "Hosts", "Host", MAXHOSTLIST);          CopySerialList(IniSrc, IniDest, L"Hosts", L"Host", MAXHOSTLIST);
3698  }  }
3699    
3700  void PASCAL AddHostToList(PCHAR FName, PCHAR Host)  void PASCAL AddHostToList(PCHAR FName, PCHAR Host)

Legend:
Removed from v.9429  
changed lines
  Added in v.9431

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26