/****************************************************************************
 *
 *	Copyright (C) 1984-2006 Micro Focus (IP) Limited.
 *	All rights reserved.
 *
 *	The software and information contained herein are
 *	proprietary to, and comprise valuable trade secrets of,
 *	Micro Focus (IP) Limited, which intends to preserve
 *	as trade secrets such software and information. This software
 *	is an unpublished copyright of Micro Focus and may not be
 *	used, copied, transmitted, or stored in any manner.  This
 *	software and information or any other copies thereof may not
 *	be provided or otherwise made available to any other person.
 *
 *	Genesis Run Time System (Studio/Server 5.0 Freeze)
 *
 *	@(#)mfctf.h	11.6
 *
 *	Last Modified on 06/11/07 at 23:32:07
 *
 ****************************************************************************/

/** Start of source module mfctf.h **/

#ifndef	MFCTF_H
#define	MFCTF_H

#include "cbltypes.h"

typedef unsigned int	ctf_pid;
typedef unsigned int	ctf_tid;

struct notif_install;
struct cblt_trc_notif_install_t;
struct trace_event;
struct trace_event_t;
struct tracer_event;

/******************************************************************************/
/*  Function pointer definitions					      */
/******************************************************************************/
typedef cobrtncode_t (*PFI_COBCTF_TRACE)(cobuns32_t	    flags_p,
					 const cobuns8_t    *component_id_p,
					 struct trace_event *trace_event_p);

typedef cobrtncode_t (*PFI_COBCTF_TRACER_NOTIFY)(
					 cobuns32_t	      install_function,
					 struct notif_install *install_struct);

typedef cobrtncode_t (*PFI_CTF_COMP_PROPERTY_GET)(
				       cobuns32_t      flags_p,
				       const cobuns8_t *component_id_p,
				       const cobuns8_t *property_name_p,
				       cbl_x4_comp5_t  *property_vallen_p,
				       cobuns8_t       *property_value_p);

typedef cobrtncode_t (*PFI_CTF_COMP_PROPERTY_SET)(
				       cobuns32_t      flags_p,
				       const cobuns8_t *component_id_p,
				       const cobuns8_t *property_name_p,
				       const cobuns8_t *property_value_p);

typedef cobrtncode_t (*PFI_CTF_DEST)(cobuns32_t	     flags_p,
				     const cobuns8_t *component_id_p,
				     const cobuns8_t *emitter_name_p);

typedef cobrtncode_t (*PFI_CTF_EMITTER)(cobuns32_t      flags_p,
					const cobuns8_t *emitter_name_p,
					const cobuns8_t *program_name_p);

typedef cobrtncode_t (*PFI_CTF_EMITTER_PROPERTY_GET)(
					  cobuns32_t	  flags_p,
					  const cobuns8_t *emitter_name_p,
					  const cobuns8_t *property_name_p,
					  cbl_x4_comp5_t  *property_vallen_p,
					  cobuns8_t	  *property_value_p);

typedef cobrtncode_t (*PFI_CTF_EMITTER_PROPERTY_SET)(
					  cobuns32_t	  flags_p,
					  const cobuns8_t *emitter_name_p,
					  const cobuns8_t *property_name_p,
					  const cobuns8_t *property_value_p);

typedef cobrtncode_t (*PFI_CTF_LEVEL)(cobuns32_t      flags_p,
				      cobuns32_t      level_p,
				      const cobuns8_t *component_id_p);

typedef cobrtncode_t (*PFI_CTF_TRACE)(cobuns32_t	   flags_p,
				      const cobuns8_t	   *component_id_p,
				      struct trace_event_t *trace_event_p);

typedef cobrtncode_t (*PFI_CTF_TRACER_GET)(cobuns32_t      flags_p,
					   const cobuns8_t *component_name_p,
					   cbl_x4_comp5_t  *tracer_handle_p);

typedef cobrtncode_t (*PFI_CTF_TRACER_LEVEL_GET)(
					    cobuns32_t      flags_p,
					    const cobuns8_t *component_id_p,
					    cbl_x4_comp5_t  *tracer_level_p);

