OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
write_routtines.c File Reference
#include "hardware.inc"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <fcntl.h>
#include <zlib.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <time.h>
#include <sys/stat.h>
#include <unistd.h>

Go to the source code of this file.

Macros

#define _FCALL
#define BUFLEN   256
#define ZSUFFIX   0
#define GZSUFFIX   1
#define COMP_BUFFER_SIZE   10240

Functions

void integer_to_IEEE_ASCII (int entier, unsigned char octet[4])
void IEEE_ASCII_to_integer (int *entier, unsigned char octet[4])
void real_to_IEEE_ASCII (float reel, unsigned char octet[4])
void IEEE_ASCII_to_real (float *reel, unsigned char octet[4])
void double_to_IEEE_ASCII (double *reel, unsigned char octet[1000][8], int len)
void IEEE_ASCII_to_double (double *reel, unsigned char octet[1000][8], int len)
void file_init_ ()
void open_c (int *ifil, int *len, int *mod)
void close_c ()
void fseek_c_rd (int *lseek)
void fseek_end_c (int *lseek)
void file_size (int *filesize)
void filelen_sys (char *ffilnam, int *len, int *size)
void cur_fil_c (int *nf)
void eor_c (int *len)
void write_r_c (float *w, int *len)
void write_db_c (double *w, int *len)
void write_db_array_c (double *w, int *len)
void write_c_c (int *w, int *len)
void write_c_c_txt (char *w, int *len)
void write_i_c (int *w, int *len)
void write_i_array_c (int *w, int *len)
void write_s_c (int *w, int *len)
void read_db_c (double *w, int *len)
void read_db_array_c (double *w, int *len)
void read_r_c (float *w, int *len)
void read_i_c (int *w, int *len)
void read_i_array_c (int *w, int *len)
void read_c_c (int *w, int *len)
void flu_fil_c ()
void arret_ (int *n)
void ARRET (int *n)
void arret_c (int n)
int Compress_Buffer (unsigned char *input, int inputSize, unsigned char *output, int outputSize)
void write_buffer (unsigned char *buf, int type_size, int length)
void close_buffer ()
void delete_tmpfile_ (char *name, int *size)
void file_init ()
void _FCALL FILE_INIT ()
void _FCALL OPEN_C (int *ifil, int *len, int *mod)
void open_c_ (int *ifil, int *len, int *mod)
void open_c__ (int *ifil, int *len, int *mod)
void _FCALL CLOSE_C ()
void close_c_ ()
void close_c__ ()
void fseek_c_rd_ (int *lseek)
void fseek_c_rd__ (int *lseek)
void _FCALL FSEEK_C_RD (int *lseek)
void fseek_end_c_ (int *lseek)
void _FCALL FSEEK_END_C (int *lseek)
void file_size_ (int *filesize)
void file_size__ (int *filesize)
void _FCALL FILE_SIZE (int *filesize)
void file_size_c_ (long *size)
void _FCALL FILE_SIZE_C (long *size)
void filelen_sys_ (char *ffilnam, int *len, int *size)
void filelen_sys__ (char *ffilnam, int *len, int *size)
void _FCALL FILELEN_SYS (char *ffilnam, int *len, int *size)
void _FCALL CUR_FIL_C (int *nf)
void cur_fil_c_ (int *nf)
void cur_fil_c__ (int *nf)
void _FCALL EOR_C (int *len)
void eor_c_ (int *len)
void _FCALL WRITE_R_C (float *w, int *len)
void write_r_c_ (float *w, int *len)
void _FCALL WRITE_DB_C (double *w, int *len)
void write_db_c_ (double *w, int *len)
void write_db_c__ (double *w, int *len)
void _FCALL WRITE_DB_ARRAY_C (double *w, int *len)
void write_db_array_c_ (double *w, int *len)
void write_db_array_c__ (double *w, int *len)
void _FCALL WRITE_C_C (int *w, int *len)
void write_c_c_ (int *w, int *len)
void write_c_c__ (int *w, int *len)
void _FCALL WRITE_C_C_TXT (char *w, int *len)
void write_c_c_txt_ (char *w, int *len)
void write_c_c_txt__ (char *w, int *len)
void _FCALL WRITE_I_C (int *w, int *len)
void write_i_c_ (int *w, int *len)
void write_i_c__ (int *w, int *len)
void _FCALL WRITE_I_ARRAY_C (int *w, int *len)
void write_i_array_c_ (int *w, int *len)
void write_i_array_c__ (int *w, int *len)
void _FCALL WRITE_S_C (int *w, int *len)
void write_s_c_ (int *w, int *len)
void _FCALL READ_DB_C (double *w, int *len)
void read_db_c_ (double *w, int *len)
void _FCALL READ_DB_ARRAY_C (double *w, int *len)
void read_db_array_c_ (double *w, int *len)
void _FCALL READ_R_C (float *w, int *len)
void read_r_c_ (float *w, int *len)
void _FCALL READ_I_C (int *w, int *len)
void read_i_c_ (int *w, int *len)
void _FCALL READ_I_ARRAY_C (int *w, int *len)
void read_i_array_c_ (int *w, int *len)
void _FCALL READ_C_C (int *w, int *len)
void read_c_c_ (int *w, int *len)
void read_c_c__ (int *w, int *len)
void _FCALL FLU_FIL_C ()
void flu_fil_c_ ()
void flu_fil_c__ ()
void _FCALL DELETE_TMPFILE (char *name, int *size)
void delete_tmpfile__ (char *name, int *size)
void delete_tmpfile (char *name, int *size)

Variables

FILE * outfile [100]
int outfile_mod [100]
unsigned char * compress_write_buffer [100]
gzFile compress_read_buffer [100]
int compress_buffer_length [100]
FILE * curfile
int cur_nf

Macro Definition Documentation

◆ _FCALL

#define _FCALL

Definition at line 50 of file write_routtines.c.

◆ BUFLEN

#define BUFLEN   256

Definition at line 105 of file write_routtines.c.

◆ COMP_BUFFER_SIZE

#define COMP_BUFFER_SIZE   10240

Definition at line 109 of file write_routtines.c.

◆ GZSUFFIX

#define GZSUFFIX   1

Definition at line 107 of file write_routtines.c.

◆ ZSUFFIX

#define ZSUFFIX   0

Definition at line 106 of file write_routtines.c.

Function Documentation

◆ ARRET()

void ARRET ( int * n)

◆ arret_()

void arret_ ( int * n)

◆ arret_c()

void arret_c ( int n)

Calls the Fortran Arret routine for termination

