#ifndef _mdsdef_h
#define _mdsdef_h 1


#define TRUE    1
#define FALSE   0
#define EOS     '\0'

#pragma pack(push, 8)

typedef mxreal   mds_real;
typedef mds_real mds_point[3];
typedef long     mds_name[2];
typedef mds_real mds_matrix[4][4];


typedef mds_real *mds_pointp;
typedef long     *mds_namep;



#ifdef X
#undef X
#endif
#ifdef Y
#undef Y
#endif
#ifdef Z
#undef Z
#endif
#ifdef T
#undef T
#endif

#ifndef _XYZT_DEFINED
#define _XYZT_DEFINED
enum { X = 0, Y = 1, Z = 2 }; 
enum { T = 3 };              
#endif 


#define MX_PAUSE "\\"


enum {
	RSG_NONULL      = 0x01,  
	RSG_NOZERO      = 0x02,  
	RSG_NONEG       = 0x04,  
	RSG_NOLIM       = 0x08,  
	RSG_GETZ        = 0x10,  
	RSG_DASH        = 0x20,  

	RSG_2D          = 0x40,  

	RSG_OTHER       = 0x80,  
	RSG_DDISTFIRST  = 0x100,

	RSG_NOXORDRAG   = 0x200,


	RSG_DYNXYCOORDINPUT = 0x400,
	REG_DYNANGELINPUT   = 0x800,
	REG_DISTANCEINPUT	= 0x1000,
	RET_AUTOINPUT       = 0x2000,

	MX_DOUBLE_EXIT      = 0x4000,
	MX_OffsetInputPostion = 0x8000,
	MX_LONGPRESSEDCATCH = 0x10000
};


enum {
	INP_NNULL   = RSG_NONULL,
	INP_NZERO   = RSG_NOZERO,
	INP_NNEG    = RSG_NONEG,
	INP_NLIM    = RSG_NOLIM,
	INP_DASH    = RSG_DASH,
	INP_NZCOORD = RSG_2D
};


struct mds_binary {    
	mxuint32 clen;        
	char *buf;        
};


union mds_u_val {
	mds_real rreal;
	mds_real rpoint[3];
	short rint;
	LPTSTR rstring;
	long rlname[2];
	long rlong;   
	struct mds_binary rbinary;
	unsigned char ihandle[8];
	MxObjectId  objId;
	void*  pObj;
}; 


struct resbuf {                                                  
	struct resbuf *rbnext; 
	short restype;
	union mds_u_val resval;
	resbuf()
	{
		restype = 5003 ;	// RTSHORT
		rbnext  = 0;
		resval.rint = 0;
	}
};

typedef struct resbuf *pResbuf;
typedef const struct resbuf *kpResbuf;

struct sutOpenFileParam {
	bool isValidPtView;
	McGePoint3d ptView1;
	McGePoint3d ptView2;
	bool isExtractOle;
	int iRetResultExtractOle;
	sutOpenFileParam() {
		isValidPtView = false;
		isExtractOle = false;
		iRetResultExtractOle = 0;
	}
};

struct sutWriteFileParam {
	int iCompressionLevel;
	std::string sSrcFileMd5;
	int iSyncCustomEntityData;
	const std::set<std::string>* pAfterConversionExternalReference;
	sutWriteFileParam() {
		iCompressionLevel = 1;
		pAfterConversionExternalReference = 0;
		iSyncCustomEntityData = 3;
	}
};

#pragma pack(pop)


#define ArxData_Flag_Set_BlockReference_ExGrid 0x1

#endif