typedef cobrtncode_t (*PFI_CTF_TRACER_NOTIFY)(
			    cobuns32_t			    install_function_p,
			    struct cblt_trc_notif_install_t *notif_install_p);

typedef int (*PFI_EMITTER_DEINIT)(cobuns32_t flags,
				  void	     *emitter_data);

typedef int (*PFI_EMITTER_INIT)(cobuns32_t	    flags,
				const cobuns8_t	    *emitter_name,
				struct tracer_event *tracer_event,
				void		    **emitter_data);

typedef void (*PFV_EMITTER_NOTIFY)(cobuns32_t notif_type,
				   void	      *notif_buf,
				   void	      *emitter_data);

typedef int (*PFI_EMITTER_OUTPUT)(cobuns32_t	      flags,
				  struct tracer_event *tracer_event,
				  void		      *emitter_data);

typedef int (*PFI_CTF_RESERVED)(void);

/******************************************************************************/
/*  Emitter return codes						      */
/******************************************************************************/

/*
**  Emitter deinitialisation (PFI_EMITTER_DEINIT)
*/
#define EMITTER_DEINIT_SUCCESS		    0
#define EMITTER_DEINIT_FAIL		    -1

/*
**  Emitter initialisation (PFI_EMITTER_INIT)
*/
#define EMITTER_INIT_SUCCESS		    0
#define EMITTER_INIT_FAIL		    -1

/*
**  Emitter output (PFI_EMITTER_OUTPUT)
*/
#define EMITTER_OUTPUT_SUCCESS		    0
#define EMITTER_OUTPUT_FAIL		    -1

/******************************************************************************/
/*  CBL_CTF_ API control flags						      */
/******************************************************************************/

/*
**  Used by:
**
**	CBL_CTF_EMITTER
*/
#define CTF_FLAG_PROG_NAME_NULL_TERM	    0x00000001

/*
**  Used by:
**
**	CBL_CTF_DEST
*/
#define CTF_FLAG_DEST_ADD		    0x00000000
#define CTF_FLAG_DEST_REMOVE		    0x00000001
#define CTF_FLAG_DEST_NOINHERIT		    0x00000002

/*
**  Used by:
**
**	CBL_CTF_COMP_PROPERTY_GET
**	CBL_CTF_COMP_PROPERTY_SET
**	CBL_CTF_EMITTER_PROPERTY_GET
**	CBL_CTF_EMITTER_PROPERTY_SET
*/
#define CTF_FLAG_PROP_INT_VALUE		    0x00000001
#define CTF_FLAG_PROP_NULL_TERM		    0x00000002

/*
**  Used by:
**
**	CBL_CTF_TRACE
*/
#define CTF_FLAG_TRACE_OUTPUT_FORCE	    0x00001000
#define CTF_FLAG_TRACE_ARRAY_DATA	    0x00002000

/*
**  Used by:
**
**	CBL_CTF_DEST
**	CBL_CTF_EMITTER
**	CBL_CTF_EMITTER_PROPERTY_GET
**	CBL_CTF_EMITTER_PROPERTY_SET
*/
#define CTF_FLAG_EMITTER_NAME_NULL_TERM	    0x10000000

/*
**  Used by:
**
**	CBL_CTF_COMP_PROPERTY_GET
**	CBL_CTF_COMP_PROPERTY_SET
**	CBL_CTF_EMITTER_PROPERTY_GET
**	CBL_CTF_EMITTER_PROPERTY_SET
*/
#define CTF_FLAG_PROP_NAME_NULL_TERM	    0x20000000

/*
**  Used by:
**
**	CBL_CTF_COMP_PROPERTY_GET
**	CBL_CTF_COMP_PROPERTY_SET
**	CBL_CTF_DEST
**	CBL_CTF_LEVEL
**	CBL_CTF_TRACE
**	CBL_CTF_TRACER_GET
**	CBL_CTF_TRACER_LEVEL_GET
*/
#define CTF_FLAG_COMP_NAME_NULL_TERM	    0x40000000
/*
**  Used by:
**
**	CBL_CTF_COMP_PROPERTY_GET
**	CBL_CTF_COMP_PROPERTY_SET
**	CBL_CTF_DEST
**	CBL_CTF_LEVEL
**	CBL_CTF_TRACE
**	CBL_CTF_TRACER_LEVEL_GET
*/
#define CTF_FLAG_COMPID_STRING		    0x80000000