n is the error termination

Definition at line 132 of file write_routtines.c.

137{
138/*Appel a une routine Fortran */
139#ifdef _WIN64
140 ARRET(&n);
141#else
142 arret_(&n);
143#endif
144}
n
void ARRET(int *n)
void arret_(int *n)

◆ close_buffer()

void close_buffer ( )

Close the file in uncompressed mode

Compress last buffers, write & close the file/

Definition at line 1000 of file write_routtines.c.

1000 {
1005 int mod,len,compressed_len,compressed_buf_len;
1006 unsigned char *compressed_buf;
1007
1008 mod=outfile_mod[cur_nf];
1009 if( mod != 0){
1011 if (len > 0){
1012
1013 compressed_buf=(unsigned char *)malloc(sizeof(unsigned char)*(len+2048));
1014 compressed_buf_len=len+2048;
1015 compressed_len = Compress_Buffer(compress_write_buffer[cur_nf], len , compressed_buf, compressed_buf_len);
1016 fwrite(compressed_buf,sizeof(unsigned char),compressed_len,curfile);
1017 }
1018 free(compress_write_buffer[cur_nf]); // Compress buffer is freed
1019 compress_buffer_length[cur_nf]=0; // it length is set to zero
1020 }
1021}
int Compress_Buffer(unsigned char *input, int inputSize, unsigned char *output, int outputSize)
int outfile_mod[100]
int cur_nf
FILE * curfile
int compress_buffer_length[100]
unsigned char * compress_write_buffer[100]

◆ CLOSE_C()

void _FCALL CLOSE_C ( )

Definition at line 312 of file write_routtines.c.

313{ close_c(); }
void close_c()

◆ close_c()

void close_c ( )

Close the file

Definition at line 298 of file write_routtines.c.

301{
302 if (outfile_mod[cur_nf] == 1){ // Close write with compression
303 close_buffer(); // flush the remaining values in buffer
304 fclose(curfile);
305 }else if (outfile_mod[cur_nf] == 2){ // Close read with compression
306 gzclose((gzFile)curfile);
307 }else{
308 fclose(curfile); // Close with No compression
309 outfile[cur_nf]=NULL;
310 }
311}
void close_buffer()
FILE * outfile[100]

◆ close_c_()

void close_c_ ( )

Definition at line 315 of file write_routtines.c.

316{ close_c(); }

◆ close_c__()

void close_c__ ( )

Definition at line 318 of file write_routtines.c.

319{ close_c();}

◆ Compress_Buffer()

int Compress_Buffer ( unsigned char * input,
int inputSize,
unsigned char * output,
int outputSize )

Compress Buffer : Takes a character array, return it as gzipped array

input : input character array inputSize : length of this array output : gzipped array

outputSize: size of output array

Definition at line 921 of file write_routtines.c.

921 {
929 z_stream zs;
930 zs.zalloc = Z_NULL;
931 zs.zfree = Z_NULL;
932 zs.opaque = Z_NULL;
933 zs.avail_in = (uInt)inputSize;
934 zs.next_in = (Bytef *)input;
935 zs.avail_out = (uInt)outputSize;
936 zs.next_out = (Bytef *)output;
937
938 //printf("input: %i\n",inputSize);
939 // hard to believe they don't have a macro for gzip encoding, "Add 16" is the best thing zlib can do:
940 // "Add 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper"
941 deflateInit2(&zs, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 15 | 16, 8, Z_DEFAULT_STRATEGY);
942 deflate(&zs, Z_FINISH);
943 deflateEnd(&zs);
944 return zs.total_out;
945// *out_len = compress2(out_buffer,&lout_len,in_buffer,lin_len,level);
946}

◆ CUR_FIL_C()

void _FCALL CUR_FIL_C ( int * nf)

Definition at line 487 of file write_routtines.c.

488{ cur_fil_c(nf);}
void cur_fil_c(int *nf)

◆ cur_fil_c()

void cur_fil_c ( int * nf)

Set the current file stored in outfile array

input : Integer, file ID

Definition at line 477 of file write_routtines.c.

482{
483 cur_nf = *nf;
484 curfile = outfile[*nf];
485}

◆ cur_fil_c_()

void cur_fil_c_ ( int * nf)

Definition at line 490 of file write_routtines.c.

491{ cur_fil_c(nf);}

◆ cur_fil_c__()

void cur_fil_c__ ( int * nf)

Definition at line 493 of file write_routtines.c.

494{ cur_fil_c(nf); }

◆ DELETE_TMPFILE()

void _FCALL DELETE_TMPFILE ( char * name,
int * size )

Definition at line 1046 of file write_routtines.c.

1047{delete_tmpfile_ (name,size);}
void delete_tmpfile_(char *name, int *size)

◆ delete_tmpfile()

void delete_tmpfile ( char * name,
int * size )

Definition at line 1052 of file write_routtines.c.

1053{delete_tmpfile_ (name,size);}

◆ delete_tmpfile_()

void delete_tmpfile_ ( char * name,
int * size )

Delete a temp file from Radioss Routine can be used from Fortran, it copies name in an another string

and add '\0' to it.

char * name : string containing filename to delete

int * size : size of string

Definition at line 1024 of file write_routtines.c.

1034{
1035 char *cname;
1036 int cname_len;
1037 int i;
1038 cname_len = *size + 1;
1039 cname=(char*) malloc(sizeof(char)*cname_len);
1040 for(i=0;i<*size;i++) cname[i] = name[i];
1041 cname[*size]='\0';
1042 fclose(curfile);
1043 remove(cname);
1044 free(cname);
1045}

◆ delete_tmpfile__()

void delete_tmpfile__ ( char * name,
int * size )

Definition at line 1049 of file write_routtines.c.

1050{delete_tmpfile_ (name,size);}

◆ double_to_IEEE_ASCII()

void double_to_IEEE_ASCII ( double * reel,
unsigned char octet[1000][8],
int len )

Definition at line 168 of file ieee.cpp.

