自己包的函数,看看就应该知道了吧……
int KF_create_child_rule(char *class_name, char *child_name,
char **para_name, char **para_value,
int count)
{
int response=0;
char rule_content[600];
char temp_string[133];
int i;
/*create the child rule*/
sprintf(temp_string, "{class;%s;",class_name);
strcpy(rule_content,temp_string);
if (count > 0)
{
for (i = 0; i< count; i++)
{
sprintf(temp_string, "%s;%s;",para_name[i],para_value[i]);
strcat(rule_content,temp_string);
}
}
strcat(rule_content,"}");
response = UF_KF_create_rule("root:",
child_name,
"child",
rule_content,
NULL );
return response;
} |