<member name="ref" type="string"/>
</struct>
<objref name="CALCIUM_integer" id="IDL:Ports/Calcium_Ports/Calcium_Integer_Port:1.0"/>
+ <objref name="CALCIUM_long" id="IDL:Ports/Calcium_Ports/Calcium_Long_Port:1.0"/>
<objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
<objref name="CALCIUM_double" id="IDL:Ports/Calcium_Ports/Calcium_Double_Port:1.0"/>
<objref name="CALCIUM_string" id="IDL:Ports/Calcium_Ports/Calcium_String_Port:1.0"/>
%feature("autodoc", "1");
+%include cstring.i
+
%{
//C++ Includes
#include <SALOMEconfig.h>
#define array_size(a,i) (((PyArrayObject *)a)->dimensions[i])
#define array_is_contiguous(a) (PyArray_ISCONTIGUOUS(a))
+const char* pytype_string(PyObject*);
+const char* typecode_string(int);
+int type_match(int, int);
+int require_size(PyArrayObject*, int*, int);
+int require_dimensions_n(PyArrayObject*, int*, int);
+int require_dimensions(PyArrayObject*, int);
+int require_contiguous(PyArrayObject*);
+PyArrayObject* make_contiguous(PyArrayObject*, int*, int, int);
+PyArrayObject* obj_to_array_no_conversion(PyObject*, int);
+PyArrayObject* obj_to_array_allow_conversion(PyObject*, int, int*);
+PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject*, int, int*);
+PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject*, int, int*);
+
/* Given a PyObject, return a string describing its type.
*/
const char* pytype_string(PyObject* py_obj) {
%include "carrays.i"
-%array_class(int, intArray);
-%array_class(float, floatArray);
+%array_class(int, intArray);
+%array_class(long, longArray);
+%array_class(float, floatArray);
%array_class(double, doubleArray);
/* special struct to handle string arrays */
{
stringArray(int nelements,int size=0) {
nelem=nelements;
+ size=size;
data= new char*[nelements];
for(int i=0;i<nelements;i++)
{
}
char** data;
int nelem;
+ int size;
};
%}
/* End of special struct to handle string arrays */
}
}
%typemap(freearg) type* IN_ARRAY3 {
- if (is_new_object$argnum && array$argnum) Py_DECREF(array$argnum);
+ if (is_new_object$argnum && array$argnum)
+ {
+ Py_DECREF(array$argnum);
+ }
}
%enddef
TYPEMAP_IN3(int, PyArray_INT)
+TYPEMAP_IN3(long, PyArray_LONG)
TYPEMAP_IN3(float, PyArray_FLOAT )
TYPEMAP_IN3(double, PyArray_DOUBLE)
#undef TYPEMAP_IN3
%apply int* IN_ARRAY3 {int *eval};
+%apply long* IN_ARRAY3 {long *eval};
%apply float* IN_ARRAY3 {float *eval};
%apply double* IN_ARRAY3 {double *eval};
}
}
%typemap(freearg) float* ecpval {
- if (is_new_object$argnum && array$argnum) Py_DECREF(array$argnum);
+ if (is_new_object$argnum && array$argnum)
+ {
+ Py_DECREF(array$argnum);
+ }
}
/* End of Specific typemap for complex */
/* array of strings on input */
-%typemap(in) char** eval
+%typemap(in) (char** eval,int strSize)
(ArrayObject* array=NULL, int is_new_object) {
stringArray* sarray;
if ((SWIG_ConvertPtr($input, (void **) &sarray, $descriptor(stringArray *),0)) == -1)
array = obj_to_array_contiguous_allow_conversion($input, PyArray_STRING, &is_new_object);
if (!array || !require_dimensions(array,1) || !require_size(array,size,1)) SWIG_fail;
$1 = (char**) malloc(array_size(array,0)*sizeof(char*));
+ $2 = array->strides[0];
for(int i=0;i<array_size(array,0);i++)
- $1[i]=(char*) array->data + i* array->strides[0];
+ {
+ $1[i]=(char*) malloc(sizeof(char)*(array->strides[0]+1));
+ strncpy($1[i],(char*) array->data + i* array->strides[0],array->strides[0]);
+ *($1[i]+array->strides[0])='\0';
+ }
%#else
SWIG_exception(SWIG_TypeError, "string array expected");
%#endif
else
{
$1=sarray->data;
+ $2=sarray->size;
}
}
-%typemap(freearg) char** eval {
- if (array$argnum) free($1);
- if (is_new_object$argnum && array$argnum) Py_DECREF(array$argnum);
+%typemap(freearg) (char** eval,int strSize) {
+ if (array$argnum)
+ {
+ for(int i=0;i<array_size(array$argnum,0);i++)
+ free($1[i]);
+ free($1);
+ }
+ if (is_new_object$argnum && array$argnum)
+ {
+ Py_DECREF(array$argnum);
+ }
}
/* End of array of strings on input */
%enddef
TYPEMAP_INPLACE3(int, PyArray_INT)
+TYPEMAP_INPLACE3(long, PyArray_LONG)
TYPEMAP_INPLACE3(float, PyArray_FLOAT )
TYPEMAP_INPLACE3(double, PyArray_DOUBLE)
#undef TYPEMAP_INPLACE3
%apply int* INPLACE_ARRAY3 {int *lval};
+%apply long* INPLACE_ARRAY3 {long *lval};
%apply float* INPLACE_ARRAY3 {float *lval};
%apply double* INPLACE_ARRAY3 {double *lval};
/* End of typemap for complex inout */
/* typemap for array of strings on input/output */
-%typemap(in) char** lval
+%typemap(in) (char** lval,int strSize)
(ArrayObject* temp=NULL) {
stringArray* sarray;
if ((SWIG_ConvertPtr($input, (void **) &sarray, $descriptor(stringArray *) ,0)) == -1)
temp = obj_to_array_no_conversion($input,PyArray_STRING);
if (!temp || !require_contiguous(temp)) SWIG_fail;
$1 = (char**) malloc(array_size(temp,0)*sizeof(char*));
+ $2 = temp->strides[0];
for(int i=0;i<array_size(temp,0);i++)
- $1[i]=(char*) temp->data+i*temp->strides[0];
+ {
+ $1[i]=(char*) temp->data+i*temp->strides[0];
+ memset($1[i],0,temp->strides[0]); //numpy strings must be completed with 0 up to elsize
+ }
%#else
temp = NULL;
SWIG_exception(SWIG_TypeError, "string array expected");
else
{
$1=sarray->data;
+ $2=sarray->size;
}
}
-%typemap(freearg) char** lval {
+%typemap(freearg) (char** lval,int strSize) {
if (temp$argnum) free($1);
}
/* End of typemap for array of strings on input/output */
%ignore CPMESSAGE;
%include "calciumP.h"
-int cp_cd(Superv_Component_i *component,char *name);
+%cstring_bounded_output(char *instanceName, 1024);
+
+int cp_cd(Superv_Component_i *component,char *instanceName);
int cp_een(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,int *eval);
int cp_edb(Superv_Component_i *component,int dep,double t,int n,char *nom,int nval,double *eval);
int cp_ecp(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,float *ecpval);
int cp_elo(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,int *eval);
int cp_ech(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,char** eval,int strSize);
+int cp_elg(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,long *eval);
+int cp_eln(Superv_Component_i *component,int dep,float t,int n,char *nom,int nval,long *eval);
int cp_len(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,int *lval);
int cp_lcp(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,float *lcpval);
int cp_llo(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,int *lval);
int cp_lch(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,char** lval,int strSize);
+int cp_llg(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,long *lval);
+int cp_lln(Superv_Component_i *component,int dep,float *ti,float *tf,int *niter,char *nom,int nmax,int *nval,long *lval);
int cp_fin(Superv_Component_i *component,int cp_end);
#include <string.h>
#include <stddef.h>
-// Interface C de SalomeCalcium
+// Interface C de SalomeCalcium
typedef int InfoType;
typedef char bool;
char * nomvar, int bufferLength, int * nRead,
char *** data, int strSize) {
- size_t _nRead;
- long _i=*i;
- fflush(stdout);fflush(stderr);
-
- InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i,
- nomvar, bufferLength, &_nRead,
- data);/*, strSize );
+ size_t _nRead;
+ long _i=*i;
+ fflush(stdout);fflush(stderr);
+
+ InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i,
+ nomvar, bufferLength, &_nRead,
+ data);/*, strSize );
strSize est inutile pour les ports CALCIUM
qui gèrent des tailles quelconques de chaines. */
- if(mode == CP_SEQUENTIEL)
- *i = _i;
- *nRead=_nRead;
- fflush(stdout);fflush(stderr);
-
- return info;
-};
+ if(mode == CP_SEQUENTIEL)
+ *i = _i;
+ *nRead=_nRead;
+ fflush(stdout);fflush(stderr);
+ return info;
+};
void ecp_lch_free (char* * data) { \
ecp_lecture_str_free(data); \
/* long _i=*i; */
/* fflush(stdout);fflush(stderr); */
/* fprintf(stderr,"Beginning of cp_lch: %s %d %f\n",nomvar,*i,*ti); */
-
/* if ( (data == NULL) || (bufferLength < 1) ) return CPNTNULL; */
-
/* InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i, */
/* nomvar, bufferLength, &_nRead, */
/* &data);*/
/* *nRead=_nRead; */
/* fprintf(stderr,"End of cp_lch: %s %d \n",nomvar,*i); */
/* fflush(stdout);fflush(stderr); */
-
/* return info; */
/* }; */
<type de données>, <nom de l'interface C2CPP à utiliser>, <qualificateur de type optionnel des données>,<paramètres supplémentaire ignoré>)*/
CALCIUM_LECT_INTERFACE_C_(len,float ,int,int ,int2integer,,);
-/*llg ne sera pas disponible si sizeof(long) == 64 bits && cal_int==int
- sinon problème de conversion de 64bits vers 32bits */
+/*llg ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
+ sinon problème de conversion de 64bits vers 32bits */
CALCIUM_LECT_INTERFACE_C_(llg,float ,int,long ,long2integer,,);
+CALCIUM_LECT_INTERFACE_C_(lln,float ,int,long ,long,,);
+
CALCIUM_LECT_INTERFACE_C_(lre,float ,int,float ,float,,);
CALCIUM_LECT_INTERFACE_C_(ldb,double,int,double ,double,,);
-CALCIUM_LECT_INTERFACE_C_(llo,float ,int,int ,bool,,);
+CALCIUM_LECT_INTERFACE_C_(llo,float ,int,int ,bool,,);
CALCIUM_LECT_INTERFACE_C_(lcp,float ,int,float ,cplx,,);
#define STAR *
#define LCH_LAST_PARAM ,int strsize
CALCIUM_LECT_INTERFACE_C_(len_fort_,float ,cal_int,cal_int ,integer,,);
CALCIUM_LECT_INTERFACE_C_(lin_fort_,float ,cal_int,int ,int2integer,,);
-/*llg ne sera pas disponible si sizeof(long) == 64 bits && cal_int==int
- sinon problème de conversion de 64bits vers 32bits */
+/*llg_fort_ ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
+ sinon problème de conversion de 64bits vers 32bits */
CALCIUM_LECT_INTERFACE_C_(llg_fort_,float ,cal_int,long ,long2integer,,);
CALCIUM_LECT_INTERFACE_C_(lre_fort_,float ,cal_int,float ,float,,);
CALCIUM_LECT_INTERFACE_C_(lcp_fort_,float ,cal_int,float ,cplx,,);
CALCIUM_LECT_INTERFACE_C_(lch_fort_,float ,cal_int,char ,str,STAR, LCH_LAST_PARAM );
+CALCIUM_LECT_INTERFACE_C_(lln_fort_,float ,cal_int,long ,long,,);
/**********************************************/
/* INTERFACES DE DÉBUT ET DE FIN DE COUPLAGE */
InfoType cp_fin (void * component, int code) {
/* TODO : gérer avec les callbacks des ports DSC */
-
+
InfoType info = ecp_fin_(component,code);
-
+
return info;
}
/* InfoType cp_ech(void * component, int mode, float t, int i, */
/* char * nomvar, int nbelem, */
/* char ** data, int strSize) { */
-
-/*long _i=i;*/
+
+/*long _i=i;*/
/* fflush(stdout);fflush(stderr); */
/* fprintf(stderr,"Beginning of cp_ech: %s %d %f\n",nomvar,i,t); */
/* if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; */
-
+
/* InfoType info = ecp_ecriture_str (component, mode, &t, i, */
/* nomvar, nbelem, */
/* data); */
/* fprintf(stderr,"End of cp_ech: %s %d \n",nomvar,i); */
/* fflush(stdout); */
/* fflush(stderr); */
-
+
/* return info; */
/* }; */
/* Definition des méthodes calcium standard */
/* CALCIUM_ECR_INTERFACE_C_(_name,_timeType,_calInt,type,_typeName,_qual) */
CALCIUM_ECR_INTERFACE_C_(een,float ,int,int ,int2integer,,);
+/*elg ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
+ sinon problème de conversion de 64bits vers 32bits */
CALCIUM_ECR_INTERFACE_C_(elg,float ,int,long ,long2integer,,);
CALCIUM_ECR_INTERFACE_C_(ere,float ,int,float ,float,,);
CALCIUM_ECR_INTERFACE_C_(edb,double,int,double,double,,);
CALCIUM_ECR_INTERFACE_C_(ecp,float ,int,float ,cplx,,);
CALCIUM_ECR_INTERFACE_C_(ech,float ,int,char ,str,STAR,LCH_LAST_PARAM );
+CALCIUM_ECR_INTERFACE_C_(eln,float ,int,long ,long,,);
+
/* Definition des méthodes calcium destinées à l'interfaçage fortran
avec une taille des INTEGER fortran paramétrés à la configuration du KERNEL */
CALCIUM_ECR_INTERFACE_C_(een_fort_,float ,cal_int,cal_int,integer,,);
+/*elg_fort_ ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
+ sinon problème de conversion de 64bits vers 32bits */
CALCIUM_ECR_INTERFACE_C_(elg_fort_,float ,cal_int,long ,long2integer,,);
CALCIUM_ECR_INTERFACE_C_(ein_fort_,float ,cal_int,int ,int2integer,,);
CALCIUM_ECR_INTERFACE_C_(ere_fort_,float ,cal_int,float ,float,,);
CALCIUM_ECR_INTERFACE_C_(elo_fort_,float ,cal_int,int ,bool,,);
CALCIUM_ECR_INTERFACE_C_(ecp_fort_,float ,cal_int,float ,cplx,,);
CALCIUM_ECR_INTERFACE_C_(ech_fort_,float ,cal_int,char ,str,STAR,LCH_LAST_PARAM );
+
+CALCIUM_ECR_INTERFACE_C_(eln_fort_,float ,cal_int,long ,long,,);
+
}
-extern "C"
+extern "C"
{
void cp_exit(int);
void setDependency(provides_port*, char*, CalciumTypes::DependencyType);
{
dynamic_cast<calcium_integer_port_provides *>(port)->setDependencyType(depend);
}
+ else if(std::string(type)=="CALCIUM_long")
+ {
+ dynamic_cast<calcium_long_port_provides *>(port)->setDependencyType(depend);
+ }
else if(std::string(type)=="CALCIUM_string")
{
dynamic_cast<calcium_string_port_provides *>(port)->setDependencyType(depend);
#endif
);
+extern int cp_llg(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ long * /* S Tableau d'entiers pour stocker les */
+ /* valeurs lues */
+#endif
+);
+
+extern int cp_lln(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance ou de lecture */
+ /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */,
+ float * /* E/S Borne inf de l'intervalle de lecture */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ float * /* E Borne Sup de l'intervalle de lecture */,
+ int * /* E/S Pas d'iteration a lire */
+ /* Retourne le pas lu dans le cas de */
+ /* lecture sequentielle */,
+ char * /* E Nom de la variable a lire */,
+ int /* E Nombre max de valeurs a lire */,
+ int * /* S Nombre de valeurs rellement lues */,
+ long * /* S Tableau d'entiers pour stocker les */
+ /* valeurs lues */
+#endif
+);
+
extern int cp_lre(
/* ------ */
#if CPNeedPrototype
#endif
);
+extern int cp_eln(
+/* ------ */
+#if CPNeedPrototype
+ void * component /* Pointeur de type Superv_Component_i* sur le */
+ /* composant SALOME Supervisable */,
+ int /* E Type de dependance */
+ /* CP_TEMPS, CP_ITERATION */,
+ float /* E Pas de temps a ecrire */,
+ int /* E Pas d'iteration a ecrire */,
+ char * /* E Nom de la variable a ecrire */,
+ int /* E Nombre de valeurs a ecrire */,
+ long * /* E Tableau d'entiers a ecrire */
+#endif
+);
+
extern int cp_ere(
/* ------ */
#if CPNeedPrototype
#include "CalciumFortranInt.h"
#include <stdio.h>
-static void* COMPO=0;
-
#ifdef __cplusplus
extern "C" {
#endif
-static void fstrtocstr(char *cstr, char *fstr,cal_int fstr_len)
+static void fstrtocstr(char *cstr, char *fstr,cal_int fstr_len)
{
cal_int i,iend;
- for (iend = fstr_len-1; iend >= 0; iend--)
+ for (iend = fstr_len-1; iend >= 0; iend--)
if (fstr[iend] != ' ') break;
for (i = 0; i <= iend; i++)
cstr[i] = fstr[i];
cstr[i] = '\0';
}
-static void cstrtofstr(char *cstr, char *fstr,cal_int fstr_len)
+static void cstrtofstr(char *cstr, char *fstr,cal_int fstr_len)
{
cal_int i, len;
len = strlen(cstr);
cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpllg,CPLLG)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
cal_int *max,cal_int *n, long *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cplln,CPLLN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+ cal_int *max,cal_int *n, long *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cplen,CPLEN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
cal_int *max,cal_int *n, cal_int *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpllo,CPLLO)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
#if !SIZEOF_INT
-#error "The macro SIZEOF_INT must be defined."
+#error "The macro SIZEOF_INT must be defined."
#elif SIZEOF_INT == 4
*err=cp_lin_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
#else
{
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
#if !SIZEOF_LONG
-#error "The macro SIZEOF_LONG must be defined."
+#error "The macro SIZEOF_LONG must be defined."
#elif SIZEOF_LONG == 8
*err=cp_llg_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
#else
free_str1(cnom);
}
+void F_FUNC(cplln,CPLLN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+ cal_int *max,cal_int *n, long *tab,cal_int *err STR_PLEN(nom))
+{
+ char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
+#if !SIZEOF_LONG
+#error "The macro SIZEOF_LONG must be defined."
+#elif SIZEOF_LONG == 8
+ *err=cp_lln_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
+#else
+ fprintf(stderr,"End of CPLLN: %s : Can't use fortran INTEGER*8 because long C is not 64bits long on this machine.\n",
+ cnom);
+#endif
+ free_str1(cnom);
+}
+
+
void F_FUNC(cplen,CPLEN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
cal_int *max,cal_int *n, cal_int *tab,cal_int *err STR_PLEN(nom))
{
*err=cp_lch_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tabChaine,STR_LEN(tab));
- for (index = 0; index < *n; index++)
- strncpy(&tab[index * STR_LEN(tab)], tabChaine[index], strlen(tabChaine[index]));
+ if (*err == CPOK )
+ {
+ for (index = 0; index < *n; index++)
+ {
+ strncpy(&tab[index * STR_LEN(tab)], tabChaine[index], strlen(tabChaine[index]));
+ if(STR_LEN(tab) > strlen(tabChaine[index]))
+ memset(&tab[index * STR_LEN(tab)+strlen(tabChaine[index])],' ',STR_LEN(tab)-strlen(tabChaine[index]));
+ }
+ }
- if (tabChaine != (char **) NULL) {
- for (index = 0; index < *n; index++)
- free(tabChaine[index]);
- free(tabChaine);
- }
+ if (tabChaine != (char **) NULL)
+ {
+ for (index = 0; index < *max; index++)
+ free(tabChaine[index]);
+ free(tabChaine);
+ }
free_str1(cnom);
}
/***************************/
/* INTERFACES D'ECRITURE */
/***************************/
-void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err
+void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err
STR_PLEN(nom) STR_PLEN(tab));
void F_FUNC(cpedb,CPEDB)(long *compo,cal_int *dep,double *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, double *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpere,CPERE)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpecp,CPECP)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpein,CPEIN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpelg,CPELG)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, long *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cpeln,CPELN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, long *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpeen,CPEEN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, cal_int *tab,cal_int *err STR_PLEN(nom));
void F_FUNC(cpelo,CPELO)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
-void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err
+void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err
STR_PLEN(nom) STR_PLEN(tab))
{
char ** tabChaine=NULL;
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
tabChaine = (char **) malloc(sizeof(char *) * *n);
- for (index = 0; index < *n; index++) {
-
- tabChaine[index] = (char *) malloc(sizeof(char) * (STR_LEN(tab) + 1));
- strncpy(tabChaine[index],&tab[STR_LEN(tab) * index],STR_LEN(tab));
- tabChaine[index][STR_LEN(tab)]='\0';
- for (index2 = STR_LEN(tab) - 1; index2 >= 0; index2--) {
- if ( tabChaine[index][index2] == ' ' ||
- tabChaine[index][index2] == '\0' )
- tabChaine[index][index2]='\0';
+ for (index = 0; index < *n; index++)
+ {
+ tabChaine[index] = (char *) malloc(sizeof(char) * (STR_LEN(tab) + 1));
+ strncpy(tabChaine[index],&tab[STR_LEN(tab) * index],STR_LEN(tab));
+ tabChaine[index][STR_LEN(tab)]='\0';
+ for (index2 = STR_LEN(tab) - 1; index2 >= 0; index2--)
+ {
+ if ( tabChaine[index][index2] == ' ' || tabChaine[index][index2] == '\0' )
+ tabChaine[index][index2]='\0';
+ }
}
- }
*err=cp_ech_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tabChaine,STR_LEN(tab) );
- if (tabChaine != (char **) NULL) {
- for (index = 0; index < *n; index++)
- free(tabChaine[index]);
-
- free(tabChaine);
- }
+ if (tabChaine != (char **) NULL)
+ {
+ for (index = 0; index < *n; index++)
+ free(tabChaine[index]);
+ free(tabChaine);
+ }
free_str1(cnom);
}
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
#if !SIZEOF_INT
-#error "The macro SIZEOF_INT must be defined."
+#error "The macro SIZEOF_INT must be defined."
#elif SIZEOF_INT == 4
*err=cp_ein_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
#else
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
#if !SIZEOF_LONG
-#error "The macro SIZEOF_LONG must be defined."
+#error "The macro SIZEOF_LONG must be defined."
#elif SIZEOF_LONG == 8
*err=cp_elg_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
#else
free_str1(cnom);
}
+void F_FUNC(cpeln,CPELN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, long *tab,cal_int *err STR_PLEN(nom))
+{
+
+ char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
+#if !SIZEOF_LONG
+#error "The macro SIZEOF_LONG must be defined."
+#elif SIZEOF_LONG == 8
+ *err=cp_eln_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
+#else
+ fprintf(stderr,"CPELN: %s %f %d : Can't use fortran INTEGER*8 because long C is not 64bits long on this machine.\n",
+ cnom, *ti,*iter);
+#endif
+ free_str1(cnom);
+}
+
+
void F_FUNC(cpeen,CPEEN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, cal_int *tab,cal_int *err STR_PLEN(nom))
{
char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
CALCIUM_ECR_INTERFACE_C_H(een_fort_,float ,cal_int,cal_int,integer,,);
CALCIUM_ECR_INTERFACE_C_H(elg_fort_,float ,cal_int,long ,long2integer,,);
+CALCIUM_ECR_INTERFACE_C_H(eln_fort_,float ,cal_int,long ,long,,);
CALCIUM_ECR_INTERFACE_C_H(ein_fort_,float ,cal_int,int ,int2integer,,);
CALCIUM_ECR_INTERFACE_C_H(ere_fort_,float ,cal_int,float ,float,,);
CALCIUM_ECR_INTERFACE_C_H(edb_fort_,double,cal_int,double,double,,);
#define CALCIUM_LECT_INTERFACE_C_H(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \
+ extern void cp_##_name##_free ( _type _qual * data); \
extern _calInt cp_##_name (void * component, _calInt mode, \
_timeType * ti, _timeType * tf, _calInt * i, \
char * nomvar, _calInt bufferLength, \
_calInt * nRead, _type _qual * data \
lastarg ) ; \
\
-
+
CALCIUM_LECT_INTERFACE_C_H(len_fort_,float ,cal_int,cal_int ,integer,,);
CALCIUM_LECT_INTERFACE_C_H(llg_fort_,float ,cal_int,long ,long2integer,,);
+CALCIUM_LECT_INTERFACE_C_H(lln_fort_,float ,cal_int,long ,long,,);
CALCIUM_LECT_INTERFACE_C_H(lin_fort_,float ,cal_int,int ,int2integer,,);
CALCIUM_LECT_INTERFACE_C_H(lre_fort_,float ,cal_int,float ,float,,);
CALCIUM_LECT_INTERFACE_C_H(ldb_fort_,double,cal_int,double ,double,,);