13 static void fstrtocstr(char *cstr, char *fstr,int fstr_len)
16 for (iend = fstr_len-1; iend >= 0; iend--)
17 if (fstr[iend] != ' ') break;
18 for (i = 0; i <= iend; i++)
23 static void cstrtofstr(char *cstr, char *fstr,int fstr_len)
27 if (len > fstr_len) len = fstr_len;
28 for (i = 0; i < len; i++)
34 static char * fstr1(char *nom,int nnom)
36 char * cnom=(char*)malloc((nnom+1)*sizeof(char));
37 fstrtocstr(cnom,nom,nnom);
41 static char * free_str1(char *nom)
46 void F_FUNC(cpcd,CPCD)(long *compo,STR_PSTR(nom),int *info STR_PLEN(nom))
48 /* nom is OUT argument */
49 cp_cd((void *)*compo,STR_PTR(nom));
50 /* replace in place ??? */
51 cstrtofstr(STR_PTR(nom),STR_PTR(nom),STR_LEN(nom));
54 void F_FUNC(cplen,CPLEN)(long *compo,int *dep,float *ti,float *tf,int *iter,STR_PSTR(nom),
55 int *max,int *n, int *tab,int *err STR_PLEN(nom))
57 char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
58 fprintf(stderr,"CPLEN: %s %f %f\n",cnom,*ti,*tf);
59 *err=cp_len((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
60 fprintf(stderr,"End of CPLEN: %s \n",cnom);
64 void F_FUNC(cpllo,CPLLO)(long *compo,int *dep,float *ti,float *tf,int *iter,STR_PSTR(nom),
65 int *max,int *n, int *tab,int *err STR_PLEN(nom))
67 char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
68 fprintf(stderr,"CPLLO: %s %f %f\n",cnom,*ti,*tf);
69 *err=cp_llo((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
70 fprintf(stderr,"End of CPLLO: %s \n",cnom);
74 void F_FUNC(cpldb,CPLDB)(long *compo,int *dep,double *ti,double *tf,int *iter,STR_PSTR(nom),
75 int *max,int *n, double *tab,int *err STR_PLEN(nom))
77 char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
78 fprintf(stderr,"CPLDB: %s %f %f \n",cnom, *ti,*tf);
79 *err=cp_ldb((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
80 fprintf(stderr,"End of CPLDB: %s %f %f \n",cnom,*ti,*tf);
84 void F_FUNC(cplre,CPLRE)(long *compo,int *dep,float *ti,float *tf,int *iter,STR_PSTR(nom),
85 int *max,int *n, float *tab,int *err STR_PLEN(nom))
87 char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
88 fprintf(stderr,"CPLRE: %s %f %f \n",cnom, *ti,*tf);
89 *err=cp_lre((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
90 fprintf(stderr,"End of CPLRE: %s %f %f \n",cnom,*ti,*tf);
94 void F_FUNC(cplcp,CPLCP)(long *compo,int *dep,float *ti,float *tf,int *iter,STR_PSTR(nom),
95 int *max,int *n, float *tab,int *err STR_PLEN(nom))
97 char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
98 fprintf(stderr,"CPLCP: %s %f %f \n",cnom, *ti,*tf);
99 *err=cp_lcp((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab);
100 fprintf(stderr,"End of CPLCP: %s %f %f \n",cnom,*ti,*tf);
104 void F_FUNC(cplch,CPLCH)(long *compo,int *dep,float *ti,float *tf,int *iter,STR_PSTR(nom),
105 int *max,int *n, char *tab,int *err STR_PLEN(nom) STR_PLEN(tab) )
107 char **tabChaine=NULL;
109 char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
110 fprintf(stderr,"CPLCH: %s %f %f \n",cnom, *ti,*tf);
112 tabChaine = (char **) malloc(sizeof(char *) * (*max));
113 for (index = 0; index < *max; index++)
114 tabChaine[index] = (char *) malloc(sizeof(char) * (STR_LEN(tab)+1));
116 *err=cp_lch((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tabChaine,STR_LEN(tab));
118 for (index = 0; index < *n; index++)
119 strcpy(&tab[index * STR_LEN(tab)], tabChaine[index]);
121 fprintf(stderr,"End of CPLCH: %s %f %f \n",cnom,*ti,*tf);
122 if (tabChaine != (char **) NULL) {
123 for (index = 0; index < *n; index++)
124 free(tabChaine[index]);
130 void F_FUNC(cpech,CPECH)(long *compo,int *dep,float *ti,int *iter,STR_PSTR(nom),int *n, char *tab,int *err
131 STR_PLEN(nom) STR_PLEN(tab))
133 char ** tabChaine=NULL;
134 int index=0,index2=0;
135 char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
136 fprintf(stderr,"CPECH: %s %f \n",cnom, *ti);
138 tabChaine = (char **) malloc(sizeof(char *) * *n);
139 for (index = 0; index < *n; index++) {
141 tabChaine[index] = (char *) malloc(sizeof(char) * (STR_LEN(tab) + 1));
142 strncpy(tabChaine[index],&tab[STR_LEN(tab) * index],STR_LEN(tab));
143 tabChaine[index][STR_LEN(tab)]='\0';
144 for (index2 = STR_LEN(tab) - 1; index2 >= 0; index2--) {
145 if ( tabChaine[index][index2] == ' ' ||
146 tabChaine[index][index2] == '\0' )
147 tabChaine[index][index2]='\0';
151 *err=cp_ech((void *)*compo,*dep,*ti,*iter,cnom,*n,tabChaine,STR_LEN(tab) );
153 fprintf(stderr,"End of CPECH: %s %f \n",cnom, *ti);
154 if (tabChaine != (char **) NULL) {
155 for (index = 0; index < *n; index++)
156 free(tabChaine[index]);
163 void F_FUNC(cpedb,CPEDB)(long *compo,int *dep,double *ti,int *iter,STR_PSTR(nom),int *n, double *tab,int *err STR_PLEN(nom))
165 char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
166 fprintf(stderr,"CPEDB: %s %f \n",cnom, *ti);
167 *err=cp_edb((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
168 fprintf(stderr,"End of CPEDB: %s %f \n",cnom, *ti);
172 void F_FUNC(cpere,CPERE)(long *compo,int *dep,float *ti,int *iter,STR_PSTR(nom),int *n, float *tab,int *err STR_PLEN(nom))
174 char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
175 fprintf(stderr,"CPERE: %s %f \n",cnom, *ti);
176 *err=cp_ere((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
177 fprintf(stderr,"End of CPERE: %s %f \n",cnom, *ti);
181 void F_FUNC(cpecp,CPECP)(long *compo,int *dep,float *ti,int *iter,STR_PSTR(nom),int *n, float *tab,int *err STR_PLEN(nom))
183 char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
184 fprintf(stderr,"CPECP: %s %f \n",cnom, *ti);
185 *err=cp_ecp((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
186 fprintf(stderr,"End of CPECP: %s %f \n",cnom, *ti);
190 void F_FUNC(cpeen,CPEEN)(long *compo,int *dep,float *ti,int *iter,STR_PSTR(nom),int *n, int *tab,int *err STR_PLEN(nom))
192 char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
193 fprintf(stderr,"CPEEN: %s %f %d\n",cnom, *ti,*iter);
194 *err=cp_een((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
195 fprintf(stderr,"End of CPEEN: %s %f \n",cnom,*ti);
199 void F_FUNC(cpelo,CPELO)(long *compo,int *dep,float *ti,int *iter,STR_PSTR(nom),int *n, int *tab,int *err STR_PLEN(nom))
201 char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
202 fprintf(stderr,"CPELO: %s %f %d\n",cnom, *ti,*iter);
203 *err=cp_elo((void *)*compo,*dep,*ti,*iter,cnom,*n,tab);
204 fprintf(stderr,"End of CPELO: %s %f \n",cnom,*ti);
208 void F_FUNC(cpfin,CPFIN)(long *compo,int *dep,int *err)
210 fprintf(stderr,"CPFIN: \n");
211 *err=cp_fin((void *)*compo,*dep);