plugins.
* A `df' plugin has been added.
* A `mysql' plugin has been added.
- * A signal handler for SIGTERM has been added. Signal handlers have
- been improved, too.
2005-12-18, Version 3.5.1
* The PID-file is now deleted correctly when shutting down the daemon.
static int rra_num = 9;
#endif /* HAVE_LIBRRD */
-void
-sstrncpy(char *d, const char *s, int len)
+void sstrncpy (char *d, const char *s, int len)
{
- strncpy(d, s, len);
- d[len - 1] = 0;
+ strncpy (d, s, len);
+ d[len - 1] = '\0';
}
-char *
-sstrdup(const char *s)
+char *sstrdup (const char *s)
{
- char *r = strdup(s);
- if(r == NULL) {
- DBG("Not enough memory.");
+ char *r;
+
+ if((r = strdup (s)) == NULL)
+ {
+ DBG ("Not enough memory.");
exit(3);
}
- return r;
+
+ return (r);
}
-void *
-smalloc(size_t size)
+void *smalloc (size_t size)
{
- void *r = malloc(size);
- if(r == NULL) {
+ void *r;
+
+ if ((r = malloc (size)) == NULL)
+ {
DBG("Not enough memory.");
exit(3);
}
+
return r;
}
+#if 0
+void sfree (void **ptr)
+{
+ if (ptr == NULL)
+ return;
+
+ if (*ptr != NULL)
+ free (*ptr);
+
+ *ptr = NULL;
+}
+#endif
+
int strsplit (char *string, char **fields, size_t size)
{
size_t i;
int mode;
} cf_mode_item_t;
+/* TODO
+ * - LogFile
+ * - DontFork
+ */
static cf_mode_item_t cf_mode_list[] =
{
{"Server", NULL, MODE_CLIENT },
return (LC_CBRET_OKAY);
}
-/* XXX think about how to do the command line stuff */
+/*
+ * `cf_callback_mode_switch'
+ * Change the contents of the global variable `operating_mode'
+ *
+ * This should be command line options. One *can* do this in the config
+ * files, but I will not document this. Don't whine abount it not working as
+ * you expect if you do it anyways.
+ */
int cf_callback_mode_switch (const char *shortvar, const char *var,
const char *arguments, const char *value, lc_flags_t flags,
void *extra)