138{
140
141 int int_step=0;
142 int float_step=0;
143
144 char *scan_in_description;
145 char *scan_out_description;
146 char *final_description;
147
148 int nb_int;
149 int *tab_int=NULL;
150
151 int nb_float;
152 float *tab_float=NULL;
153
155
156 int final_description_length;
157 line[0]='\0';
158
160
161 length = strlen(description);
162
163
164 length = length + nb_int*4*((int)sizeof(int)) + nb_float*4*((int)sizeof(float)) + 1;
165
166 final_description_length=length;
168
169 scan_in_description = description;
170 scan_out_description = final_description;
171
172 *(scan_out_description)='\0';
173
174 while((*scan_in_description) != '\0')
175 {
176 if ((*scan_in_description) == '%')
177 {
178 if ((*(scan_in_description+1)) == 'd')
179 {
180 if (int_step < nb_int)
181 {
182 sprintf(line, "%d", *(tab_int+int_step));
183 int_step++;
184 }
185 }
186 else if ((*(scan_in_description+1)) == 'f')
187 {
188 if (float_step < nb_float)
189 {
190
191 sprintf(line, "%g", *(tab_float+float_step));
192 float_step++;
193 }
194 }
195 else if ((*(scan_in_description+1)) == 's')
196 {
197 if (int_step < nb_int)
198 {
199 length = *(tab_int+int_step);
200 int_step++;
201 }
202 else
203 {
204 length = 0;
205 }
206
207 if ( ( length != 0) && ((nb_int-int_step) >= length))
208 {
211 else
213
215 int_step = int_step+length;
216 }
217 }
218
219 length = strlen(line);
220 #ifdef _WIN64
221 strcat_s(final_description,final_description_length, line);
222 #else
223 strcat(final_description, line);
224 #endif
225 line[0]='\0';
226
227 scan_out_description = scan_out_description + length;
228
229 scan_in_description = scan_in_description +2;
230 }
231 else
232 {
233 *scan_out_description=*scan_in_description;
234 *(scan_out_description+1)='\0';
235 scan_out_description=scan_out_description+1;
236
237 scan_in_description = scan_in_description +1;
238 }
239 }
240
241 return final_description;
242}
int analyse_get_datas(int name_id, int *nb_int, int **tab_int, int *nb_float, float **tab_float)
#define ANALYSE_SIZE_OF_LINE
void * analyse_malloc(size_t size)
void analyse_convert_int_to_string(int nb_int, int *tab_int, char *message)