169{
170 int exposant,i;
171 unsigned int mantisse1, mantisse2;
172 double dmantisse;
173 for(i=0;i<len;i++)
174 {
175 if (reel[i] < 0. )
176 {
177 if (reel[i] > -4.e-308 ){ /* valeur exacte -2.22e-308 */
178 /* -0. */
179 octet[i][0] = 0x80;
180 octet[i][1] = 0x00;
181 octet[i][2] = 0x00;
182 octet[i][3] = 0x00;
183 octet[i][4] = 0x00;
184 octet[i][5] = 0x00;
185 octet[i][6] = 0x00;
186 octet[i][7] = 0x00;
187 continue;
188 } else if( reel[i] < -1.e+308){ /* valeur exacte -1.79e+308 */
189 /* -Infinity */
190 octet[i][0] = 0xff;
191 octet[i][1] = 0xf0;
192 octet[i][2] = 0x00;
193 octet[i][3] = 0x00;
194 octet[i][4] = 0x00;
195 octet[i][5] = 0x00;
196 octet[i][6] = 0x00;
197 octet[i][7] = 0x00;
198 continue;
199 } else {
200 dmantisse = (frexp(-reel[i],&exposant) - 0.5)*9.0071992547409920E15;
201/* *ldexp(1.,53) ; */
202 exposant += 1022;
203 octet[i][0] = ((exposant & 0x7ff) >> 4) | 128;
204 }
205 }
206 else
207 {
208 if (reel[i] < 4.e-308 ){ /* valeur exacte 2.22e-308 */
209 /* +0. */
210 octet[i][0] = 0x00;
211 octet[i][1] = 0x00;
212 octet[i][2] = 0x00;
213 octet[i][3] = 0x00;
214 octet[i][4] = 0x00;
215 octet[i][5] = 0x00;
216 octet[i][6] = 0x00;
217 octet[i][7] = 0x00;
218 continue;
219 } else if( reel[i] > 1.e+308){ /* valeur exacte 1.79e+308 */
220 /* +Infinity */
221 octet[i][0] = 0x7f;
222 octet[i][1] = 0xf0;
223 octet[i][2] = 0x00;
224 octet[i][3] = 0x00;
225 octet[i][4] = 0x00;
226 octet[i][5] = 0x00;
227 octet[i][6] = 0x00;
228 octet[i][7] = 0x00;
229 continue;
230
231 } else {
232 dmantisse = (frexp(reel[i],&exposant) - 0.5)*9.0071992547409920E15;
233/* *ldexp(1.,53); */
234 exposant += 1022;
235 octet[i][0] = (exposant & 0x7ff) >> 4;
236 }
237 }
238/*
239 mantisse1 = (unsigned int) (dmantisse / ldexp(1.,32));
240 mantisse2 = (unsigned int) (dmantisse - (double)mantisse1 * ldexp(1.,32));
241*/
242 mantisse1 = (unsigned int) (dmantisse / 4.294967296E9);
243 mantisse2 = (unsigned int) (dmantisse - (double)mantisse1 * 4.294967296E9);
244 octet[i][1] = ((exposant & 0x0f) << 4) | ((mantisse1 >> 16) & 0x0f);
245 octet[i][2] = (mantisse1 >> 8) & 0xff ;
246 octet[i][3] = mantisse1 & 0xff ;
247 octet[i][4] = (mantisse2 >> 24) & 0xff ;
248 octet[i][5] = (mantisse2 >> 16) & 0xff ;
249 octet[i][6] = (mantisse2 >> 8) & 0xff ;
250 octet[i][7] = mantisse2 & 0xff ;
251 } /* fin for */
252}

◆ EOR_C()

void _FCALL EOR_C ( int * len)

Definition at line 510 of file write_routtines.c.

511{ eor_c(len);}
void eor_c(int *len)

◆ eor_c()

void eor_c ( int * len)

Writes the current size in file : Radioss IEEE Format, in TH / NOISE

input : Integer, size

Definition at line 498 of file write_routtines.c.

503{
504 int i;
505 unsigned char octet[4];
506
507 integer_to_IEEE_ASCII(*len,octet);
508 write_buffer(octet,sizeof(unsigned char),4);
509}
void integer_to_IEEE_ASCII(int entier, unsigned char octet[4])
Definition ieee.cpp:39
void write_buffer(unsigned char *buf, int type_size, int length)

◆ eor_c_()

void eor_c_ ( int * len)

Definition at line 513 of file write_routtines.c.

514{ eor_c(len);}

◆ FILE_INIT()

void _FCALL FILE_INIT ( )

Definition at line 169 of file write_routtines.c.

170{
171 int i;
172 for (i=0;i<100;i++){
173 outfile[i]=NULL;
174 outfile_mod[i]=0;
175 }
176}

◆ file_init()

void file_init ( )

Definition at line 161 of file write_routtines.c.

161 {
162 int i;
163 for (i=0;i<100;i++){
164 outfile[i]=NULL;
165 outfile_mod[i]=0;
166 }
167}

◆ file_init_()

void file_init_ ( )

Initialize the file pointers to NULL

Initialize file mode to Zero

Definition at line 148 of file write_routtines.c.

148 {
153//
154 int i;
155 for (i=0;i<100;i++){
156 outfile[i]=NULL;
157 outfile_mod[i]=0;
158 }
159}

◆ FILE_SIZE()

void _FCALL FILE_SIZE ( int * filesize)

Definition at line 379 of file write_routtines.c.

379 {
380 file_size_(filesize);
381}
void file_size_(int *filesize)

◆ file_size()

void file_size ( int * filesize)

Definition at line 371 of file write_routtines.c.

371 {
372 file_size_(filesize);
373}

◆ file_size_()

void file_size_ ( int * filesize)

Determine file size with ftell

output : size in kb.

Definition at line 360 of file write_routtines.c.

365{
366 long sz;
367 sz=ftell(curfile);
368 *filesize=sz/1024;
369}

◆ file_size__()

void file_size__ ( int * filesize)

Definition at line 375 of file write_routtines.c.

375 {
376 file_size_(filesize);
377}

◆ FILE_SIZE_C()

void _FCALL FILE_SIZE_C ( long * size)

Definition at line 393 of file write_routtines.c.

394{
395 *size= ftell(curfile) / 1024;
396}

◆ file_size_c_()

void file_size_c_ ( long * size)

Determine file size with ftell

output : size in kb as long.

Definition at line 384 of file write_routtines.c.

389{
390 *size= ftell(curfile)/1024;
391}

◆ FILELEN_SYS()

void _FCALL FILELEN_SYS ( char * ffilnam,
int * len,
int * size )

Definition at line 472 of file write_routtines.c.

472 {
473 filelen_sys_(ffilnam,len, size);
474}
void filelen_sys_(char *ffilnam, int *len, int *size)

◆ filelen_sys()

void filelen_sys ( char * ffilnam,
int * len,
int * size )

Definition at line 464 of file write_routtines.c.

464 {
465 filelen_sys_(ffilnam,len, size);
466}

◆ filelen_sys_()

void filelen_sys_ ( char * ffilnam,
int * len,
int * size )

