2007-08-26 20:10:17 +00:00
|
|
|
/*
|
|
|
|
*
|
2013-09-05 12:39:22 +00:00
|
|
|
* (c) 2007 Laurent Vivier <Laurent@Vivier.EU>
|
2007-08-26 20:10:17 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "libconfig.h"
|
|
|
|
|
2007-09-08 23:09:14 +00:00
|
|
|
int config_add_property(int8_t* configuration, char* name, char* property)
|
2007-08-26 20:10:17 +00:00
|
|
|
{
|
2007-09-08 23:09:14 +00:00
|
|
|
int index = strlen((char*)configuration);
|
2007-08-26 20:10:17 +00:00
|
|
|
|
|
|
|
if (index > 0)
|
|
|
|
{
|
|
|
|
configuration[index] = '\n';
|
|
|
|
index++;
|
|
|
|
}
|
2007-09-08 23:09:14 +00:00
|
|
|
sprintf((char*)configuration + index,
|
2007-08-26 20:10:17 +00:00
|
|
|
"%s %s", name, property);
|
2007-08-31 20:42:27 +00:00
|
|
|
|
|
|
|
return index;
|
2007-08-26 20:10:17 +00:00
|
|
|
}
|