/******************************************************/
/* Copyright (C) 2008 Arch Rock Corporation 2008      */
/* License Agreement: refer to LICENSE.txt            */
/*                                                    */
/******************************************************/

#ifndef _NOTIFYCHANGE_H
#define _NOTIFYCHANGE_H    1

#include <event.h>

/*! Callback when the underlying socket specified by
 *  the socket identifier has more buffer again and is
 *   ready to accept data for transmission.
 *
 *  @param[in] resid a valid socket id.
 *  @param[in] notify_handler the continuation callback handler
 *             that will be fired when the underlying socket
 *             can accept more data.
 *             If NULL is passed here, the call will fail.
 *  @param[in] resource no requirement here.
 *  @param[in] context user context
 *  \return 0 if succeed or -1 if fail and errno is set appropriately.
 *  \par Errors:
 *    EBUSY if the underlying system cannot accept this request.
 *  \par
 *    EINVAL if invalid parameters are passed
 *
 *  \section handler Callback Descriptions
 *  \subsection notify_handler notify_handler
 *     @param[in] event Type is NOTIFYWRITE in #EventsEnum.
 *     @param[in] cbargs return \em resource in notifywrite().
 *     @param[in] context return \em context in notifywrite().
 *  \return None.
 */
int16_t notifywrite(int16_t resid, 
		    void(*notify_handler)(event_t event,
					  void * cbargs,
					  void * context),
		    void * resource,
		    void * context);

#endif
