terom@9: #ifndef REMOTE_POOL_H terom@9: #define REMOTE_POOL_H terom@9: terom@9: #include "remote_node.h" terom@9: terom@9: // maximum number of nodes in a remote pool terom@9: #define REMOTE_POOL_MAX 8 terom@9: terom@9: // how many bytes long each line in a pool file may be terom@9: #define POOL_FILE_LINE_LENGTH 512 terom@9: terom@9: struct remote_pool { terom@9: // the remote_nodes are part of this struct terom@9: struct remote_node nodes[REMOTE_POOL_MAX]; terom@9: }; terom@9: terom@9: /* terom@9: * Initialize the given remote_pool terom@9: */ terom@9: void remote_pool_init (struct remote_pool *pool_info); terom@9: terom@9: /* terom@9: * Add a remote_node to the pool, see remote_node_init terom@9: */ terom@26: int remote_pool_add (struct remote_pool *pool_info, const char *addr_spec); terom@9: terom@9: /* terom@9: * Adds remote_nodes to the pool based on the contents of the given file terom@9: * terom@9: * The format for the file is a set of ":" lines, see terom@9: * parse_hostport in common.h. Blank lines are skipped, and any comments terom@9: * prefixed with a '#' char is ignored. Whitespace inside lines is also terom@9: * ignored. terom@9: * terom@9: * Returns however many nodes were added (possibly zero), or -1 on error terom@9: */ terom@9: int remote_pool_load (struct remote_pool *pool_info, const char *filename); terom@9: terom@9: /* terom@9: * Choose a remote_node from the pool terom@9: * terom@9: * Attempts to pick the one that's least busy terom@9: */ terom@9: struct remote_node *remote_pool_get (struct remote_pool *pool_info); terom@9: terom@9: /* terom@9: * Get the number of remote render nodes in this pool terom@9: */ terom@9: int remote_pool_size (struct remote_pool *pool_info); terom@9: terom@9: #endif /* REMOTE_POOL_H */