float get_private_profile_float (char * section, char * entry, float def, char * file_name) { float result = def; char buffer[ maxFloatLen ], *endptr; if ( get_private_profile_string(section, entry, "", buffer, maxFloatLen, file_name) > 0 ) { result = (float)strtod(buffer, &endptr); if ((result==0) && (endptr==buffer)) result = def; } return result; }
int get_ini_str(char *section,char *key,char *str,int size) { int result=0; char tmpstr[1024]={0}; if(ini_file[0]!=0){ result=GetPrivateProfileString(section,key,"",tmpstr,sizeof(tmpstr),ini_file); if(result>0) strncpy(str,tmpstr,size); }else{ result=get_private_profile_string(section,key,"",tmpstr,sizeof(tmpstr),&ram_ini); if(result>0) strncpy(str,tmpstr,size); } return result>0; }
int get_ini_value(char *section,char *key,int *val) { char str[255]={0}; int result=0; if(ini_file[0]!=0){ result=GetPrivateProfileString(section,key,"",str,sizeof(str),ini_file); if(str[0]!=0) *val=atoi(str); } else{ result=get_private_profile_string(section,key,"",str,sizeof(str),&ram_ini); if(str[0]!=0) *val=atoi(str); } return result>0; }
static void LaunchTargets() { char buff[1024], *next, *ptr; int n = get_private_profile_string (NetSectionName, Targets, "", buff, 1024, MakeMSFullName (profileName)); if (n) { while (MidiGetTime() < 10) usleep (10000); ptr = NextCnx (buff, true); while (ptr) { next = NextCnx (ptr, false); if (next) { next[-1] = 0; Connect (ptr); next[-1] = ' '; } else Connect (ptr); ptr = next; } } }