Determine file using system call / _stat in Windows

char * ffilnam : filename can come from Fortran int *len : length of filename

int size : output : size in kb as long.

Definition at line 435 of file write_routtines.c.

442{
443 char * filnam;
444 char command[256],line[256];
445 char var1[128],var2[128],var3[128],var4[128],ssize[128];
446 int i,ret;
447 struct stat statbuf;
448 FILE * scall;
449 filnam = malloc(*len+10);
450 for (i=0;i<*len;i++) { filnam[i]=ffilnam[i]; }
451 filnam[*len]='\0';
452
453 ret = stat (filnam,&statbuf);
454 if (ret != -1){
455 *size = statbuf.st_size / 1024;
456 }else{
457 *size = 0;
458 }
459 free(filnam);
460
461}
integer(8), private ssize

◆ filelen_sys__()

void filelen_sys__ ( char * ffilnam,
int * len,
int * size )

Definition at line 468 of file write_routtines.c.

468 {
469 filelen_sys_(ffilnam,len, size);
470}

◆ FLU_FIL_C()

void _FCALL FLU_FIL_C ( )

Definition at line 908 of file write_routtines.c.

908 {
909 flu_fil_c();
910}
void flu_fil_c()

◆ flu_fil_c()

void flu_fil_c ( )

flush the current file to disc

Care has no meaning when file is to gzip

Definition at line 901 of file write_routtines.c.

901 {
905 fflush(curfile);
906}

◆ flu_fil_c_()

void flu_fil_c_ ( )

Definition at line 912 of file write_routtines.c.

912 {
913 flu_fil_c();
914}

◆ flu_fil_c__()

void flu_fil_c__ ( )

Definition at line 917 of file write_routtines.c.

918{flu_fil_c();}

◆ FSEEK_C_RD()

void _FCALL FSEEK_C_RD ( int * lseek)

Definition at line 339 of file write_routtines.c.

339 {
340 fseek_c_rd(lseek);
341}
void fseek_c_rd(int *lseek)

◆ fseek_c_rd()

void fseek_c_rd ( int * lseek)

Determine file size

output : lseek - current file_size

Definition at line 323 of file write_routtines.c.

323 {
328 fseek(curfile,*lseek,SEEK_CUR);
329}

◆ fseek_c_rd_()

void fseek_c_rd_ ( int * lseek)

Definition at line 331 of file write_routtines.c.

331 {
332 fseek_c_rd(lseek);
333}

◆ fseek_c_rd__()

void fseek_c_rd__ ( int * lseek)

Definition at line 335 of file write_routtines.c.

335 {
336 fseek_c_rd(lseek);
337}

◆ FSEEK_END_C()

void _FCALL FSEEK_END_C ( int * lseek)

Definition at line 355 of file write_routtines.c.

355 {
356 fseek_end_c(lseek);
357}
void fseek_end_c(int *lseek)

◆ fseek_end_c()

void fseek_end_c ( int * lseek)

Determine file size

output : lseek - at end of file

Definition at line 343 of file write_routtines.c.

343 {
348 fseek(curfile,*lseek,SEEK_END);
349}

◆ fseek_end_c_()

void fseek_end_c_ ( int * lseek)

Definition at line 351 of file write_routtines.c.

351 {
352 fseek_end_c(lseek);
353}

◆ IEEE_ASCII_to_double()

void IEEE_ASCII_to_double ( double * reel,
unsigned char octet[1000][8],
int len )

Definition at line 256 of file ieee.cpp.

257{
258 int exposant,i;
259 int signe;
260 double mantisse, decalage;
261 for(i=0;i<len;i++)
262 {
263 /* signe */
264 signe = octet[i][0] & 0x80;
265 if (signe==0)
266 {
267 signe = 1;
268 }
269 else
270 {
271 signe = -1;
272 }
273 /* exposant */
274 exposant = (octet[i][0] & 0x7f) << 4;
275 exposant += (octet[i][1] & 0xf0) >> 4;
276
277 if (exposant==0) /* +0. ou -0. */
278 {
279 reel[i] = 0.;
280 continue;
281 }
282
283 exposant -= 1022;
284
285 /* mantisse */
286 /* decalage = ldexp(1.,8); */
287 decalage = 256.;
288 mantisse = (octet[i][1] & 0x0f);
289 mantisse = mantisse * decalage + octet[i][2];
290 mantisse = mantisse * decalage + octet[i][3];
291 mantisse = mantisse * decalage + octet[i][4];
292 mantisse = mantisse * decalage + octet[i][5];
293 mantisse = mantisse * decalage + octet[i][6];
294 mantisse = mantisse * decalage + octet[i][7];
295 /* mantisse /= ldexp(1.,53); */
296 mantisse /= 9.0071992547409920E15;
297 mantisse += 0.5;
298
299 /* nombre */
300 reel[i] = signe * mantisse * ldexp(1.,exposant);
301 } /* fin for */
302
303} /* fin IEEE_ASCII_to_double */

◆ IEEE_ASCII_to_integer()

void IEEE_ASCII_to_integer ( int * entier,
unsigned char octet[4] )

Definition at line 47 of file ieee.cpp.

48{
49 int result, a, b;
50 result = octet[0];
51 result = (result << 8) + octet[1];
52 result = (result << 8) + octet[2];
53 result = (result << 8) + octet[3];
54/* traitement special 64 bits */
55 if((result & 0x80000000) == 0x80000000)
56 {
57 a = (-1);
58 b = 0xFFFFFFFF;
59 result = result + a - b;
60 }
61 *entier = result;
62
63} /* fin IEEE_ASCII_to_integer */

◆ IEEE_ASCII_to_real()

void IEEE_ASCII_to_real ( float * reel,
unsigned char octet[4] )

Definition at line 126 of file ieee.cpp.

127{
128 int exposant;
129 int signe;
130 double mantisse, decalage;
131
132 /* signe */
133 signe = octet[0] & 0x80;
134 if (signe==0)
135 {
136 signe = 1;
137 }
138 else
139 {
140 signe = -1;
141 } /* exposant */
142 exposant = (octet[0] & 0x7f) << 1;
143 exposant += (octet[1] & 0x80) >> 7;
144
145 if (exposant==0) /* +0. ou -0. */
146 {
147 *reel = 0.;
148 return;
149 }
150
151 exposant -= 126;
152
153 /* mantisse */
154 decalage = ldexp(1.,8);
155 mantisse = (octet[1] & 0x7f);
156 mantisse = mantisse * decalage + octet[2];
157 mantisse = mantisse * decalage + octet[3];
158 mantisse /= ldexp(1.,24);
159 mantisse += 0.5;
160
161 /* nombre */
162 *reel = (float) signe * mantisse * ldexp(1.,exposant);
163
164} /* fin IEEE_ASCII_to_real */