/******************************************************************************/
/*  CTF trace levels							      */
/******************************************************************************/
#define CTF_FLAG_LEVEL_DEBUG		    0
#define CTF_FLAG_LEVEL_INFO		    1
#define CTF_FLAG_LEVEL_WARN		    2
#define CTF_FLAG_LEVEL_ERROR		    3
#define CTF_FLAG_LEVEL_FATAL		    4

#define CTF_FLAG_LEVEL_NONE		    0xFFFFFFFF

/******************************************************************************/
/*  CBL_CTF_ API return codes						      */
/******************************************************************************/
#define CTF_RET_SUCCESS			0   /* Success			      */
#define CTF_RET_FAILURE			-1  /* Unspecified Failure	      */
#define CTF_RET_INVALID_TRACE_HANDLE	1   /* Invalid trace handle specified */
#define CTF_RET_INVALID_TRACE_LEVEL	2   /* Invalid trace level specified  */
#define CTF_RET_NOT_TRACE_ENABLED	3   /* Component not enabled for      */
					    /* tracing			      */
#define CTF_RET_NOT_TRACING_LEVEL	4   /* Specified event level less than*/
					    /* threshold level configured for */
					    /* the component		      */
#define CTF_RET_NOT_ENOUGH_MEMORY	5   /* Memory allocation error	      */
#define CTF_RET_OUTPUT_ERROR		6   /* Error outputting to one or more*/
					    /* output destinations	      */
#define CTF_RET_PROPERTY_NOT_FOUND	7   /* Property not found	      */
#define CTF_RET_BUFFER_TOO_SMALL	8   /* Buffer length too small	      */
#define CTF_RET_VALUE_NOT_INTEGER	9   /* Value is not an integer	      */
#define CTF_RET_EMITTER_NOT_FOUND	10  /* Emitter not found	      */
#define CTF_RET_INVALID_EVENT_HANDLE	11  /* Invalid event handle specified */
#define CTF_RET_ZERO_LENGTH_DATA	12  /* Zero length data specified     */
#define CTF_RET_INVALID_PROPERTY_NAME	13  /* Invalid property name specified*/
#define CTF_RET_INVALID_COMPONENT_NAME	14  /* Invalid component name	      */
					    /* specified		      */
#define CTF_RET_INVALID_EMITTER_NAME	15  /* Invalid emitter name specified */
#define CTF_RET_INVALID_PROG_NAME	16  /* Invalid program name specified */
#define CTF_RET_CALLBACK_NOT_FOUND	17  /* Callback doesn't exist	      */
#define CTF_RET_CALLBACK_EXISTS		18  /* Callback already installed     */
#define CTF_RET_NO_SERVER_PROCESS	19  /* No server process running      */
#define CTF_RET_ACCESS_DENIED		20  /* Access denied		      */

/******************************************************************************/
/*  Structures								      */
/******************************************************************************/

/*----------------------------------------------------------------------------*/
/*  CTF Functions							      */
/*----------------------------------------------------------------------------*/
typedef struct ctf_funcs
{
    cobuns32_t			    version;
    cobuns32_t			    reserved;
    PFI_CTF_COMP_PROPERTY_GET	    fn_comp_property_get;
    PFI_CTF_COMP_PROPERTY_SET	    fn_comp_property_set;
    PFI_CTF_DEST		    fn_dest;
    PFI_CTF_EMITTER		    fn_emitter;
    PFI_CTF_EMITTER_PROPERTY_GET    fn_emitter_property_get;
    PFI_CTF_EMITTER_PROPERTY_SET    fn_emitter_property_set;
    PFI_CTF_LEVEL		    fn_level;
    PFI_CTF_TRACE		    fn_trace;
    PFI_CTF_TRACER_GET		    fn_tracer_get;
    PFI_CTF_TRACER_LEVEL_GET	    fn_tracer_level_get;
    PFI_CTF_TRACER_NOTIFY	    fn_tracer_notify;
    PFI_COBCTF_TRACE		    fn_cobctf_trace;
    PFI_COBCTF_TRACER_NOTIFY	    fn_cobctf_tracer_notify;
    PFI_CTF_RESERVED		    fn_reserved[16];
}CTF_FUNCS;

