#include "oconfig.h"
-/* Functions provided by the scanner */
-void yyset_in (FILE *);
+extern FILE *yyin;
oconfig_item_t *ci_root;
+static void yyset_in (FILE *fd)
+{
+ yyin = fd;
+} /* void yyset_in */
+
oconfig_item_t *oconfig_parse_fh (FILE *fh)
{
int status;
{
int i;
+ if (ci == NULL)
+ return;
+
+ if (ci->key != NULL)
+ free (ci->key);
+
+ for (i = 0; i < ci->values_num; i++)
+ if ((ci->values[i].type == OCONFIG_TYPE_STRING)
+ && (NULL != ci->values[i].value.string))
+ free (ci->values[i].value.string);
+
if (ci->values != NULL)
free (ci->values);
for (i = 0; i < ci->children_num; i++)
oconfig_free (ci->children + i);
+
+ if (ci->children != NULL)
+ free (ci->children);
}
/*