# HG changeset patch # User Binki # Date 2009-10-21 18:50:03 # Node ID 0aeea9ae766575126ef0c7b86e0427ecd8b1527b # Parent b731174bd349b2506ab4401eedffd1833321d72c update enum remoteio_method and funcmap diff --git a/src/common/libremoteio.h b/src/common/libremoteio.h --- a/src/common/libremoteio.h +++ b/src/common/libremoteio.h @@ -30,9 +30,12 @@ enum remoteio_method { REMOTEIO_METHOD_SSH = 0, +#ifndef WINDOWS + REMOTEIO_METHOD_UNIX = 1, +#endif /* REMOTEIO_METHOD_TCP */ /*< someday, maybe */ /* REMOETIO_METHOD_XMLRPC */ /*< again, maybe someday */ - REMOTEIO_METHOD_MAX = 1 /*< This is a number used to check the consitency of remoteio_server structs */ + REMOTEIO_METHOD_MAX = 2 /*< This is a number used to check the consitency of remoteio_server structs */ }; struct remoteio_server @@ -66,6 +69,8 @@ typedef int remoteio_close_func_t(struct struct remoteio_method_funcmap { + enum remoteio_method method; + remoteio_open_func_t *open_func; remoteio_read_func_t *read_func; remoteio_write_func_t *write_func; diff --git a/src/common/remoteio.c b/src/common/remoteio.c --- a/src/common/remoteio.c +++ b/src/common/remoteio.c @@ -51,11 +51,11 @@ int _remoteio_sock_close(struct remoteio struct remoteio_method_funcmap funcmap[] = { /* [REMOTEIO_METHOD_SSH] */ - {&_remoteio_ssh_open, &_remoteio_ssh_read, &_remoteio_ssh_write, &_remoteio_ssh_close, "ssh"}, + {REMOTEIO_METHOD_SSH, &_remoteio_ssh_open, &_remoteio_ssh_read, &_remoteio_ssh_write, &_remoteio_ssh_close, "ssh"}, #ifndef WINDOWS - {&_remoteio_sock_open, &_remoteio_sock_read, &_remoteio_sock_write, &_remoteio_sock_close, "unix"}, + {REMOTEIO_METHOD_UNIX, &_remoteio_sock_open, &_remoteio_sock_read, &_remoteio_sock_write, &_remoteio_sock_close, "unix"}, #endif - {NULL, NULL, NULL, NULL, NULL} + {REMOTEIO_METHOD_MAX, NULL, NULL, NULL, NULL, NULL} }; struct remoteio_server *remoteio_getserver(const struct remoteio_opts *opts, const char *servername);