/*----------------------------------------------------------------------------*/
/*  Emitter function pointer table					      */
/*----------------------------------------------------------------------------*/
typedef struct emitter_funcs
{
    cobuns32_t		version;	    /* Version of structure format    */
    cobuns32_t		reserved;	    /* Reserved for future use	      */
    PFI_EMITTER_INIT	fn_init;	    /* Function to initialise the     */
					    /* emitter			      */
    PFI_EMITTER_DEINIT	fn_deinit;	    /* Function to deinitialise the   */
					    /* emitter			      */
    PFI_EMITTER_OUTPUT	fn_output;	    /* Function to output a trace     */
					    /* event			      */
    PFV_EMITTER_NOTIFY	fn_notify;	    /* Function to handle notifcations*/
					    /* of emitter config changes      */
    PFI			fn_reserved[4];	    /* Reserved for future use	      */
} EMITTER_FUNCS;

/*
**  Version types (version)
*/
#define EMITTER_FUNCS_VERSION		    0

/*----------------------------------------------------------------------------*/
/*  Emitter notification types						      */
/*----------------------------------------------------------------------------*/
#define EMITTER_NOTIF_TYPE_PROP_CHANGE	    0

/*----------------------------------------------------------------------------*/
/*  Emitter notification: property change				      */
/*----------------------------------------------------------------------------*/
typedef struct emitter_notif_prop_change
{
    cobuns32_t		version;	    /* Version of structure format    */
    cobuns32_t		flags;		    /* Control flags		      */
    cobuns32_t		namelen;	    /* Length of property name	      */
    cobuns32_t		vallen;		    /* Length of value		      */
    cobuns32_t		valint;		    /* Integer representation of value*/
    cobuns8_t		*name;		    /* Property name		      */
    cobuns8_t		*value;		    /* Property value		      */
}EMITTER_NOTIF_PROP_CHANGE;

/*
**  Version types (version)
*/
#define EMITTER_PROP_CHANGE_VERSION		0

/*
**  Control flags (flags)
*/
#define EMITTER_PROP_CHANGE_FLAGS_NONE		0x00000000
#define EMITTER_PROP_CHANGE_FLAGS_VAL_INTEGER	0x00000001

/*----------------------------------------------------------------------------*/
/*  Trace event details							      */
/*----------------------------------------------------------------------------*/
typedef struct trace_event
{
    cobuns32_t		version;	    /* Version of structure format    */
    cobuns32_t		flags;		    /* Control flags		      */
    cobuns32_t		event_id;	    /* Component event identifier     */
    cobuns32_t		level;		    /* Trace level		      */
    cobuns32_t		data_count;	    /* Number of trace data items     */
    cobuns32_t		*event_len;	    /* Trace data item lengths	      */
    cobuns32_t		*event_type;	    /* Trace data item types	      */
    void		*event_data;	    /* Trace data items		      */
}TRACE_EVENT;

typedef struct trace_event_t
{
    cbl_x4_comp5_t	version;	    /* Version of structure format    */
    cbl_x4_comp5_t	flags;		    /* Control flags		      */
    cbl_x4_comp5_t	event_id;	    /* Component event identifier     */
    cbl_x4_comp5_t	level;		    /* Trace level		      */
    cbl_x4_comp5_t	data_count;	    /* Number of trace data items     */
    cbl_pointer_t	event_len;	    /* Trace data item lengths	      */
    cbl_pointer_t	event_type;	    /* Trace data item types	      */
    cbl_pointer_t	event_data;	    /* Trace data items		      */
}TRACE_EVENT_T;

