-/** Grab clients that are attached to a btr node. */
-static struct list_head active_grab_client_list;
+/** Describes one active grab client. */
+struct grab_client {
+ /* The value of the -p option. */
+ char *parent;
+ /* The value of the -n option. */
+ char *name;
+ /** The file descriptor to send the grabbed stream to. */
+ int fd;
+ /** See \ref grab_mode. */
+ enum grab_mode mode;
+ /** Flags given at the command line. */
+ enum grab_flags flags;
+ /** The point of the grab client's node in the buffer tree. */
+ struct btr_node *btrn;
+ /* The task of this grab client. */
+ struct task task;
+ /** Belongs to either the active or the inactive list. */
+ struct list_head node;
+};
+
+/* Grab clients that are attached to a btr node. */
+static INITIALIZED_LIST_HEAD(active_grab_client_list);
+/* Grab clients that are not currently attached any btr node. */
+static INITIALIZED_LIST_HEAD(inactive_grab_client_list);