Commit 404ea087 authored by Ian Murdock's avatar Ian Murdock
Browse files

(event_register): Take a server URL to contact in place of using the

Elvin server discovery protocol.
parent c45317b4
......@@ -7,7 +7,7 @@
* @COPYRIGHT@
*/
static char rcsid[] = "$Id: event.c,v 1.2 2001-11-02 17:33:34 imurdock Exp $";
static char rcsid[] = "$Id: event.c,v 1.3 2001-11-06 17:01:19 imurdock Exp $";
#include <stdio.h>
#include <assert.h>
......@@ -27,7 +27,7 @@ static char hostname[MAXHOSTNAMELEN];
a handle that may be passed to other event system routines if
the operation is successful, NULL otherwise. */
event_handle_t
event_register(void)
event_register(char *url)
{
event_handle_t handle;
elvin_handle_t server;
......@@ -62,6 +62,15 @@ event_register(void)
return 0;
}
/* Set the server URL, if we were passed one by the user. */
if (url) {
if (elvin_handle_append_url(server, url, status) == 0) {
ERROR("elvin_handle_append_url failed: ");
elvin_error_fprintf(stderr, status);
return 0;
}
}
/* Connect to the elvin server: */
if (elvin_sync_connect(server, status) == 0) {
ERROR("elvin_sync_connect failed: ");
......
......@@ -5,7 +5,7 @@
*
* @COPYRIGHT@
*
* $Id: event.h,v 1.1 2001-11-02 04:43:04 imurdock Exp $
* $Id: event.h,v 1.2 2001-11-06 17:01:20 imurdock Exp $
*/
#ifndef __EVENT_H__
......@@ -77,7 +77,7 @@ typedef elvin_value_t event_attr_value_t;
*/
/* event.c */
event_handle_t event_register(void);
event_handle_t event_register(char *url);
int event_unregister(event_handle_t handle);
int event_main(event_handle_t handle);
int event_notify(event_handle_t handle, event_notification_t notification);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment