-/**
- * check a file descriptor for writability
- *
- * \param fd the file desctiptor
- *
- * \return positive if fd is ready for writing, zero if it isn't, negative if
- * an error occured.
- */
+/** Describes one client, connected to a paraslash sender. */
+struct sender_client {
+ /** The file descriptor of the client. */
+ int fd;
+ /** The socket "name" of the client. */
+ char *name;
+ /** The position of this client in the client list. */
+ struct list_head node;
+ /** Non-zero if audio file header has been sent. */
+ int header_sent;
+ /** The list of pending chunks for this client. */
+ struct chunk_queue *cq;
+ /** Data specific to the particular sender. */
+ void *private_data;
+};
+
+struct sender_status {
+ int listen_fd;
+ int port;
+ int num_clients;
+ int max_clients;
+ int default_deny;
+ /** The list of connected clients. */
+ struct list_head client_list;
+ /** The whitelist/blacklist. */
+ struct list_head acl;
+};
+
+void shutdown_client(struct sender_client *sc, struct sender_status *ss);
+void shutdown_clients(struct sender_status *ss);
+void send_chunk(struct sender_client *sc, struct sender_status *ss,
+ size_t max_bytes_per_write, long unsigned current_chunk,
+ const char *buf, size_t len);
+void init_sender_status(struct sender_status *ss, char **access_arg, int num_access_args,
+ int port, int max_clients, int default_deny);
+char *get_sender_info(struct sender_status *ss, char *name);