Пример #1
0
void *findGlobalCfgKey(char *key, int iKeyLen, int &iSize, char **opt, int *type){
   
#define GLOB_I_CHK(_K) \
if(iKeyLen+1==sizeof(#_K) &&  t_isEqual(key,#_K,iKeyLen)){\
if(type)*type=PHONE_CFG::e_tbint;\
if(opt)*opt=NULL;\
iSize=sizeof(g_Settings._K);\
return &g_Settings._K;\
}
   
#define GLOB_SZ_CHK(_K) \
if(iKeyLen+1==sizeof(#_K) &&  t_isEqual(key,#_K,iKeyLen)){\
if(type)*type=PHONE_CFG::e_char;\
if(opt)*opt=NULL;\
iSize=sizeof(g_Settings._K);\
return &g_Settings._K;\
}
#define GLOB_SZ_CHK_O(_K,_O) \
if(iKeyLen+1==sizeof(#_K) &&  t_isEqual(key,#_K,iKeyLen)){\
if(type)*type=PHONE_CFG::e_char;\
if(opt)*opt=(char *)_O;\
iSize=sizeof(g_Settings._K);\
return &g_Settings._K;\
}
   
   //
   
   GLOB_I_CHK(iDisableTwofish);
   GLOB_I_CHK(iDisableSkein);
   
   GLOB_I_CHK(iDisableECDH256);
   GLOB_I_CHK(iDisableECDH384);
   GLOB_I_CHK(iEnableSHA384);
   
   GLOB_I_CHK(iDisableAES256);
   GLOB_I_CHK(iDisableDH2K);
   GLOB_I_CHK(iDisable256SAS);
   GLOB_I_CHK(iClearZRTPCaches);
   GLOB_I_CHK(iClearZRTP_ZID);
   GLOB_I_CHK(iPreferDH2K);
   
   GLOB_I_CHK(iHideCfg);
   
   GLOB_I_CHK(iDontSimplifyVideoUI);
   GLOB_I_CHK(iDisplayUnsolicitedVideo);
   
   GLOB_I_CHK(iAudioUnderflow);
   GLOB_I_CHK(iRetroRingtone);
   
   GLOB_I_CHK(iPreferNIST);
   GLOB_I_CHK(iDisableSkeinHash);
   GLOB_I_CHK(iDisableBernsteinCurve3617);
   GLOB_I_CHK(iDisableBernsteinCurve25519);
   
   
   GLOB_I_CHK(iSASConfirmClickCount);
   
   GLOB_I_CHK(iShowRXLed);
   GLOB_I_CHK(iKeepScreenOnIfBatOk);
   
   GLOB_SZ_CHK(szLastUsedAccount);
   
   GLOB_SZ_CHK_O(szRingTone,"Default,Retro,Bells chromatic");
   //,Funny");
   
   
   return NULL;
}
Пример #2
0
void *findGlobalCfgKey(char *key, int iKeyLen, int &iSize, char **opt, int *type){
   
   if(key && key[0]=='*')return NULL;
   
#define GLOB_I_CHK(_K) \
if(iKeyLen+1==sizeof(#_K) &&  t_isEqual(key,#_K,iKeyLen)){\
if(type)*type=PHONE_CFG::e_tbint;\
if(opt)*opt=NULL;\
iSize=sizeof(g_Settings._K);\
return &g_Settings._K;\
}
   
#define GLOB_SZ_CHK(_K) \
if(iKeyLen+1==sizeof(#_K) &&  t_isEqual(key,#_K,iKeyLen)){\
if(type)*type=PHONE_CFG::e_char;\
if(opt)*opt=NULL;\
iSize=sizeof(g_Settings._K);\
return &g_Settings._K;\
}
#define GLOB_SZ_CHK_O(_K,_O) \
if(iKeyLen+1==sizeof(#_K) &&  t_isEqual(key,#_K,iKeyLen)){\
if(type)*type=PHONE_CFG::e_char;\
if(opt)*opt=(char *)_O;\
iSize=sizeof(g_Settings._K);\
return &g_Settings._K;\
}
   
   //
   
   GLOB_I_CHK(iDisableTwofish);
   GLOB_I_CHK(iDisableSkein);
   
   GLOB_I_CHK(iDisableECDH256);
   GLOB_I_CHK(iDisableECDH384);
   GLOB_I_CHK(iEnableSHA384);
   
   GLOB_I_CHK(iDisableAES256);
   GLOB_I_CHK(iDisableDH2K);
   GLOB_I_CHK(iDisable256SAS);
   GLOB_I_CHK(iClearZRTPCaches);
   GLOB_I_CHK(iClearZRTP_ZID);
   GLOB_I_CHK(iPreferDH2K);
   
   GLOB_I_CHK(iHideCfg);
   
   GLOB_I_CHK(iDontSimplifyVideoUI);
   GLOB_I_CHK(iDisplayUnsolicitedVideo);
   
   GLOB_I_CHK(iAudioUnderflow);

   GLOB_I_CHK(iForceFWTraversal);
   GLOB_I_CHK(iEnableFWTraversal);
   
   GLOB_I_CHK(iRetroRingtone);
   
   GLOB_I_CHK(iPreferNIST);
   GLOB_I_CHK(iDisableSkeinHash);
   GLOB_I_CHK(iDisableBernsteinCurve3617);
   GLOB_I_CHK(iDisableBernsteinCurve25519);
   
   
   GLOB_I_CHK(iSASConfirmClickCount);
   
   GLOB_I_CHK(iShowRXLed);
   GLOB_I_CHK(iKeepScreenOnIfBatOk);
   
   GLOB_I_CHK(iEnableDialHelper);
   
   GLOB_I_CHK(iEnableAirplay);

   GLOB_I_CHK(ai_volume);
   GLOB_I_CHK(ao_volume);
   
   GLOB_SZ_CHK(szLastUsedAccount);
   
   GLOB_SZ_CHK_O(szRingTone,&szRingToneNames[0]);
   
   //TODO if (this is changing) fix recent list and save 
   GLOB_SZ_CHK_O(szRecentsMaxHistory, "5 minutes,1 hour,12 hours,1 day,1 week,1 month,1 year");
   
   /*
    5 minutes
    1 hour
    12 hours
    1 day
    1 week
    1 month
    1 year
    */
   
#ifndef _WIN32
   const char *getDialingPrefCountryList(void);
   
   static int once=0;
   if(!once && (g_Settings.szDialingPrefCountry[0]==0 ||
      g_Settings.szDialingPrefCountry[2]==0) &&
      strcmp(key, "szDialingPrefCountry")==0){
      once=1;
      const char *getPrefLang(void);
      const char *getCountryByID(const char *);
      const char *lang = getPrefLang();
      strcpy(g_Settings.szDialingPrefCountry, getCountryByID(lang));
   }

   GLOB_SZ_CHK_O(szDialingPrefCountry,getDialingPrefCountryList());
#endif
   
   GLOB_SZ_CHK(szPutOnHoldSound);
   GLOB_SZ_CHK(szOnHoldMusic);
   GLOB_SZ_CHK(szWelcomeSound);
   
   return NULL;
}