示例#1
0
文件: profport.cpp 项目: Andux/jack2
/***************************************************************************
 * Function:    write_private_profile_int()
 * Arguments:   <char *> section - the name of the section to search for
 *              <char *> entry - the name of the entry to find the value of
 *              <int> buffer - the value to be written
 *              <char *> file_name - the name of the .ini file to read from
 * Returns:     TRUE if successful, otherwise FALSE
 ***************************************************************************/
int write_private_profile_int(char *section,
    char *entry, int val, char *file_name)
{
    char buffer [64];
    sprintf(buffer, "%d", val);
    return write_private_profile_string (section,entry, buffer, file_name);
}
示例#2
0
int delete_ini_section(char *section)
{
	if(ini_file[0]!=0)
		return WritePrivateProfileString(section,NULL,NULL,ini_file);
	else
		return write_private_profile_string(section,NULL,NULL,&ram_ini);
}
示例#3
0
int write_ini_str(char *section,char *key,char *str)
{
	if(ini_file[0]!=0){
		if(WritePrivateProfileString(section,key,str,ini_file)!=0)
			return TRUE;
		else
			return FALSE;
	}
	else{
		if(write_private_profile_string(section,key,str,&ram_ini)!=0)
			return TRUE;
		else
			return FALSE;
	}
}
示例#4
0
int write_ini_value(char *section,char *key,int val)
{
	char str[20]={0};
	_snprintf(str,sizeof(str),"%i",val);
	if(ini_file[0]!=0){
		if(WritePrivateProfileString(section,key,str,ini_file)!=0)
			return TRUE;
		else
			return FALSE;
	}
	else{
		if(write_private_profile_string(section,key,str,&ram_ini)!=0)
			return TRUE;
		else
			return FALSE;
	}
}