Complex parameters and type translation. PLEASE HELP

"wuebai" <[email protected]>
Newsgroups gmane.comp.lang.delphi.jedi
Message-ID <[email protected]>
Can anyone properly translate this?

===================================
= Header File
===================================

#define IS_INTEGER(t) ((t) >= T_INT)

#define _NATURAL_CONSTANT_TWO_PI 6.283185307179586
#define _NATURAL_CONSTANT_PI (3.141592653589793)
#define _NATURAL_CONSTANT_E (2.718281828)

#ifdef _DSP
	typedef unsigned BITFIELD;
	#ifdef FLOAT64
		typedef double CGDOUBLE;
	#else
		typedef float CGDOUBLE;
	#endif

	#ifndef ASSERT
		#define ASSERT(x)
	#endif
#else
	typedef unsigned char BITFIELD;
	typedef double CGDOUBLE;
#endif

typedef struct
{ 
  BITFIELD isTemp:1;
  unsigned dim1;
  unsigned dim2;
#if VERSION_10X > 20
  unsigned dim3;
#endif
  CGDOUBLE d[1];
} MATRIX;

typedef struct {
  int len;
  CGDOUBLE *vec;
} VECTOR;
typedef VECTOR LPVECTOR;

typedef struct {
  int len;
  int *vec;
} IVECTOR;

typedef struct {
  int len;
  MATRIX ***vec;
} MVECTOR;

#ifndef _DSP
__declspec(dllexport) MATRIX *_stdcall EXPORT matDecl
(unsigned,unsigned);
__declspec(dllexport) MATRIX *_stdcall EXPORT matReDecl(MATRIX *m, 
unsigned dim1, unsigned dim2);
#endif

typedef struct
{ 
  BITFIELD isTemp:1;
  unsigned dim1;
  unsigned dim2;
  unsigned dim3;
  int d[1];
} iMATRIX;

typedef struct
{ double real, imag; } COMPLEX;

typedef struct
{ unsigned dim1;
  unsigned dim2;
  COMPLEX c[1];
} CMATRIX;

#ifdef _DEBUG
double *mxCheck( MATRIX *m, unsigned j1, unsigned j2);
double *mxCheck1D( MATRIX *m, unsigned j1);
double *mx1Check( MATRIX *m, unsigned j1, unsigned j2);
COMPLEX *cmxCheck( CMATRIX *m, unsigned j1, unsigned j2);
COMPLEX *cmx1Check( CMATRIX *m, unsigned j1, unsigned j2);
#define MX(m,j1,j2) (*mxCheck( m, j1, j2))
#define M1X(m,j1) (*mxCheck1D( m, j1))
#define MX1(m,j1,j2) (*mxCheck( m, (j1)-1, (j2)-1))
#define CMX(m,j1,j2) (*cmxCheck( m, j1, j2))
#define CMX1(m,j1,j2) (*cmxCheck( m, (j1)-1, (j2)-1))
#else
#define MX(m,j1,j2) m->d[(j1) + (j2) * m->dim1]
#define M1X(m,j1) m->d[j1]
#define MX1(m,j1,j2) m->d[(j1-1) + (j2-1) * m->dim1]
#define CMX(m,j1,j2) m->c[(j1) + (j2) * m->dim1]
#define CMX1(m,j1,j2) m->c[(j1-1) + (j2-1) * m->dim1]
#endif

#ifdef _MDEBUG
#define M3X(m,j1,j2,j3) *matRef3D( m, j1, j2, j3)
#else
#define M3X(m,j1,j2,j3) m->d[(j1) + (j2)*m->dim1 + (j3)*m->dim2*m-
>dim1]
#endif
typedef struct {
  int curSize;
  int maxSize;
  char *pText;
} STRING;

typedef struct {
#if _DSP
  unsigned radixPoint:8;
  unsigned wordLength:8;
#else
  char radixPoint;
  char wordLength;
#endif
  long val;
} SCALED_INT;

typedef struct {
  unsigned char type;
  union {
    double Double;
    float Float;
    int Int;
    long Long;
    STRING *Str;
#if VERSION_10X > 45
    COMPLEX Complex;
#endif
#ifdef VISSIM_H
    struct sig_vec v;
#endif
    MATRIX *m;
    SCALED_INT scaledInt;
  } u;
  struct node_info* n; // For Version 3.0
} SIGNAL;


typedef struct {
  double errEpsilon;
  int loopMax;
  unsigned iterationCount;
} OPT_INFO;

typedef struct {
  int iPort;
  LPSTR label;
  char fInput;
} CONNECTOR_DESC;



===================================
= Code File
===================================
	typedef struct {
		double 
WindSpeedHub,SensorHeight,RotorHeight,PowerLawExp;
		int PairNumber;
	} WECS_GETPOWER_INFO;

	__declspec(dllexport) void EXPORT _stdcall	WecsGetPower
(WECS_GETPOWER_INFO *pi,SIGNAL *inSig[], SIGNAL outSig[])
	{
	}


	__declspec(dllexport) long _stdcall EXPORT WecsGetPowerPA( 
short *ppCount)
	{
		return sizeof(WECS_GETPOWER_INFO);
	}


	__declspec(dllexport) void EXPORT _stdcall WecsGetPowerPI
(WECS_GETPOWER_INFO *pi)
	{
	}


	__declspec(dllexport) void EXPORT _stdcall WecsGetPowerSS
(WECS_GETPOWER_INFO *pi, long *runCount)
	{
	}


	__declspec(dllexport) LPSTR EXPORT _stdcall WecsGetPowerPC
(WECS_GETPOWER_INFO *pi, long *runCount)
	{
	}



	__declspec(dllexport) void EXPORT _stdcall WecsGetPowerSE
(double params[], long *runCount)
	{
	}



	__declspec(dllexport) LPSTR _stdcall EXPORT 
WecsGetPowerEvent(HWND h, int msg, WPARAM wParam, LPARAM lParam)
	{
		WECS_GETPOWER_INFO *pi;
		LPARAM blockHandle = lParam;
		int port;
		SIGNAL *outSig;
  
}




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/i7folB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/Delphi-JEDI/

<*> To unsubscribe from this group, send an email to:
     [email protected]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.