◆ integer_to_IEEE_ASCII()

void integer_to_IEEE_ASCII ( int entier,
unsigned char octet[4] )

Definition at line 39 of file ieee.cpp.

40{
41 octet[3] = entier & 0xff;
42 octet[2] = (entier >> 8) & 0xff;
43 octet[1] = (entier >> 16) & 0xff;
44 octet[0] = (entier >> 24) & 0xff;
45}

◆ OPEN_C()

void _FCALL OPEN_C ( int * ifil,
int * len,
int * mod )

Definition at line 288 of file write_routtines.c.

289{ open_c(ifil,len,mod);}
void open_c(int *ifil, int *len, int *mod)

◆ open_c()

void open_c ( int * ifil,
int * len,
int * mod )

Opens a file according to mod. ifil : filename stored as integer Ascii values len : size of ifil mod= Read : 1 (unzipped), 4, 7 (zipped) Write : 0 (unzipped), 3, 6 (gzipped)

Read/Write : 2 (unzipped)

Definition at line 180 of file write_routtines.c.

190{
191 char *filnam;
192 int i;
193 gzFile gzstream;
194
195 #ifdef _WIN64
196 /* Windows in Binary format */
197 _set_fmode(_O_BINARY);
198 #endif
199
200 // Create char* filnam
201 filnam = (char*) malloc(sizeof(char)*(*len+10) );
202
203
204 //printf("Mod:%i\n",*mod);
205
206 for(i=0;i<*len;i++) filnam[i]=(char)ifil[i];
207 filnam[*len]='\0';
208
209 // Global buffers initialization
210 outfile_mod[cur_nf]=0; // Saves compress mode (0 : non, 1 gzip, 2 gunzip)
211 compress_write_buffer[cur_nf]=NULL; // Intermediate buffer to store the data to compress
212 compress_buffer_length[cur_nf]=0; // Size of data to compress
213
214 if (*mod == 1 || *mod == 4 || *mod == 7){ // Open Read : 4 & 7 are gzipped
215
216 if (*mod !=1){ // unzip
217 #ifdef _WIN64
218 strcat_s(filnam,*len+10,".gz");
219 #else
220 strcat(filnam,".gz");
221 #endif
223 gzstream = gzopen(filnam,"r");
224 if (gzstream == NULL){
225 printf(" ** ERROR: FILE %s NOT FOUND\n",filnam);
226 /*force flush buffer to avoid missing error message on windows in some cases*/
227 fflush(stdout);
228 arret_c(2);
229 }
230 gzbuffer(gzstream, COMP_BUFFER_SIZE);
231 curfile=(FILE *)gzstream;
232
233 }else{ // Not zipped file
234
235 #ifdef _WIN64
236 curfile=fopen(filnam,"r");
237 #else
238 curfile=fopen(filnam,"r");
239 #endif
240
241 if (!curfile){
242 printf(" ** ERROR: FILE %s NOT FOUND\n",filnam);
243 /*force flush buffer to avoid missing error message on windows in some cases*/
244 fflush(stdout);
245 arret_c(2);
246 }
247 }
248 }
249 if (*mod==0 || *mod == 3 ||*mod==6 ){ // Open Write : 0 unzipped 3 & 6 are gzipped
250 if(*mod!=0){ // zip
251 #ifdef _WIN64
252 strcat_s(filnam,*len+10,".gz");
253 #else
254 strcat(filnam,".gz");
255 #endif
257 compress_write_buffer[cur_nf]=(unsigned char *)malloc(COMP_BUFFER_SIZE+2048); // Create a buffer of COMP_BUFFER_SIZE + 2k (gzip header) for compression
258 // Several buffers can be opened at same time.
259 }
260 #ifdef _WIN64
261 curfile=fopen(filnam,"w");
262 #else
263 curfile=fopen(filnam,"w");
264 #endif
265 }
266
267 if (*mod==2) { // Open Read/Write : uncompressed
268 #ifdef _WIN64
269 curfile=fopen(filnam,"r+");
270 #else
271 curfile=fopen(filnam,"r+");
272 #endif
273 }
274
275 if (*mod==8) { // Open Append mode - unzipped
276 #ifdef _WIN64
277 curfile=fopen(filnam,"a");
278 #else
279 curfile=fopen(filnam,"a");
280 #endif
281 }
282
284 free(filnam);
285}
#define COMP_BUFFER_SIZE
void arret_c(int n)

◆ open_c_()

void open_c_ ( int * ifil,
int * len,
int * mod )

Definition at line 291 of file write_routtines.c.

292{ open_c(ifil,len,mod); }

◆ open_c__()

void open_c__ ( int * ifil,
int * len,
int * mod )

Definition at line 294 of file write_routtines.c.

295{ open_c(ifil,len,mod); }

◆ READ_C_C()

void _FCALL READ_C_C ( int * w,
int * len )

Definition at line 889 of file write_routtines.c.

890{ read_c_c(w,len); }
void read_c_c(int *w, int *len)

◆ read_c_c()

void read_c_c ( int * w,
int * len )

Read an character array coded in ASCII/INT format

w, input : integer array to read

len, input : Integer, size

Definition at line 857 of file write_routtines.c.

863{
864 int j,nitems;
865 unsigned char * gzbuf;
866 gzFile gzstream;
867
868 if(outfile_mod[cur_nf]==0){ // Read unzipped
869
870 for(j=0;j<*len;j++){
871 if((w[j] = (int) getc(curfile)) == EOF){
872 printf(" ** ERROR: END OF FILE DURING READING\n");
873 arret_c(2);
874 }
875 }
876 }else{
877 gzstream=(gzFile)curfile;
878 gzbuf=(unsigned char *)malloc(sizeof(unsigned char)* *len);
879 nitems=gzfread(gzbuf,1,*len,gzstream);
880 if(nitems < *len){
881 printf(" ** ERROR: END OF FILE DURING READING\n");
882 arret_c(2);
883 }
884 for (j=0;j<*len;j++) w[j]=(int)gzbuf[j];
885 free(gzbuf);
886 }
887}

◆ read_c_c_()

void read_c_c_ ( int * w,
int * len )

Definition at line 893 of file write_routtines.c.

894{ read_c_c(w,len);}

◆ read_c_c__()

void read_c_c__ ( int * w,
int * len )

