Changeset - 0aeea9ae7665
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 16 years ago 2009-10-21 18:50:03
ohnobinki@ohnopublishing.net
update enum remoteio_method and funcmap
2 files changed with 9 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/common/libremoteio.h
Show inline comments
 
@@ -27,15 +27,18 @@
 
  private declarations for remoteio, to be included by options.c and remoteio.c
 
 */
 

	
 
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
 
{
 
  struct remoteio_server *next;
 
  char *name; /*< The friendly named passed to remoteio_open() */
 
@@ -63,12 +66,14 @@ typedef int remoteio_open_func_t(struct 
 
typedef int remoteio_read_func_t(struct remoteio *rem, void *buf, size_t len, size_t *bytesread);
 
typedef int remoteio_write_func_t(struct remoteio *rem, void *buf, size_t len, size_t *bytesread);
 
typedef int remoteio_close_func_t(struct remoteio *rem);
 

	
 
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;
 
  remoteio_close_func_t *close_func;
 

	
 
  char *name; /*< used for error messages */
src/common/remoteio.c
Show inline comments
 
@@ -48,17 +48,17 @@ int _remoteio_sock_close(struct remoteio
 
  Regardless, a NULL terminator is required because the configuration function
 
  searches through this table for the method specified in the config file.
 
*/
 
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);
 

	
 
int remoteio_config(cfg_t *cfg, struct remoteio_opts *opts)
 
{
0 comments (0 inline, 0 general)