/*
**  Version types (version)
*/
#define TRACE_EVENT_VERSION		    0

/*
**  Control flags (flags)
*/
#define TRACE_EVENT_FLAGS_NONE		    0x00000000

/*
**  Trace event types (event_type_p)
*/
#define TRACE_EVENT_TYPE_BINARY		    0
#define TRACE_EVENT_TYPE_TEXT		    1
#define TRACE_EVENT_TYPE_ADDRESS	    2
#define TRACE_EVENT_TYPE_COMP5		    3
#define TRACE_EVENT_TYPE_COMPX		    4
#define TRACE_EVENT_TYPE_UTF8		    5
#define TRACE_EVENT_TYPE_COMP5S		    6
#define TRACE_EVENT_TYPE_COMPXS		    7

#define TRACE_EVENT_TYPE_MASK		    0x000000FF

/*----------------------------------------------------------------------------*/
/*  Tracer event details						      */
/*----------------------------------------------------------------------------*/
typedef struct tracer_event
{
    cobuns32_t		version;	    /* Version of structure format    */
    cobuns32_t		flags;		    /* Control flags		      */
    cobuns32_t		date;		    /* Encoded date		      */
    cobuns32_t		time;		    /* Encoded time		      */
    cobuns32_t		data_count;	    /* Number of trace data items     */
    cobuns32_t		process_id_len;	    /* Length of process identifier   */
    cobuns32_t		thread_id_len;	    /* Length of thread identifier    */
    cobuns32_t		comp_id;	    /* Component identifier	      */
    cobuns32_t		event_id;	    /* Component's trace event	      */
					    /* identifier		      */
    cobuns32_t		level;		    /* Trace level		      */
    cobuns32_t		reserved1[8];	    /* Reserved for future use	      */
    const cobuns8_t	*process_id;	    /* Process identifier	      */
    const cobuns8_t	*thread_id;	    /* Thread identifier	      */
    const cobuns8_t	*appname;	    /* Application name		      */
    const cobuns8_t	*cmdline;	    /* Process command line	      */
    const cobuns8_t	*os_name;	    /* Operating system name	      */
    const cobuns8_t	*machine_name;	    /* Machine name		      */
    const cobuns8_t	*comp_name;	    /* Null-terminated component name */
    const cobuns32_t	*data_len;	    /* Trace data item lengths	      */
    const cobuns32_t	*data_type;	    /* Trace data item types	      */
    const void		**data_item;	    /* Trace data items		      */
    cobuns8_t		*reserved2[8];	    /* Reserved for future use	      */
} TRACER_EVENT;

/*
**  Version types (version)
*/
#define TRACER_EVENT_VERSION		    0

/*
**  Control flags (flags)
*/
#define TRACER_EVENT_FLAGS_NONE		    0x00000000
#define TRACER_EVENT_FLAGS_FORCED	    0x00000001
#define TRACER_EVENT_FLAGS_ARRAY_DATA	    0x00000002

/*
**  Encoded date bit definitions (date)
*/
#define TRACER_EVENT_DATE_YEAR_MASK	    0x01FFFE00
#define TRACER_EVENT_DATE_MONTH_MASK	    0x000001E0
#define TRACER_EVENT_DATE_DAY_MASK	    0x0000001F

#define TRACER_EVENT_DATE_YEAR_SHIFT	    9
#define TRACER_EVENT_DATE_MONTH_SHIFT	    5
#define TRACER_EVENT_DATE_DAY_SHIFT	    0

/*
**  Encoded time bit definitions (time)
*/
#define TRACER_EVENT_TIME_MSECS_MASK	    0x000003FF
#define TRACER_EVENT_TIME_SECS_MASK	    0x0000FC00
#define TRACER_EVENT_TIME_MINS_MASK	    0x003F0000
#define TRACER_EVENT_TIME_HOURS_MASK	    0x07C00000