Definition at line 897 of file write_routtines.c.

898{ read_c_c(w,len);}

◆ READ_DB_ARRAY_C()

void _FCALL READ_DB_ARRAY_C ( double * w,
int * len )

Definition at line 749 of file write_routtines.c.

750{ read_db_c(w,len); }
void read_db_c(double *w, int *len)

◆ read_db_array_c()

void read_db_array_c ( double * w,
int * len )

◆ read_db_array_c_()

void read_db_array_c_ ( double * w,
int * len )

Definition at line 752 of file write_routtines.c.

753{ read_db_c(w,len); }

◆ READ_DB_C()

void _FCALL READ_DB_C ( double * w,
int * len )

Definition at line 742 of file write_routtines.c.

743{ read_db_c(w,len); }

◆ read_db_c()

void read_db_c ( double * w,
int * len )

Read a double precision array in Radioss IEEE format

w, input : double array to read

len, input : Integer, size

Definition at line 711 of file write_routtines.c.

711 {
717 int i, j, c,nitems;
718 unsigned char octet[1000][8];
719 gzFile gzstream;
720
721 if (*len > 1000){ // Read is done in blocks of 1000 floats
722 printf(" ** ERROR: BAD SIZE FOR READING\n");
723 arret_c(2);
724 }
725
726 if(outfile_mod[cur_nf]==0){ // Read unzipped
727 if(fread(octet,sizeof(char),(*len)*8,curfile)!=(*len)*8){
728 printf(" ** ERROR: END OF FILE DURING READING\n");
729 arret_c(2);
730 }
731 }else{ // Read Zipped
732 gzstream=(gzFile)curfile;
733 nitems=gzfread(octet,sizeof(unsigned char)*8,*len,gzstream);
734 if (nitems <*len ){
735 printf(" ** ERROR: END OF FILE DURING READING\n");
736 arret_c(2);
737 }
738 }
739 IEEE_ASCII_to_double(w,octet,*len);
740}
void IEEE_ASCII_to_double(double *reel, unsigned char octet[1000][8], int len)
Definition ieee.cpp:256

◆ read_db_c_()

void read_db_c_ ( double * w,
int * len )

Definition at line 745 of file write_routtines.c.

746{ read_db_c(w,len); }

◆ READ_I_ARRAY_C()

void _FCALL READ_I_ARRAY_C ( int * w,
int * len )

Definition at line 849 of file write_routtines.c.

850{ read_i_c(w,len);} /* READ_I_C */
void read_i_c(int *w, int *len)

◆ read_i_array_c()

void read_i_array_c ( int * w,
int * len )

◆ read_i_array_c_()

void read_i_array_c_ ( int * w,
int * len )

Definition at line 852 of file write_routtines.c.

853{ read_i_c(w,len);}

◆ READ_I_C()

void _FCALL READ_I_C ( int * w,
int * len )

Definition at line 842 of file write_routtines.c.

843{ read_i_c(w,len);} /* READ_I_C */

◆ read_i_c()

void read_i_c ( int * w,
int * len )

Read an integer array in Radioss IEEE format

w, input : integer array to read

len, input : Integer, size

Definition at line 805 of file write_routtines.c.

811{
812 int i, j, k, block,nitems;
813 unsigned char buf[4*BUFLEN];
814 unsigned char * gzbuf;
815 gzFile gzstream;
816
817 if(outfile_mod[cur_nf]==0){ // Read unzipped
818 for(k=0;k<*len;k+=BUFLEN){
819 block = ((*len-k) < BUFLEN)?(*len-k):BUFLEN; // Read is done in blocks of 256 items
820 if (fread(buf,sizeof(unsigned char),block*4,curfile)!=block*4){
821 printf(" ** ERROR: END OF FILE DURING READING\n");
822 arret_c(2);
823 }
824 for(i=0;i<block;i++){
825 IEEE_ASCII_to_integer(&w[i+k],&buf[4*i]);
826 }
827 }
828 }else{
829 gzstream=(gzFile)curfile;
830 gzbuf=(unsigned char *)malloc(sizeof(unsigned char)* *len*4); // Read is done in one chunk
831 nitems=gzfread(gzbuf,sizeof(int),*len,gzstream);
832 if (nitems != *len){
833 printf(" ** ERROR: END OF FILE DURING READING\n");
834 }
835 for(i=0;i<*len;i++){
836 IEEE_ASCII_to_integer(&w[i],&gzbuf[4*i]);
837 }
838 free(gzbuf);
839 }
840}
void IEEE_ASCII_to_integer(int *entier, unsigned char octet[4])
Definition ieee.cpp:47
#define BUFLEN

◆ read_i_c_()

void read_i_c_ ( int * w,
int * len )

Definition at line 845 of file write_routtines.c.

846{ read_i_c(w,len);}

◆ READ_R_C()

void _FCALL READ_R_C ( float * w,
int * len )

Definition at line 798 of file write_routtines.c.

799{ read_r_c(w,len);} /* fin READ_R_C */
void read_r_c(float *w, int *len)

◆ read_r_c()

void read_r_c ( float * w,
int * len )

Read a real array in Radioss IEEE format

w, input : real array to read

len, input : Integer, size

Definition at line 756 of file write_routtines.c.

762{
763 int i, j, k, block, n,nitems;
764 unsigned char buf[4*BUFLEN];
765 unsigned char * gzbuf;
766 gzFile gzstream;
767
768 if(outfile_mod[cur_nf]==0){ // Read unzipped
769 for(k=0;k<*len;k+=BUFLEN){ // Read is done according to blocks of BUFLEN (256 characters)
770 block = ((*len-k) < BUFLEN)?(*len-k):BUFLEN;
771 n = fread(buf,sizeof(unsigned char),block*4,curfile);
772 if (n!=block*4){
773 printf(" ** ERROR: END OF FILE DURING READING\n");
774 for(i=0;i<n/4;i++){
775 IEEE_ASCII_to_real(&w[i+k],&buf[4*i]);
776 }
777 w[k+n/4]=-1.;
778 }
779 for(i=0;i<block;i++){
780 IEEE_ASCII_to_real(&w[i+k],&buf[4*i]);
781 }
782 }
783 }else{ // Read Zipped
784 gzstream=(gzFile)curfile;
785 gzbuf=(unsigned char *)malloc(sizeof(unsigned char)* *len*4); // Read & decompress is done in one chunk
786 nitems=gzfread(buf,sizeof(unsigned char),*len*4,gzstream);
787 if (nitems != *len*4){
788 printf(" ** ERROR: END OF FILE DURING READING\n");
789 }
790 for(i=0;i<*len;i++){
791 IEEE_ASCII_to_real(&w[i],&gzbuf[4*i]);
792 }
793 free(gzbuf);
794 }
795} /* fin read_r_c */
void IEEE_ASCII_to_real(float *reel, unsigned char octet[4])
Definition ieee.cpp:126

