- "\n'*' means '*:d' and <tag> by itself means <tag>:v\n"
- "If no filterspec is found, filter defaults to '*:I'\n"
- "\nIf not specified with -v, format is set defaults to \"brief\"\n\n");
+ "\n'*' means '*:D' and <tag> by itself means <tag>:V\n"
+ "If no filterspec is found, filter defaults to '*:I'\n\n");
+}
+
+
+/*
+ * free one log_device_t and it doesn't take care of chain so it
+ * may break the chain list
+ */
+static void log_devices_free(struct log_device_t *dev)
+{
+ if (!dev)
+ return;
+
+ if (dev->device)
+ free(dev->device);
+
+ if (dev->queue) {
+ while (dev->queue->next) {
+ struct queued_entry_t *tmp = dev->queue->next;
+ dev->queue->next = tmp->next;
+ free(tmp);
+ }
+ free(dev->queue);
+ }
+
+ free(dev);
+ dev = NULL;
+}
+
+
+/*
+ * free all the nodes after the "dev" and includes itself
+ */
+static void log_devices_chain_free(struct log_device_t *dev)
+{
+ if (!dev)
+ return;
+
+ while (dev->next) {
+ struct log_device_t *tmp = dev->next;
+ dev->next = tmp->next;
+ log_devices_free(tmp);
+ }
+
+ log_devices_free(dev);
+ dev = NULL;
+}
+
+
+/*
+ * create a new log_device_t instance but don't care about
+ * the device node accessable or not
+ */
+static struct log_device_t *log_devices_new(const char *path)
+{
+ struct log_device_t *new;