#define TRACER_EVENT_TIME_MSECS_SHIFT	    0
#define TRACER_EVENT_TIME_SECS_SHIFT	    10
#define TRACER_EVENT_TIME_MINS_SHIFT	    16
#define TRACER_EVENT_TIME_HOURS_SHIFT	    22

/*
**  Trace event data types (data_type)
*/
#define TRACER_EVENT_DATA_TYPE_BINARY	    0x00000000
#define TRACER_EVENT_DATA_TYPE_STRING	    0x00000001
#define TRACER_EVENT_DATA_TYPE_PTR	    0x00000002
#define TRACER_EVENT_DATA_TYPE_COMP5	    0x00000003
#define TRACER_EVENT_DATA_TYPE_COMPX	    0x00000004
#define TRACER_EVENT_DATA_TYPE_UTF8	    0x00000005
#define TRACER_EVENT_DATA_TYPE_COMP5S	    0x00000006
#define TRACER_EVENT_DATA_TYPE_COMPXS	    0x00000007

/*----------------------------------------------------------------------------*/
/*  Tracer notification callback					      */
/*----------------------------------------------------------------------------*/
typedef void (*PFV_CTF_TRACER_CALLBACK)(cobuns32_t tracer_handle,
					cobuns32_t notif_type,
					void	   *notif_info);

typedef struct notif_install
{
    cobuns32_t		    version;
    cobuns32_t		    handle;
    PFV_CTF_TRACER_CALLBACK callback;
}NOTIF_INSTALL;

/*
**  Version types (version)
*/
#define NOTIF_INSTALL_VERSION		    0

typedef struct cblt_trc_notif_install_t
{
    cbl_x4_comp5_t  version;
    cbl_x4_comp5_t  handle;
    cbl_ppointer_t  callback;
}cblt_trc_notif_install_t;

#define TRACER_NOTIF_TYPE_PROP_CHANGE	    0
#define TRACER_NOTIF_TYPE_LEVEL_CHANGE	    1

/*----------------------------------------------------------------------------*/
/*  Tracer notification: property change				      */
/*----------------------------------------------------------------------------*/
typedef struct cblt_trc_notif_prop_change_t
{
    cbl_x4_comp5_t  version;
    cbl_x4_comp5_t  flags;
    cbl_x4_comp5_t  namelen;
    cbl_x4_comp5_t  vallen;
    cbl_x4_comp5_t  valint;
    cbl_pointer_t   name;
    cbl_pointer_t   value;
}cblt_trc_notif_prop_change_t;

/*
**  Version types (version)
*/
#define PROP_CHANGE_VERSION		    0

/*
**  Control flags (flags)
*/
#define PROP_CHANGE_FLAGS_NONE		    0x00000000
#define PROP_CHANGE_FLAGS_VAL_INTEGER	    0x00000001

/******************************************************************************/
/*  APIs								      */
/******************************************************************************/
cobrtncode_t cobctf_trace(cobuns32_t	  flags_p,
			  const cobuns8_t *component_id_p,
			  TRACE_EVENT	  *trace_event_p);

cobrtncode_t cobctf_tracer_notify(cobuns32_t	install_function,
				  NOTIF_INSTALL *install_struct);

cobrtncode_t CBL_CTF_COMP_PROPERTY_GET(cobuns32_t      flags_p,
				       const cobuns8_t *component_id_p,
				       const cobuns8_t *property_name_p,
				       cbl_x4_comp5_t  *property_vallen_p,
				       cobuns8_t       *property_value_p);

cobrtncode_t CBL_CTF_COMP_PROPERTY_SET(cobuns32_t      flags_p,
				       const cobuns8_t *component_id_p,
				       const cobuns8_t *property_name_p,
				       const cobuns8_t *property_value_p);

cobrtncode_t CBL_CTF_DEST(cobuns32_t	  flags_p,
			  const cobuns8_t *component_id_p,
			  const cobuns8_t *emitter_name_p);

cobrtncode_t CBL_CTF_EMITTER(cobuns32_t	     flags_p,
			     const cobuns8_t *emitter_name_p,
			     const cobuns8_t *program_name_p);