◆ read_r_c_()

void read_r_c_ ( float * w,
int * len )

Definition at line 801 of file write_routtines.c.

802{ read_r_c(w,len); } /* fin read_r_c_ */

◆ real_to_IEEE_ASCII()

void real_to_IEEE_ASCII ( float reel,
unsigned char octet[4] )

Definition at line 65 of file ieee.cpp.

66{
67 int exposant,mantisse;
68 if (reel < 0. ){
69 if (reel > -1.17e-38 ){
70 /* -0. */
71 octet[0] = 0x80;
72 octet[1] = 0x00;
73 octet[2] = 0x00;
74 octet[3] = 0x00;
75 return;
76
77 } else if( reel < -3.4e+38){
78
79 /* -Infinity */
80 octet[0] = 0xff;
81 octet[1] = 0x80;
82 octet[2] = 0x00;
83 octet[3] = 0x00;
84 return;
85
86 } else {
87 mantisse = (frexp(-(double)reel,&exposant) - 0.5)*1.6777216E7;
88/* *ldexp(1.,24); */
89 exposant += 126;
90 octet[0] = (exposant & 0xfe) >> 1 | 128;
91 }
92 } else {
93 if (reel < 1.17e-38 ){
94
95 /* +0. */
96 octet[0] = 0x00;
97 octet[1] = 0x00;
98 octet[2] = 0x00;
99 octet[3] = 0x00;
100 return;
101
102 } else if( reel > 3.4e+38){
103
104 /* +Infinity */
105 octet[0] = 0x7f;
106 octet[1] = 0x80;
107 octet[2] = 0x00;
108 octet[3] = 0x00;
109 return;
110
111 } else {
112 mantisse = (frexp((double)reel,&exposant) - 0.5)*1.6777216E7;
113/* *ldexp(1.,24); */
114 exposant += 126;
115 octet[0] = (exposant & 0xfe) >> 1;
116 }
117 }
118
119 octet[1] = (exposant & 0x01) << 7 | (mantisse >> 16) & 0x7f ;
120 octet[2] = (mantisse >> 8) & 0xff ;
121 octet[3] = mantisse & 0xff ;
122
123}

◆ write_buffer()

void write_buffer ( unsigned char * buf,
int type_size,
int length )

write Buffer : writes a buffer either direct or gzipped. When Gzip : stores it in a buffer of COMP_BUFFER_SIZE

When Buffer Full : gzip it & write

buf : unsigned char, array to write. type_size : the buf array is an array of a type : gives the size of type

length : number of item of type type_size un buf to write

Definition at line 950 of file write_routtines.c.

950 {
959 int to_do;
960 int i,len,inputSize,compressed_buf_size,compressed_len,mod;
961 unsigned char *compressed_buf;
962 len=type_size*length;
963 i=0;
964 to_do=1;
965
966 mod=outfile_mod[cur_nf];
967 if( mod == 0){ // Write in non zipped format
968 fwrite(buf,sizeof(unsigned char),len,curfile);
969 }else{ // Write in gzip format
970
971 while( to_do==1 ){ // while buf has not been treated
972
973 // Copy arrays in a Buffer of COM_BUFFER_SIZE
976 i++;
978 }
979
981 // COM_BUFFER_SIZE Buffer is full. Compress & write on disk
982 compressed_buf=(unsigned char *)malloc(sizeof(unsigned char)*(COMP_BUFFER_SIZE+2048));
984 compressed_buf_size=COMP_BUFFER_SIZE+2048;
985 compressed_len = Compress_Buffer(compress_write_buffer[cur_nf], inputSize , compressed_buf, compressed_buf_size);
986 fwrite(compressed_buf,sizeof(unsigned char),compressed_len,curfile);
987
988 free(compressed_buf);
990 }
991
992 if (i==len) to_do=0;
993 }
994 }
995}

◆ WRITE_C_C()

void _FCALL WRITE_C_C ( int * w,
int * len )

Definition at line 602 of file write_routtines.c.

603{ write_c_c(w,len);}
void write_c_c(int *w, int *len)

◆ write_c_c()

void write_c_c ( int * w,
int * len )

Write a character array in ASCII in file

w, input : integer array to write

len, input : Integer, size

Definition at line 591 of file write_routtines.c.

597{
598 int i;
599 for(i=0;i<*len;i++) write_buffer((unsigned char *)&w[i],sizeof(char),1);
600}

◆ write_c_c_()

void write_c_c_ ( int * w,
int * len )

Definition at line 604 of file write_routtines.c.

605{write_c_c(w,len);}

◆ write_c_c__()

void write_c_c__ ( int * w,
int * len )

Definition at line 607 of file write_routtines.c.

608{write_c_c(w,len);}

◆ WRITE_C_C_TXT()

void _FCALL WRITE_C_C_TXT ( char * w,
int * len )

Definition at line 633 of file write_routtines.c.

634{ write_c_c_txt(w,len);}
void write_c_c_txt(char *w, int *len)

◆ write_c_c_txt()

void write_c_c_txt ( char * w,
int * len )

Write a string in file

w, input : integer array to write

len, input : Integer, size

Definition at line 612 of file write_routtines.c.

618{
619 char *buf;
620 int i,mod;
621 buf=(char*)malloc(sizeof(char)*(*len+2));
622
623 // Buffer may come from Fortran : Need to recopy it & add \n + \0 in
624 for(i=0;i<*len;i++)buf[i]=w[i];
625 buf[*len]='\n';
626 buf[*len+1]='\0';
627
628 mod = outfile_mod[cur_nf];
629
630 write_buffer((unsigned char*)buf,sizeof(unsigned char),*len+1);
631 free (buf);
632}

◆ write_c_c_txt_()

void write_c_c_txt_ ( char * w,
int * len )

Definition at line 636 of file write_routtines.c.

637{ write_c_c_txt(w,len);}

◆ write_c_c_txt__()

void write_c_c_txt__ ( char * w,
int * len )

Definition at line 640 of file write_routtines.c.

641{ write_c_c_txt(w,len);}

◆ WRITE_DB_ARRAY_C()

void _FCALL WRITE_DB_ARRAY_C ( double * w,
int * len )

Definition at line 581 of file write_routtines.c.

