-int bsd_out_close();
-static int _parse_config_file(const char *);
-
-static void
-_do_reset(void)
-{
- bsd_out_close();
- _parse_config_file(_PATH_SYSLOG_CONF);
-}
-
-static char **
-_insertString(char *s, char **l, uint32_t x)
-{
- int i, len;
-
- if (s == NULL) return l;
- if (l == NULL)
- {
- l = (char **)malloc(2 * sizeof(char *));
- if (l == NULL) return NULL;
-
- l[0] = strdup(s);
- if (l[0] == NULL)
- {
- free(l);
- return NULL;
- }
-
- l[1] = NULL;
- return l;
- }
-
- for (i = 0; l[i] != NULL; i++);
- len = i + 1; /* count the NULL on the end of the list too! */
-
- l = (char **)reallocf(l, (len + 1) * sizeof(char *));
- if (l == NULL) return NULL;
-
- if ((x >= (len - 1)) || (x == IndexNull))
- {
- l[len - 1] = strdup(s);
- if (l[len - 1] == NULL)
- {
- free(l);
- return NULL;
- }
-
- l[len] = NULL;
- return l;
- }
-
- for (i = len; i > x; i--) l[i] = l[i - 1];
- l[x] = strdup(s);
- if (l[x] == NULL) return NULL;
-
- return l;
-}
-
-static char **
-_explode(char *s, char *delim)
-{
- char **l = NULL;
- char *p, *t;
- int i, n;
-
- if (s == NULL) return NULL;
-
- p = s;
- while (p[0] != '\0')
- {
- for (i = 0; ((p[i] != '\0') && (strchr(delim, p[i]) == NULL)); i++);
- n = i;
- t = malloc(n + 1);
- if (t == NULL) return NULL;
-
- for (i = 0; i < n; i++) t[i] = p[i];
- t[n] = '\0';
- l = _insertString(t, l, IndexNull);
- free(t);
- t = NULL;
- if (p[i] == '\0') return l;
- if (p[i + 1] == '\0') l = _insertString("", l, IndexNull);
- p = p + i + 1;
- }
-
- return l;
-}
-
-static void
-_freeList(char **l)
-{
- int i;
-
- if (l == NULL) return;
- for (i = 0; l[i] != NULL; i++) free(l[i]);
- free(l);
-}