/*
 *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 *  SCR_Ntfy.h
 *  Scripts, Beaudet Christophe
 *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 *
 */
 
#ifndef __SCR_Ntfy_h__Types
#define __SCR_Ntfy_h__Types
 
#ifndef __Only_Types__
#define __SCR_Ntfy_h__Undef
#define __Only_Types__
#endif /* !__Only_Types__ */
 
/*
 *=================================================================================================
 *  Includes.
 *=================================================================================================
 */
 
#include "SCR_File.h"
 
#ifdef __SCR_Ntfy_h__Undef
#undef __Only_Types__
#undef __SCR_Ntfy_h__Undef
#endif /* __SCR_Ntfy_h__Undef */
 
/*
 *=================================================================================================
 *  Constants.
 *=================================================================================================
 */
 
/*
 *  To export code.
 */
#undef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else /* CPA_WANTS_IMPORT */
#define CPA_EXPORT
#endif /* CPA_WANTS_IMPORT */
 
/*
 *=================================================================================================
 *  Types.
 *=================================================================================================
 */
 
/*
 *  To describe an action to the high level saver.
 */
typedef enum SCR_tde_Ntfy_Action_
{
    SCR_EA_Ntfy_AddSection,             /* To add a new section in a file */
    SCR_EA_Ntfy_DeleteSection,          /* To delete an existing section */
    SCR_EA_Ntfy_ModifySection,          /* To modify a section */
    SCR_EA_Ntfy_RebuildSection,         /* To delete and rewrite a section */
	SCR_EA_Ntfy_Dummy,					/* When a notification has been done */
	SCR_EA_Ntfy_AddOrModifySection,		/* Modify section if exists, add else */
	SCR_EA_Ntfy_AddOrRebuildSection,	/* Rebuild section if exists, add else */
	SCR_EA_Ntfy_DeleteIfExists,			/* Delete section if it exits */
} SCR_tde_Ntfy_Action;
 
/*
 *  Type that describes a callback for saver.
 */
typedef void (* SCR_tdpfn_Ntfy_Callback)(SCR_tdst_File_Description *, char *, void *, SCR_tde_Ntfy_Action);
 
/*
 *  Structure that describes a notify saving action.
 */
typedef struct SCR_tdst_Ntfy_Description_
{
	SCR_tdst_DyAr_Header	stHeader;						/* Header of element */
    char                    a_szSectionName[_MAX_PATH];		/* Notification string */
    SCR_tdpfn_Ntfy_Callback pfn_vCallback;					/* Associated callback */
    void                    *p_vData;						/* Additional data */
    SCR_tde_Ntfy_Action     eAction;						/* Notification action */
} SCR_tdst_Ntfy_Description;
 
#endif /* !__SCR_Ntfy_h__Types */
 
/*
 *=================================================================================================
 *  Global variables.
 *=================================================================================================
 */
 
#if !defined(__SCR_Ntfy_h__Globals) && !defined(__Only_Types__)
#define __SCR_Ntfy_h__Globals
 
extern SCR_tdst_DyAr_Description    SCR_g_st_Ntfy_Array;
 
#endif /* !__SCR_Ntfy_h__Globals && !__Only_Types__ */
 
/*
 *=================================================================================================
 *  Macros.
 *=================================================================================================
 */
 
#if !defined(__SCR_Ntfy_h__Macros) && !defined(__Only_Types__)
#define __SCR_Ntfy_h__Macros
 
#endif /* !__SCR_Ntfy_h__Macros && !__Only_Types__ */
 
/*
 *=================================================================================================
 *  Protos.
 *=================================================================================================
 */
 
#if !defined(__SCR_Ntfy_h__Protos) && !defined(__Only_Types__)
#define __SCR_Ntfy_h__Protos
 
extern void                         fn_v_Ntfy_InitModule(void);
extern void                         fn_v_Ntfy_CloseModule(void);
 
extern void                         fn_v_Ntfy_Add(char *, SCR_tdpfn_Ntfy_Callback, void *, SCR_tde_Ntfy_Action);
extern void                         fn_v_Ntfy_Delete(SCR_tdst_Ntfy_Description *);
extern SCR_tdst_Ntfy_Description    *fnp_st_Ntfy_Search(char *);
 
extern void							fn_v_Ntfy_ReduceMemory(void);
extern void							fn_v_Ntfy_DeleteWithMemLevel(unsigned char, unsigned char);
 
#endif /* !__SCR_Ntfy_h__Protos && !__Only_Types__ */
