diff --git a/src/client/libdistren.h b/src/client/libdistren.h --- a/src/client/libdistren.h +++ b/src/client/libdistren.h @@ -27,20 +27,29 @@ #include "distren.h" #include "common/multiio.h" +#include "common/options.h" +#include "common/remoteio.h" struct distren { - distren_malloc_t malloc; - distren_free_t free; - struct options_common *options; /*< use a pointer just to avoid #include "options.h"? */ + struct options_common *options; char *server; + /* if rem is NULL, we're not connected to the server */ + struct remoteio *rem; + /* + * for libdistren_remoteio_read_handle(): determine whether or not + * we've passed through the server's hacky MOTD + */ + short done_ad; + + /* something on which to call multiio_poll() ;-) */ multiio_context_t multiio; }; struct distren_job { - char *jobid; + char *joburi; }; /* @@ -81,5 +90,19 @@ int _distren_getoptions(distren_t handle */ int _distren_loseoptions(distren_t handle); +/** + * Handle newly read data. + * + * Matches remoteio_read_handle_func_t + */ +size_t libdistren_remoteio_read_handle(struct remoteio *rem, void *garbage, void *buf, size_t len, distren_t distren); + +/** + * React to a remoteio-based connection closing. + * + * Matches remoteio_close_handle_func_t + */ +void libdistren_remoteio_close_handle(void *garbage, distren_t distren); + #endif