/***************************************************************************/
/*

    Filename:  MILFUNC.H
    Revision:  10.60.0776
    Content :  This file contains the prototypes for the Matrox
               Imaging Library (MIL) Mfunc user's functions.

    Copyright © Matrox Electronic Systems Ltd., 1992-2023.
    All Rights Reserved

*/
/***************************************************************************/

#ifndef __MILFUNC_H
#define __MILFUNC_H

/* C++ directive if needed */
#ifdef __cplusplus
extern "C"
{
#endif

/***************************************************************************/
/* TOOLKIT FOR PSEUDO MIL FUNCTIONS DEVELOPMENT                            */
/***************************************************************************/
typedef void (MFTYPE *MIL_FUNC_FUNCTION_PTR)(MIL_ID FunctionId);
typedef MIL_FUNC_FUNCTION_PTR MFUNCSLAVEFCTPTR;
typedef MIL_FUNC_FUNCTION_PTR MFUNCFCTPTR;
typedef MIL_FUNC_FUNCTION_PTR MFUNCSLAVEPAFCTPTR;

// we need the ASCII version even on non-Unicode version
// this is needed for transferring ASCII strings in DMIL 
void MFTYPE MfuncParamMilTextA(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_TEXTA_PTR ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamConstMilTextA(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_CONST_TEXTA_PTR ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamFilenameA(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_CONST_TEXTA_PTR ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
MIL_INT64 MFTYPE MfuncParamTypeToType(MIL_INT64 ParamType, MIL_INT64 Option);

#if M_MIL_USE_UNICODE
   MIL_ID MFTYPE MfuncAllocW(MIL_CONST_TEXTW_PTR FunctionName,
                             MIL_INT ParameterNum,
                             MIL_FUNC_FUNCTION_PTR SlaveFunctionPtr,
                             MIL_CONST_TEXTW_PTR SlaveFunctionDLLName,
                             MIL_CONST_TEXTW_PTR SlaveFunctionName,
                             MIL_INT SlaveFunctionOpcode,
                             MIL_INT64 InitFlag,
                             MIL_ID *CBasedContextFuncIdPtr);
   MIL_ID MFTYPE MfuncAllocA(MIL_CONST_TEXTA_PTR FunctionName,
                             MIL_INT ParameterNum,
                             MIL_FUNC_FUNCTION_PTR SlaveFunctionPtr,
                             MIL_CONST_TEXTA_PTR SlaveFunctionDLLName,
                             MIL_CONST_TEXTA_PTR SlaveFunctionName,
                             MIL_INT SlaveFunctionOpcode,
                             MIL_INT64 InitFlag,
                             MIL_ID *CBasedContextFuncIdPtr);

   MIL_ID MFTYPE MfuncAllocScriptW(MIL_CONST_TEXTW_PTR FunctionName,
                             MIL_INT ParameterNum,
                             MIL_CONST_TEXTW_PTR InterpreterLanguage,
                             MIL_CONST_TEXTW_PTR ScriptFileName,
                             MIL_CONST_TEXTW_PTR ScriptFunctionName,
                             MIL_INT ScriptFunctionOpcode,
                             MIL_INT64 InitFlag,
                             MIL_ID *ScriptBasedContextFuncIdPtr);
   MIL_ID MFTYPE MfuncAllocScriptA(MIL_CONST_TEXTA_PTR FunctionName,
                             MIL_INT ParameterNum,
                             MIL_CONST_TEXTA_PTR InterpreterLanguage,
                             MIL_CONST_TEXTA_PTR ScriptFileName,
                             MIL_CONST_TEXTA_PTR ScriptFunctionName,
                             MIL_INT ScriptFunctionOpcode,
                             MIL_INT64 InitFlag,
                             MIL_ID *ScriptBasedContextFuncIdPtr);

   MIL_INT MFTYPE MfuncErrorReportW(MIL_ID ContextFuncId,
                                    MIL_INT ErrorCode,
                                    MIL_CONST_TEXTW_PTR ErrorMessage,
                                    MIL_CONST_TEXTW_PTR ErrorSubMessage1,
                                    MIL_CONST_TEXTW_PTR ErrorSubMessage2,
                                    MIL_CONST_TEXTW_PTR ErrorSubMessage3);
   MIL_INT MFTYPE MfuncErrorReportA(MIL_ID ContextFuncId,
                                    MIL_INT ErrorCode,
                                    MIL_CONST_TEXTA_PTR ErrorMessage,
                                    MIL_CONST_TEXTA_PTR ErrorSubMessage1,
                                    MIL_CONST_TEXTA_PTR ErrorSubMessage2,
                                    MIL_CONST_TEXTA_PTR ErrorSubMessage3);

   MIL_INT MFTYPE MfuncCustomExitW(MIL_INT Code, MIL_CONST_TEXTW_PTR Message);
   MIL_INT MFTYPE MfuncCustomExitA(MIL_INT Code, MIL_CONST_TEXTA_PTR Message);

   void MFTYPE MfuncParamMilTextW(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_TEXTW_PTR ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);

   void MFTYPE MfuncParamConstMilTextW(MIL_ID ContextFuncId, MIL_INT ParamIndex,MIL_CONST_TEXTW_PTR ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);

   void MFTYPE MfuncParamFilenameW(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_CONST_TEXTW_PTR ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);

   MIL_INT MFTYPE MfuncPrintMessageW(MIL_INT Mode,
                                     MIL_CONST_TEXTW_PTR Str1,
                                     MIL_CONST_TEXTW_PTR Str2,
                                     MIL_CONST_TEXTW_PTR Str3,
                                     MIL_CONST_TEXTW_PTR Str4,
                                     MIL_CONST_TEXTW_PTR Str5);
   MIL_INT MFTYPE MfuncPrintMessageA(MIL_INT Mode,
                                     MIL_CONST_TEXTA_PTR Str1,
                                     MIL_CONST_TEXTA_PTR Str2,
                                     MIL_CONST_TEXTA_PTR Str3,
                                     MIL_CONST_TEXTA_PTR Str4,
                                     MIL_CONST_TEXTA_PTR Str5);
   void MFTYPE MfuncParamA(MIL_ID ContextFuncId, MIL_INT ParamIndex, const void* ParamValuePtr, MIL_UINT ParamType, MIL_INT NumOfItems, MIL_INT64 MilObjectType, MIL_INT Attribute);
   void MFTYPE MfuncParamW(MIL_ID ContextFuncId, MIL_INT ParamIndex, const void* ParamValuePtr, MIL_UINT ParamType, MIL_INT NumOfItems, MIL_INT64 MilObjectType, MIL_INT Attribute);

   #if M_MIL_UNICODE_API
      #define MfuncAlloc                     MfuncAllocW
      #define MfuncAllocScript               MfuncAllocScriptW
      #define MfuncErrorReport               MfuncErrorReportW
      #define MfuncCustomExit                MfuncCustomExitW
      #define MfuncParamMilText              MfuncParamMilTextW
      #define MfuncParamConstMilText         MfuncParamConstMilTextW
      #define MfuncParamFilename             MfuncParamFilenameW
      #define MfuncPrintMessage              MfuncPrintMessageW
      #define MfuncParam                     MfuncParamW
   #else
      #define MfuncAlloc                     MfuncAllocA
      #define MfuncAllocScript               MfuncAllocScriptA
      #define MfuncErrorReport               MfuncErrorReportA
      #define MfuncCustomExit                MfuncCustomExitA
      #define MfuncParamMilText              MfuncParamMilTextA
      #define MfuncParamConstMilText         MfuncParamConstMilTextA
      #define MfuncParamFilename             MfuncParamFilenameA
      #define MfuncPrintMessage              MfuncPrintMessageA
      #define MfuncParam                     MfuncParamA
   #endif
   #else
      MIL_ID MFTYPE MfuncAlloc(MIL_CONST_TEXT_PTR FunctionName,
                              MIL_INT ParameterNum,
                              MIL_FUNC_FUNCTION_PTR SlaveFunctionPtr,
                              MIL_CONST_TEXT_PTR SlaveFunctionDLLName,
                              MIL_CONST_TEXT_PTR SlaveFunctionName,
                              MIL_INT SlaveFunctionOpcode,
                              MIL_INT64 InitFlag,
                              MIL_ID *CBasedContextFuncIdPtr);

      MIL_ID MFTYPE MfuncAllocScript(MIL_CONST_TEXT_PTR FunctionName,
                              MIL_INT ParameterNum,
                              MIL_CONST_TEXT_PTR InterpreterLanguage,
                              MIL_CONST_TEXT_PTR ScriptFileName,
                              MIL_CONST_TEXT_PTR ScriptFunctionName,
                              MIL_INT ScriptFunctionOpcode,
                              MIL_INT64 InitFlag,
                              MIL_ID *ScriptBasedContextFuncIdPtr);

      MIL_INT MFTYPE MfuncErrorReport( MIL_ID ContextFuncId,
                                       MIL_INT ErrorCode,
                                       MIL_CONST_TEXT_PTR ErrorMessage,
                                       MIL_CONST_TEXT_PTR ErrorSubMessage1,
                                       MIL_CONST_TEXT_PTR ErrorSubMessage2,
                                       MIL_CONST_TEXT_PTR ErrorSubMessage3);

      MIL_INT MFTYPE MfuncExit();
      MIL_INT MFTYPE MfuncCustomExit(MIL_INT Code, MIL_CONST_TEXT_PTR Message);

      void MFTYPE MfuncParamMilText(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_TEXT_PTR ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);

      void MFTYPE MfuncParamConstMilText(MIL_ID ContextFuncId, MIL_INT ParamIndex,MIL_CONST_TEXT_PTR ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);


      void MFTYPE MfuncParamFilename(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_CONST_TEXT_PTR ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);


      MIL_INT MFTYPE MfuncPrintMessage(MIL_INT Mode, MIL_CONST_TEXT_PTR Str1,
                                       MIL_CONST_TEXT_PTR Str2,
                                       MIL_CONST_TEXT_PTR Str3,
                                       MIL_CONST_TEXT_PTR Str4,
                                       MIL_CONST_TEXT_PTR Str5);
      void MFTYPE MfuncParam(MIL_ID ContextFuncId, MIL_INT ParamIndex, const void* ParamValuePtr, MIL_UINT ParamType, MIL_INT NumOfItems, MIL_INT64 MilObjectType, MIL_INT Attribute);
#endif
// compatibility function
#if OldDefinesSupport
#define MfuncParamString   MfuncParamMilText
MIL_DEPRECATED(MfuncParamString, 1000)
#endif


MIL_ID MFTYPE MfuncAllocId(MIL_ID ContextFuncId, MIL_INT64 MilObjectType, void *UserObjectPtr);
MIL_INT MFTYPE MfuncParamCheck(MIL_ID ContextFuncId);
void MFTYPE MfuncParamMilId(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_ID ParamValue, MIL_INT64 MilObjectType, MIL_INT Attribute);
#if OldDefinesSupport
#define MfuncParamId MfuncParamMilId // it was documented in MIL 9, so keep it
MIL_DEPRECATED(MfuncParamId, 1000)
#endif
void MFTYPE MfuncParamLong (MIL_ID ContextFuncId, MIL_INT ParamIndex, long ParamValue);
void MFTYPE MfuncParamMilInt(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_INT ParamValue);
void MFTYPE MfuncParamMilInt32(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_INT32 ParamValue);
void MFTYPE MfuncParamMilInt64(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_INT64 ParamValue);
void MFTYPE MfuncParamMilUint(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UINT ParamValue);
void MFTYPE MfuncParamMilUint32(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UINT32 ParamValue);
void MFTYPE MfuncParamMilUint64(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UINT64 ParamValue);
void MFTYPE MfuncParamMilDouble(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_DOUBLE ParamValue);
void MFTYPE MfuncParamMilUUID(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UUID ParamValue);
void MFTYPE MfuncParamDataPointer(MIL_ID ContextFuncId, MIL_INT ParamIndex, void *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
#if OldDefinesSupport
#define MfuncParamDouble MfuncParamMilDouble // it was documented in MIL 9, so keep it
MIL_DEPRECATED(MfuncParamDouble, 1000)
#define MfuncParamPointer MfuncParamDataPointer
MIL_DEPRECATED(MfuncParamPointer, 1000)
#endif
void MFTYPE MfuncParamIdPointer(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_ID *ParamValuePtr, MIL_INT64 MilObjectType, MIL_INT Attribute);
void MFTYPE MfuncParamValue(MIL_ID ContextFuncId, MIL_INT ParamIndex, void *ParamValuePtr);
MIL_INT MFTYPE MfuncGetError(MIL_ID FunctId, MIL_INT ErrorType,void* ErrorVarPtr);
void MFTYPE MfuncFreeId(MIL_ID ContextFuncId, MIL_ID UserObjectFuncId);
void MFTYPE MfuncFree(MIL_ID ContextFuncId);
MIL_INT MFTYPE MfuncCall(MIL_ID ContextFuncId);
MIL_INT MFTYPE MfuncInquire(MIL_ID MilObjectId, MIL_INT64 InquireType, void* UserVarPtr);
void* MFTYPE MfuncMemory(MIL_INT64 Operation, MIL_INT OperationValue, MIL_INT64 OperationFlag, void *DataPointer);
MIL_ID MFTYPE MfuncGetNextId(MIL_ID CurrentId);
void MFTYPE MfuncMDTrace(void** FileHandle, MIL_INT64 Action, void* DataPointer);
void MFTYPE MfuncTraceTimerRead(MIL_DOUBLE* pCurrentTime);
#if M_MIL_USE_UNICODE
void MFTYPE MfuncTraceObjectMILW(MIL_UINT64 TraceType, MIL_CONST_TEXT_PTR String1);
void MFTYPE MfuncTraceObjectMILA(MIL_UINT64 TraceType, MIL_CONST_TEXT_PTR String1);
   #if M_MIL_UNICODE_API
      #define MfuncTraceObjectMIL                     MfuncTraceObjectMILW
   #else
      #define MfuncTraceObjectMIL                     MfuncTraceObjectMILA
   #endif
#else
void MFTYPE MfuncTraceObjectMIL(MIL_UINT64 TraceType, MIL_CONST_TEXT_PTR String1);
#endif


/* The following MfuncParamValue are for getting the value by type */
void MFTYPE MfuncParamValueMilInt(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_INT *ParamValuePtr);
void MFTYPE MfuncParamValueMilInt32(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_INT32 *ParamValuePtr);
void MFTYPE MfuncParamValueMilInt64(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_INT64 *ParamValuePtr);
void MFTYPE MfuncParamValueMilUint(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UINT *ParamValuePtr);
void MFTYPE MfuncParamValueMilUint32(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UINT32 *ParamValuePtr);
void MFTYPE MfuncParamValueMilUint64(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UINT64 *ParamValuePtr);

void MFTYPE MfuncParamValueMilDouble(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_DOUBLE *ParamValuePtr);
void MFTYPE MfuncParamValueMilUUID(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UUID *ParamValuePtr);
void MFTYPE MfuncParamValueMilId(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_ID *ParamValuePtr);

void MFTYPE MfuncParamValueArrayMilDouble(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_DOUBLE **ParamValuePtr);
void MFTYPE MfuncParamValueConstArrayMilDouble(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_DOUBLE **ParamValuePtr);
void MFTYPE MfuncParamValueArrayMilUUID(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UUID **ParamValuePtr);
void MFTYPE MfuncParamValueConstArrayMilUUID(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_UUID **ParamValuePtr);

#if OldDefinesSupport
#define MfuncParamValueDouble MfuncParamValueMilDouble                     // it was documented in MIL 9, so keep it
MIL_DEPRECATED(MfuncParamValueDouble, 1000)
#define MfuncParamValueId MfuncParamValueMilId                             // it was documented in MIL 9, so keep it
MIL_DEPRECATED(MfuncParamValueId, 1000)
#define MfuncParamValueArrayDouble MfuncParamValueArrayMilDouble           // it was documented in MIL 9, so keep it
MIL_DEPRECATED(MfuncParamValueArrayDouble, 1000)
#define MfuncParamValueConstArrayDouble MfuncParamValueConstArrayMilDouble // it was documented in MIL 9, so keep it
MIL_DEPRECATED(MfuncParamValueConstArrayDouble, 1000)
#endif

void MFTYPE MfuncParamValueMilTextA(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_TEXTA_PTR *ParamValuePtr);
void MFTYPE MfuncParamValueConstMilTextA(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_CONST_TEXTA_PTR *ParamValuePtr);
void MFTYPE MfuncParamValueFilenameA(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_CONST_TEXTA_PTR *ParamValuePtr);

#if M_MIL_USE_UNICODE
#if M_MIL_UNICODE_API
#define MfuncParamValueMilText            MfuncParamValueMilTextW
#define MfuncParamValueConstMilText       MfuncParamValueConstMilTextW
#define MfuncParamValueFilename           MfuncParamValueFilenameW
#else
#define MfuncParamValueMilText            MfuncParamValueMilTextA
#define MfuncParamValueConstMilText       MfuncParamValueConstMilTextA
#define MfuncParamValueFilename           MfuncParamValueFilenameA
#endif

void MFTYPE MfuncParamValueMilTextW(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_TEXTW_PTR *ParamValuePtr);
void MFTYPE MfuncParamValueConstMilTextW(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_CONST_TEXTW_PTR *ParamValuePtr);
void MFTYPE MfuncParamValueFilenameW(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_CONST_TEXTW_PTR *ParamValuePtr);

#else

void MFTYPE MfuncParamValueMilText(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_TEXT_PTR *ParamValuePtr);
void MFTYPE MfuncParamValueConstMilText(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_CONST_TEXT_PTR *ParamValuePtr);
void MFTYPE MfuncParamValueFilename(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_CONST_TEXT_PTR *ParamValuePtr);

#endif

void MFTYPE MfuncParamValueArrayMilInt(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_INT **ParamValuePtr);
void MFTYPE MfuncParamValueArrayMilUint(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UINT **ParamValuePtr);

void MFTYPE MfuncParamValueArrayMilInt32(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_INT32 **ParamValuePtr);
void MFTYPE MfuncParamValueArrayMilUint32(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UINT32 **ParamValuePtr);
void MFTYPE MfuncParamValueArrayMilInt64(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_INT64 **ParamValuePtr);
void MFTYPE MfuncParamValueArrayMilUint64(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UINT64 **ParamValuePtr);

void MFTYPE MfuncParamValueConstArrayMilInt32(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_INT32 **ParamValuePtr);
void MFTYPE MfuncParamValueConstArrayMilUint32(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_UINT32 **ParamValuePtr);
void MFTYPE MfuncParamValueConstArrayMilInt64(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_INT64 **ParamValuePtr);
void MFTYPE MfuncParamValueConstArrayMilUint64(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_UINT64 **ParamValuePtr);

void MFTYPE MfuncParamValueArrayMilId(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_ID **ParamValuePtr);
#if OldDefinesSupport
#define MfuncParamValueArrayId MfuncParamValueArrayMilId                          // it was documented in MIL 9, so keep it
MIL_DEPRECATED(MfuncParamValueArrayId, 1000)
#endif

void MFTYPE MfuncParamValuePointer(MIL_ID ContextFuncId, MIL_INT ParamIndex, void ** ParamValuePtr);
void MFTYPE MfuncParamValueConstDataPointer(MIL_ID ContextFuncId, MIL_INT ParamIndex, const void ** ParamValuePtr);
void MFTYPE MfuncParamValueConstArrayMilId(MIL_ID ContextFuncId, MIL_INT ParamIndex,const MIL_ID **ParamValuePtr);
#if OldDefinesSupport
#define MfuncParamValueConstArrayId MfuncParamValueConstArrayMilId                // it was documented in MIL 9, so keep it
MIL_DEPRECATED(MfuncParamValueConstArrayId, 1000)
#endif
void MFTYPE MfuncParamValueConstArrayMilInt(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_INT **ParamValuePtr);
void MFTYPE MfuncParamValueConstArrayMilUint(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_UINT **ParamValuePtr);


void MFTYPE MfuncParamArrayMilInt(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_INT *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamArrayMilDouble(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_DOUBLE *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamArrayMilUUID(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UUID *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
#if OldDefinesSupport
#define MfuncParamArrayDouble MfuncParamArrayMilDouble   // it was documented in MIL 9, so keep it
MIL_DEPRECATED(MfuncParamArrayDouble, 1000)
#endif
void MFTYPE MfuncParamArrayMilUint(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UINT *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamArrayMilId(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_ID *ParamValuePtr, MIL_INT NumOfItems, MIL_INT64 MilObjectType, MIL_INT Attribute);
#if OldDefinesSupport
#define MfuncParamArrayId MfuncParamArrayMilId           // it was documented in MIL 9, so keep it
MIL_DEPRECATED(MfuncParamArrayId, 1000)
#endif
void MFTYPE MfuncParamArrayMilInt32(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_INT32 *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamArrayMilInt64(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_INT64 *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamArrayMilUint32(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UINT32 *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamArrayMilUint64(MIL_ID ContextFuncId, MIL_INT ParamIndex, MIL_UINT64 *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);

void MFTYPE MfuncParamConstArrayMilDouble(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_DOUBLE *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamConstArrayMilUUID(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_UUID *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
#if OldDefinesSupport
#define MfuncParamConstArrayDouble MfuncParamConstArrayMilDouble // it was documented in MIL 9, so keep it
MIL_DEPRECATED(MfuncParamConstArrayDouble, 1000)
#endif
void MFTYPE MfuncParamConstArrayMilInt32(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_INT32 *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamConstArrayMilInt64(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_INT64 *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamConstArrayMilUint32(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_UINT32 *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamConstArrayMilUint64(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_UINT64 *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamConstArrayMilId(MIL_ID ContextFuncId, MIL_INT ParamIndex,const MIL_ID *ParamValuePtr, MIL_INT NumOfItems, MIL_INT64 MilObjectType, MIL_INT Attribute);
#if OldDefinesSupport
#define MfuncParamConstArrayId MfuncParamConstArrayMilId // it was documented in MIL 9, so keep it
MIL_DEPRECATED(MfuncParamConstArrayId, 1000)
#endif
void MFTYPE MfuncParamConstArrayMilInt(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_INT *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);
void MFTYPE MfuncParamConstArrayMilUint(MIL_ID ContextFuncId, MIL_INT ParamIndex, const MIL_UINT *ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);

void MFTYPE MfuncParamConstDataPointer(MIL_ID ContextFuncId, MIL_INT ParamIndex, const void * ParamValuePtr, MIL_INT NumOfItems, MIL_INT Attribute);

typedef struct 
   {
   MIL_INT32 StructSize;
   MIL_INT32 ScriptPathSize;
   MIL_INT32 ScriptPathOffset;
   MIL_INT32 ScriptFunctionNameSize;
   MIL_INT32 ScriptFunctionNameOffset;
   MIL_INT32 DebugPathSize;
   MIL_INT32 DebugPathOffset;
   MIL_INT32 ReferenceListSize;
   MIL_INT32 ReferenceListOffset;
   MIL_INT64 Compile;
   MIL_INT64 DebugInfo;
   } M_FUNCSCRIPT_CALL_DATA;

/*The following Mfunc functions are obsolete*/
MIL_INT MFTYPE MfuncStart(MIL_ID ContextFuncId);          /*Replaced by MfuncCall*/
void    MFTYPE MfuncFreeAndEnd(MIL_ID ContextFuncId);     /*Replaced by MfuncCall*/
MIL_INT MFTYPE MfuncModified(MIL_ID ImageId);      /*Replaced by MbufControl(M_MODIFIED)*/
MIL_INT MFTYPE MfuncParamRegister(MIL_ID ContextFuncId);  /*Parameters must always be registered*/
MIL_INT MFTYPE MfuncIdGetObjectType(MIL_ID FunctionId, MIL_ID ObjectId);               /*Replaced by MfuncInquire*/
void    MFTYPE MfuncIdSetUserPtr(MIL_ID FunctionId, MIL_ID ObjectId, void *UserPtr);   /*Replaced by MfuncControl*/
void*   MFTYPE MfuncIdGetUserPtr(MIL_ID FunctionId, MIL_ID ObjectId);                  /*Replaced by MfuncInquire*/

void   MFTYPE MfuncControlInt64(MIL_ID ContextFuncId, MIL_INT64 ControlType, MIL_INT64 ControlValue);
void   MFTYPE MfuncControlDouble(MIL_ID ContextFuncId, MIL_INT64 ControlType, MIL_DOUBLE ControlValue);

#if !M_MIL_USE_64BIT
void   MFTYPE MfuncControl(MIL_ID ContextFuncId, MIL_INT64 ControlType, MIL_DOUBLE ControlValue);
#endif   //M_MIL_USE_64BIT

/* C++ directive if needed */
#ifdef __cplusplus
}
#endif

#if M_MIL_USE_64BIT

#ifdef __cplusplus
//////////////////////////////////////////////////////////////
// MfuncControl function definition when compiling c++ files
//////////////////////////////////////////////////////////////

inline void MfuncControl(  MIL_ID ContextFuncId,
                           MIL_INT64 ControlType,
                           MIL_DOUBLE ControlValue)
   {
   MfuncControlDouble(ContextFuncId, ControlType, ControlValue);
   }

#else
//////////////////////////////////////////////////////////////
// For C file, call the default function, i.e. Int64 one
//////////////////////////////////////////////////////////////
#define MfuncControl MfuncControlInt64
#endif // __cplusplus

#endif   //M_MIL_USE_64BIT

//////////////////////////////////////////////////////////////
// MfuncControl function definition when compiling c++ files
//////////////////////////////////////////////////////////////
#ifdef __cplusplus

inline void MfuncControl(MIL_ID ContextFuncId,
   MIL_INT64 ControlType,
   MIL_INT64 ControlValue)
   {
   MfuncControlInt64(ContextFuncId, ControlType, ControlValue);
   }

#if !(M_MIL_USE_LINUX  && M_MIL_USE_64BIT)
inline void MfuncControl(MIL_ID ContextFuncId,
   MIL_INT64 ControlType,
   int ControlValue)
   {
   MfuncControlInt64(ContextFuncId, ControlType, ControlValue);
   }
#endif

inline void MfuncControl(MIL_ID ContextFuncId,
   MIL_INT64 ControlType,
   MIL_INT32 ControlValue)
   {
   MfuncControlInt64(ContextFuncId, ControlType, ControlValue);
   }



inline void MfuncControl(MIL_ID ContextFuncId,
   MIL_INT64 ControlType,
   MIL_CONST_TEXT_PTR ControlValue)
   {
   MfuncControl(ContextFuncId, ControlType, M_PTR_TO_MIL_INT(ControlValue));
   }

inline void MfuncControl(MIL_ID ContextFuncId,
   MIL_INT64 ControlType,
   void* ControlValue)
   {
   MfuncControl(ContextFuncId, ControlType, M_PTR_TO_MIL_INT(ControlValue));
   }

#endif


#endif