582{write_db_c(w,len);}
void write_db_c(double *w, int *len)

◆ write_db_array_c()

void write_db_array_c ( double * w,
int * len )

◆ write_db_array_c_()

void write_db_array_c_ ( double * w,
int * len )

Definition at line 584 of file write_routtines.c.

585{ write_db_c(w,len);}

◆ write_db_array_c__()

void write_db_array_c__ ( double * w,
int * len )

Definition at line 587 of file write_routtines.c.

588{write_db_c(w,len);}

◆ WRITE_DB_C()

void _FCALL WRITE_DB_C ( double * w,
int * len )

Definition at line 572 of file write_routtines.c.

573{write_db_c(w,len);}

◆ write_db_c()

void write_db_c ( double * w,
int * len )

Write a double array in file : Radioss IEEE Format.

w, input : double array to write

len, input : Integer, size

Definition at line 553 of file write_routtines.c.

559{
560 int i,j;
561 unsigned char octet[1000][8];
562
563 if (*len > 1000){
564 printf(" ** ERROR: BAD SIZE FOR WRITING\n");
565 arret_c(2);
566 }
567 double_to_IEEE_ASCII(w,octet,*len);
568 //fwrite(octet,sizeof(char),(*len)*8,curfile);
569 write_buffer((unsigned char*)octet,sizeof(char),(*len)*8);
570}
void double_to_IEEE_ASCII(double *reel, unsigned char octet[1000][8], int len)
Definition ieee.cpp:168

◆ write_db_c_()

void write_db_c_ ( double * w,
int * len )

Definition at line 575 of file write_routtines.c.

576{ write_db_c(w,len);}

◆ write_db_c__()

void write_db_c__ ( double * w,
int * len )

Definition at line 578 of file write_routtines.c.

579{write_db_c(w,len);}

◆ WRITE_I_ARRAY_C()

void _FCALL WRITE_I_ARRAY_C ( int * w,
int * len )

Definition at line 675 of file write_routtines.c.

676{write_i_c(w,len);}
void write_i_c(int *w, int *len)

◆ write_i_array_c()

void write_i_array_c ( int * w,
int * len )

◆ write_i_array_c_()

void write_i_array_c_ ( int * w,
int * len )

Definition at line 678 of file write_routtines.c.

679{ write_i_c(w,len); }

◆ write_i_array_c__()

void write_i_array_c__ ( int * w,
int * len )

Definition at line 682 of file write_routtines.c.

683{write_i_c(w,len);}

◆ WRITE_I_C()

void _FCALL WRITE_I_C ( int * w,
int * len )

Definition at line 664 of file write_routtines.c.

665{write_i_c(w,len);}

◆ write_i_c()

void write_i_c ( int * w,
int * len )

Write a integer array of size len in Radioss IEEE format

w, input : integer array to write

len, input : Integer, size

Definition at line 645 of file write_routtines.c.

651{
652 int i,j,k,block;
653 unsigned char buf[BUFLEN*4];
654
655 for(k=0;k<*len;k+=BUFLEN){
656 block = ((*len-k) < BUFLEN)?(*len-k):BUFLEN;
657 for(i=0;i<block;i++){
658 integer_to_IEEE_ASCII(w[i+k],&buf[i*4]);
659 }
660 write_buffer(buf,sizeof(unsigned char),block*4);
661 }
662}

◆ write_i_c_()

void write_i_c_ ( int * w,
int * len )

Definition at line 667 of file write_routtines.c.

668{ write_i_c(w,len); }

◆ write_i_c__()

void write_i_c__ ( int * w,
int * len )

Definition at line 671 of file write_routtines.c.

672{write_i_c(w,len);}

◆ WRITE_R_C()

void _FCALL WRITE_R_C ( float * w,
int * len )

Definition at line 541 of file write_routtines.c.

542{
543 write_r_c(w,len);
544}
void write_r_c(float *w, int *len)

◆ write_r_c()

void write_r_c ( float * w,
int * len )

Writes a float array in file : Radioss IEEE Format.

w, input : float array to write

len, input : Integer, size

Definition at line 519 of file write_routtines.c.

525{
526 int i,j,k,block;
527 unsigned char buf[BUFLEN*4];
528
529 for(k=0;k<*len;k+=BUFLEN){
530 block = ((*len-k) < BUFLEN)?(*len-k):BUFLEN;
531 for(i=0;i<block;i++){
532 real_to_IEEE_ASCII(w[i+k],&buf[i*4]);
533 }
534
535 //fwrite(buf,sizeof(unsigned char),block*4,curfile);
536 write_buffer(buf,sizeof(unsigned char),block*4);
537 }
538}
void real_to_IEEE_ASCII(float reel, unsigned char octet[4])
Definition ieee.cpp:65

◆ write_r_c_()

void write_r_c_ ( float * w,
int * len )

Definition at line 546 of file write_routtines.c.

547{
548 write_r_c(w,len);
549}

◆ WRITE_S_C()

void _FCALL WRITE_S_C ( int * w,
int * len )

Definition at line 703 of file write_routtines.c.

704{ write_s_c(w,len); }
void write_s_c(int *w, int *len)

◆ write_s_c()

void write_s_c ( int * w,
int * len )

Write a string array as Integer in Radioss IEEE format

w, input : integer array to write

len, input : Integer, size

Definition at line 687 of file write_routtines.c.

693{
694 int i,j;
695 unsigned char octet[4];
696
697 for(j=0;j<*len;j++){
698 integer_to_IEEE_ASCII(w[j],octet);
699 for(i=2;i<4;i++) write_buffer(&octet[i],sizeof(unsigned char),1);
700 }
701}

◆ write_s_c_()

void write_s_c_ ( int * w,
int * len )

Definition at line 706 of file write_routtines.c.

707{ write_s_c(w,len); }

Variable Documentation

◆ compress_buffer_length

int compress_buffer_length[100]

Definition at line 124 of file write_routtines.c.

◆ compress_read_buffer

gzFile compress_read_buffer[100]

Definition at line 123 of file write_routtines.c.

◆ compress_write_buffer

unsigned char* compress_write_buffer[100]

Definition at line 122 of file write_routtines.c.

◆ cur_nf

int cur_nf

Definition at line 126 of file write_routtines.c.

◆ curfile

FILE* curfile

Definition at line 125 of file write_routtines.c.

◆ outfile

FILE* outfile[100]

Definition at line 120 of file write_routtines.c.

◆ outfile_mod

int outfile_mod[100]

Definition at line 121 of file write_routtines.c.