2005-11-28 21:35:02 +00:00
|
|
|
/*
|
|
|
|
*
|
2006-09-15 14:55:39 +00:00
|
|
|
* (c) 2005 Laurent Vivier <Laurent@lvivier.info>
|
2005-11-28 21:35:02 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "libemile.h"
|
|
|
|
|
|
|
|
void emile_second_remove_property(char *configuration, char *name)
|
|
|
|
{
|
|
|
|
int index = 0;
|
|
|
|
int current = 0;
|
|
|
|
char current_name[256];
|
|
|
|
char current_property[256];
|
|
|
|
|
2005-11-28 23:18:10 +00:00
|
|
|
while (configuration[index])
|
2005-11-28 21:35:02 +00:00
|
|
|
{
|
|
|
|
index = emile_second_get_next_property(configuration, index, current_name, current_property);
|
|
|
|
if (strcmp(name, current_name) != 0)
|
|
|
|
{
|
|
|
|
memcpy(configuration + current, current_name, strlen(current_name));
|
|
|
|
current += strlen(current_name);
|
|
|
|
configuration[current++] = ' ';
|
|
|
|
memcpy(configuration + current, current_property, strlen(current_property));
|
|
|
|
current += strlen(current_property);
|
2005-11-28 23:18:10 +00:00
|
|
|
if (configuration[index])
|
|
|
|
configuration[current++] = '\n';
|
2005-11-28 21:35:02 +00:00
|
|
|
}
|
|
|
|
}
|
2005-11-28 23:18:10 +00:00
|
|
|
if (configuration[current-1] == '\n')
|
|
|
|
current--;
|
|
|
|
configuration[current++] = 0;
|
2005-11-28 21:35:02 +00:00
|
|
|
}
|