FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
hecmw_bin_io.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2019 FrontISTR Commons
3  * This software is released under the MIT License, see LICENSE.txt
4  *****************************************************************************/
5 
6 #ifndef hecmw_bin_ioH
7 #define hecmw_bin_ioH
8 
9 #include <stdio.h>
10 
11 /*---------------------------------------------------------------------------*/
12 /* CAUTION) hecmw_set_endian_info must be executed before calling following
13  * functions. */
14 
15 void hecmw_set_endian_info(void);
16 
17 /*---------------------------------------------------------------------------*/
18 
19 int hecmw_write_bin_value(unsigned char* x, int size, FILE* fp);
20 int hecmw_write_bin_int(int x, FILE* fp);
21 int hecmw_write_bin_int_arr(int* x, int n, FILE* fp);
22 int hecmw_write_bin_double(double x, FILE* fp);
23 int hecmw_write_bin_double_arr(double* x, int n, FILE* fp);
24 
25 /*---------------------------------------------------------------------------*/
26 
27 int hecmw_read_bin_value(unsigned char* x, int size, FILE* fp);
28 int hecmw_read_bin_int(int* x, FILE* fp);
29 int hecmw_read_bin_int_arr(int* x, int n, FILE* fp);
30 int hecmw_read_bin_double(double* x, FILE* fp);
31 int hecmw_read_bin_double_arr(double* x, int n, FILE* fp);
32 
33 /*---------------------------------------------------------------------------*/
34 
35 /*
36  * fmt : type and array size of arguments
37  * Each cherecter in fmt specifies type of argument and
38  * number after the cheracter means array size.
39  * meening of character in fmt
40  * 'I' : int
41  * 'F' : double
42  * 'S' : string (char*)
43  * exp)
44  * int n, i[10]; char s[20] = "123";
45  * hecmw_write_bin(fp, "II10S", n, i, s);
46  */
47 
48 int hecmw_write_bin(FILE* fp, const char* fmt, ...);
49 int hecmw_read_bin(FILE* fp, const char* fmt, ...);
50 
51 #endif
hecmw_write_bin
int hecmw_write_bin(FILE *fp, const char *fmt,...)
Definition: hecmw_bin_io.c:240
hecmw_read_bin_value
int hecmw_read_bin_value(unsigned char *x, int size, FILE *fp)
Definition: hecmw_bin_io.c:122
hecmw_write_bin_int_arr
int hecmw_write_bin_int_arr(int *x, int n, FILE *fp)
Definition: hecmw_bin_io.c:89
hecmw_read_bin
int hecmw_read_bin(FILE *fp, const char *fmt,...)
Definition: hecmw_bin_io.c:322
hecmw_read_bin_double
int hecmw_read_bin_double(double *x, FILE *fp)
Definition: hecmw_bin_io.c:183
hecmw_write_bin_double
int hecmw_write_bin_double(double x, FILE *fp)
Definition: hecmw_bin_io.c:104
hecmw_read_bin_double_arr
int hecmw_read_bin_double_arr(double *x, int n, FILE *fp)
Definition: hecmw_bin_io.c:191
hecmw_write_bin_double_arr
int hecmw_write_bin_double_arr(double *x, int n, FILE *fp)
Definition: hecmw_bin_io.c:108
hecmw_write_bin_int
int hecmw_write_bin_int(int x, FILE *fp)
Definition: hecmw_bin_io.c:84
hecmw_read_bin_int
int hecmw_read_bin_int(int *x, FILE *fp)
Definition: hecmw_bin_io.c:156
hecmw_write_bin_value
int hecmw_write_bin_value(unsigned char *x, int size, FILE *fp)
Definition: hecmw_bin_io.c:57
hecmw_set_endian_info
void hecmw_set_endian_info(void)
Definition: hecmw_bin_io.c:53
hecmw_read_bin_int_arr
int hecmw_read_bin_int_arr(int *x, int n, FILE *fp)
Definition: hecmw_bin_io.c:167