// ------------- CSPDefs.h------------------------

//*************************************************************
//*****       Copyright ©2002 - 2004 Micronovae Ltd       *****
//*****                All rights reserved                *****
//*************************************************************

//-------- CSP definitions header-----------------

#ifndef _CSPDEFS
#define _CSPDEFS

// --------- ERROR_CODES -------------------------

#define CSPERROR unsigned long

#define CSP_OK								0 // No Error
#define CSP_ERROR_OUT_OF_MEMORY					1 // Ran out of memory
#define CSP_ERROR_SCRIPT_FILE_NOT_FOUND			2 // The script file is not found
#define CSP_ERROR_SCRIPT_FILE_INFO				3 // Could not retrieve information from the script file
#define CSP_ERROR_COMPILER_NOT_FOUND			4 // The compiler was not found
#define CSP_ERROR_COMPILER						5 // The compiler returned an error
#define CSP_ERROR_LINKER_NOT_FOUND				6 // The linker was not found
#define CSP_ERROR_LINKER						7 // The linker returned an error

#define CSP_ERROR_NULL_POINTER					8 // A null pointer was passed as an argument
#define CSP_ERROR_INVALID_ARGUMENT				9 // An argument was invalid

#define CSP_ERROR_IMPERSONATION_TOKEN			10 // Could not open the impersonation token for the current thread

#define CSP_ERROR_MODULE_FILE_NOT_FOUND			11 // Could not open the .dll module file
#define CSP_ERROR_MODULE_NOT_LOADED				12 // Could not load the .dll module
#define CSP_ERROR_MODULE_FILE_INFO				13 // Could not load the .dll module
#define CSP_ERROR_IMPROPER_MODULE				14 // The module is improper because it does not export the ExecScript function
#define CSP_ERROR_EXECUTE						15 // An error occured during the execution of the ExecScript() of the module
#define CSP_ERROR_EXECUTE_EXCEPTION				16 // An exception occured during the execution of the ExecScript() of the module

#define CSP_ERROR_SETTINGS_NOT_SET				17 // The settings, like paths and Application ID, were not set

#define CSP_ERROR_MODULELIST_FILE_READ			18 // Could not read data from the module list file
#define CSP_ERROR_INVALID_MODULELIST_FILE		19 // The module list file is not valid
#define CSP_ERROR_MODULELIST_FILE_NOT_FOUND		20 // Could not open module list file
#define CSP_ERROR_MODULELIST_FILE_WRITE			21 // Could not create or write information to the module list file

#define CSP_ERROR_DEBUG_OUTPUT					22 // Procedures for the debug output failed
#define CSP_ERROR_PRECOMPILED_FILE_WRITE		23 // Could not create or write the precompiled C++ file
#define CSP_ERROR_PRECOMPILED_FILE_NOT_FOUND	24 // Could not find the precompiled C++ file
#define CSP_ERROR_PRECOMPILED_FILE_READ			25 // Could not read from the precompiled C++ file

#define CSP_ERROR_SERVER_ERROR					26 // A call to the server returned an error
#define CSP_ERROR_MAX_CON						27 // Maximum connections reached

#define CSP_ERROR_SESSION_MANAGER_NOT_LOADED	28 // Session Manager could not be loaded
#define CSP_ERROR_APPLICATION_MANAGER_NOT_LOADED	29 // Application Manager could not be loaded
#define CSP_ERROR_CANNOT_SAVE_SESSION_DATA		30 // Cannot save Session information
#define CSP_ERROR_CANNOT_RETRIEVE_SESSION_DATA	31 // Cannot retrieve Session information
#define CSP_ERROR_CANNOT_SAVE_APPLICATION_DATA	32 // Cannot save Application information
#define CSP_ERROR_CANNOT_RETRIEVE_APPLICATION_DATA	33 // Cannot retrieve Application information
#define CSP_ERROR_CANNOT_SAVE_STATIC_PAGE	34 // The content that was converted to a static page, could not be saved




#define CSP_APPLICATION_DATA_NOT_FOUND			0xFFFFFFFF
#define CSP_SESSION_DATA_NOT_FOUND				0xFFFFFFFF




//------------------------- Other CSP definitions ------------------------

// Module time out definitions -- #define CSP_MODULE_TIMEOUT XXXX_XXXX
#define DEFAULT_MODULE_TIMEOUT	0xFFFFFFFF
#define DO_NOT_UNLOAD			0xFFFFFFFE
#define UNLOAD_IMMEDIATELY		0x0




//--------------------------- CSP Directives ------------------
// #define CSP_MODULE_TIMEOUT XXX 
// Sets the timeout of the module.
// XXX: a number that represents the timeout in minutes.
// XXX: alternatively, you can use one of the definitions in the "Other CSP definitions" section


// #define CSP_SESSION
// Sets the Session mode on for the module


// #define CSP_STATIC_PAGE
// Forces the content of the page to be saved in static form in a file, instead of sent it directly to the client
// Unless CSP_STATIC_PAGE_FILENAME is defined, the file will have the same name with the script, but will have a ".html" extension


// #define CSP_STATIC_PAGE_FILENAME "xxx.yyy"
// Forces the content of the page to be saved in static form in a file with the given filename, instead of sent it directly to the client
// "xxx.yyy": a C-type string - the filename of the static page


#endif
