/*LINTLIBRARY*/
/*PROTOLIB1*/
/*
 * Copyright (c) 2000 by Sun Microsystems, Inc.
 *
 * All rights reserved.
 *
 *  usr/src/lib/libdevfsevent/llib-ldevfsevent
 */

#pragma ident	"@(#)llib-lsysevent	1.2	00/10/10 SMI"

#include <synch.h>
#include <thread.h>
#include "libsysevent.h"

int sysevent_post_event(char *class, char *subclass, char *vendor,
	char *pub_name, nvlist_t *attr_list, sysevent_id_t *eid);
sysevent_t *sysevent_dup(sysevent_t *ev);

void sysevent_free(sysevent_t *ev);

int sysevent_get_attr_list(sysevent_t *ev, nvlist_t **nvlist);

int sysevent_lookup_attr(sysevent_t *ev, char *name, int datatype,
	sysevent_value_t *se_value);

sysevent_attr_t *sysevent_attr_next(sysevent_t *ev, sysevent_attr_t *attr);

char *sysevent_attr_name(sysevent_attr_t *attr);

int sysevent_attr_value(sysevent_attr_t *attr, sysevent_value_t *se_value);

int sysevent_get_class(sysevent_t *ev);

char *sysevent_get_class_name(sysevent_t *ev);

int sysevent_get_subclass(sysevent_t *ev);

char *sysevent_get_subclass_name(sysevent_t *ev);

char *sysevent_get_pub(sysevent_t *ev);

char *sysevent_get_vendor_name(sysevent_t *ev);

char *sysevent_get_pub_name(sysevent_t *ev);

void sysevent_get_pid(sysevent_t *ev, pid_t *pid);

uint64_t sysevent_get_seq(sysevent_t *ev);

void sysevent_get_time(sysevent_t *ev, hrtime_t *etime);

size_t sysevent_get_size(sysevent_t *ev);

int sysevent_send_event(sysevent_handle_t *sysevent_hdl, sysevent_t *ev);

sysevent_t * sysevent_alloc_event(char *class, char *subclass, char *vendor,
	char *pub_name, nvlist_t *attr_list);

sysevent_handle_t * sysevent_open_channel(char *endpoint);

int sysevent_close_channel(sysevent_handle_t *sysevent_hdl);

int sysevent_bind_channel(sysevent_handle_t *se_handle,
	int (*callback)(sysevent_t *data));

void sysevent_unbind_channel(sysevent_handle_t *sysevent_hdl);

void se_print(FILE *fp, sysevent_t *ev);