cobrtncode_t CBL_CTF_EMITTER_PROPERTY_GET(cobuns32_t	  flags_p,
					  const cobuns8_t *emitter_name_p,
					  const cobuns8_t *property_name_p,
					  cbl_x4_comp5_t  *property_vallen_p,
					  cobuns8_t	  *property_value_p);

cobrtncode_t CBL_CTF_EMITTER_PROPERTY_SET(cobuns32_t	  flags_p,
					  const cobuns8_t *emitter_name_p,
					  const cobuns8_t *property_name_p,
					  const cobuns8_t *property_value_p);

cobrtncode_t CBL_CTF_LEVEL(cobuns32_t	   flags_p,
			   cobuns32_t	   level_p,
			   const cobuns8_t *component_id_p);

cobrtncode_t CBL_CTF_TRACE(cobuns32_t	   flags_p,
			   const cobuns8_t *component_id_p,
			   TRACE_EVENT_T   *trace_event_p);

cobrtncode_t CBL_CTF_TRACER_GET(cobuns32_t      flags_p,
				const cobuns8_t *component_name_p,
				cbl_x4_comp5_t  *tracer_handle_p);

cobrtncode_t CBL_CTF_TRACER_LEVEL_GET(cobuns32_t      flags_p,
				      const cobuns8_t *component_id_p,
				      cbl_x4_comp5_t  *tracer_level_p);

cobrtncode_t CBL_CTF_TRACER_NOTIFY(
			    cobuns32_t			    install_function_p,
			    struct cblt_trc_notif_install_t *notif_install_p);

#define TRACER_NOTIFY_FUNC_INSTALL	0
#define TRACER_NOTIFY_FUNC_UNINSTALL	1

/******************************************************************************/
/*  Date/Time Macros							      */
/******************************************************************************/
#define CTF_DECODE_DATE_DAY(date) \
    (((date) & TRACER_EVENT_DATE_DAY_MASK) >> TRACER_EVENT_DATE_DAY_SHIFT)

#define CTF_DECODE_DATE_MONTH(date) \
    (((date) & TRACER_EVENT_DATE_MONTH_MASK) >> TRACER_EVENT_DATE_MONTH_SHIFT)

#define CTF_DECODE_DATE_YEAR(date) \
    (((date) & TRACER_EVENT_DATE_YEAR_MASK) >> TRACER_EVENT_DATE_YEAR_SHIFT)

#define CTF_DECODE_TIME_HOURS(time) \
    (((time) & TRACER_EVENT_TIME_HOURS_MASK) >> TRACER_EVENT_TIME_HOURS_SHIFT)

#define CTF_DECODE_TIME_MINS(time) \
    (((time) & TRACER_EVENT_TIME_MINS_MASK) >> TRACER_EVENT_TIME_MINS_SHIFT)

#define CTF_DECODE_TIME_SECS(time) \
    (((time) & TRACER_EVENT_TIME_SECS_MASK) >> TRACER_EVENT_TIME_SECS_SHIFT)

#define CTF_DECODE_TIME_MSECS(time) \
    (((time) & TRACER_EVENT_TIME_MSECS_MASK) >> TRACER_EVENT_TIME_MSECS_SHIFT)

#define CTF_ENCODE_DATE(year, month, day) \
	(((year)  << TRACER_EVENT_DATE_YEAR_SHIFT) | \
	 ((month) << TRACER_EVENT_DATE_MONTH_SHIFT) | \
	 ((day)   << TRACER_EVENT_DATE_DAY_SHIFT))

#define CTF_ENCODE_TIME(hours, mins, secs, msecs) \
	(((hours) << TRACER_EVENT_TIME_HOURS_SHIFT) | \
	 ((mins)  << TRACER_EVENT_TIME_MINS_SHIFT) | \
	 ((secs)  << TRACER_EVENT_TIME_SECS_SHIFT) | \
	 ((msecs) << TRACER_EVENT_TIME_MSECS_SHIFT))

/******************************************************************************/
/*  Externals								      */
/******************************************************************************/

#endif	/* MFCTF_H */

/** End of source module mfctf.h **/
