/************************************************/
/*                                              */
/* File        : spy.h                          */
/* Description : Standard spy library           */
/*                                              */
/* Author: Sfiligoi Igor                        */
/*                                              */
/* Created      : 21.07.1997                    */
/* Recreated    : 16.12.1998                    */
/* Last modified: 16.12.1998                    */
/*                                              */
/************************************************/

#ifndef SPY_H
#define SPY_H

#ifdef __cplusplus
extern "C" {
#endif

/* The error constants are common to spy.h and spy_extended.h */
#ifndef SPY_ERROR_OK
# define SPY_ERROR_OK           0
# define SPY_ERROR_UNKNOWN      1
# define SPY_ERROR_EMPTY       10
#endif

typedef struct SPY_id_
        {
	  int cid;
	  int last_event_nr;

	  char *buf_ptr;
	  char *evt_ptr;
        } SPY_id_base;

typedef SPY_id_base *SPY_id;

int spy_open(char   *keyname,      /* IN : keyname of the Circular buffer */
	     SPY_id *sid);         /* OUT: SPY_id */

int spy_get(SPY_id sid,      /* IN : SPY_id returned by spy_open_local */
	    char  *buf,      /* OUT: buffer in which to write the event data */
	    int   *bufsize); /* IN : max buffer size, OUT: size of the event */

int spy_refresh(SPY_id sid);

int spy_close(SPY_id sid);

#ifdef __cplusplus
}
#endif


#endif /* SPY_H */