FrontISTR  5.7.1
Large-scale structural analysis program with finit element method
fstr_ctrl_util.c File Reference
#include "fstr_ctrl_util.h"
#include "hecmw_malloc.h"
Include dependency graph for fstr_ctrl_util.c:

Go to the source code of this file.

Macros

#define fstr_ctrl_util_MAIN
 
#define TRUE   1
 
#define FALSE   0
 
#define buffsize   256
 
#define STR_SIZE   buffsize
 
#define FILE_NAME_SIZE   512
 
#define MAX_DATA_ARRAY_NUMBER   256
 

Functions

void c_fstr_ctrl_get_err_msg (char *buff)
 
int fstr_ctrl_tmp_rewind (fstr_ctrl_data *ctrl)
 
int fstr_ctrl_rewind (int *ctrl)
 
fstr_ctrl_datac_fstr_ctrl_open (const char *filename)
 
int c_fstr_ctrl_get_rec_number (fstr_ctrl_data *ctrl)
 
int c_fstr_ctrl_get_line (fstr_ctrl_data *ctrl, int rec_no, char *buff)
 
int c_fstr_ctrl_seek_header (fstr_ctrl_data *ctrl, const char *header_name)
 
int c_fstr_ctrl_seek_next_header (fstr_ctrl_data *ctrl)
 
int c_fstr_ctrl_get_current_header_name (fstr_ctrl_data *ctrl, char *header_name)
 
int c_fstr_ctrl_get_current_header_line_no (fstr_ctrl_data *ctrl)
 
int c_fstr_ctrl_get_current_header_pos (fstr_ctrl_data *ctrl)
 
int c_fstr_ctrl_get_param (fstr_ctrl_data *ctrl, const char *param_name, const char *value_list, char type, void *val)
 
int c_fstr_ctrl_get_param_ex (fstr_ctrl_data *ctrl, const char *param_name, const char *value_list, int necessity, char type, void *val)
 
int c_fstr_ctrl_get_data_line_n (fstr_ctrl_data *ctrl)
 
int c_fstr_ctrl_copy_data_line (fstr_ctrl_data *ctrl, int line_no, char *data_line)
 
int c_fstr_ctrl_get_data_n_in_line (fstr_ctrl_data *ctrl, int line_no, const char *delim)
 
int c_fstr_ctrl_get_data_error_pos (void)
 
int c_fstr_ctrl_get_data_error_line (void)
 
int c_fstr_ctrl_get_data (fstr_ctrl_data *ctrl, int line_no, const char *format,...)
 
int c_fstr_ctrl_get_data_ex (fstr_ctrl_data *ctrl, int line_no, const char *format,...)
 
int c_fstr_ctrl_get_data_v (fstr_ctrl_data *ctrl, int line_no, const char *format, va_list va)
 
int c_fstr_ctrl_get_data_array_v (fstr_ctrl_data *ctrl, const char *format, va_list va)
 
int c_fstr_ctrl_get_data_array (fstr_ctrl_data *ctrl, const char *format,...)
 
int c_fstr_ctrl_get_data_array_ex (fstr_ctrl_data *ctrl, const char *format,...)
 
int c_fstr_ctrl_close (fstr_ctrl_data *ctrl)
 
void c_fstr_ctrl_dump (fstr_ctrl_data *ctrl)
 
void fstr_ctrl_get_err_msg (char *f_buff, int *len)
 
int fstr_ctrl_open (char *filename)
 
int fstr_ctrl_get_rec_number (int *ctrl)
 
int fstr_ctrl_get_line (int *ctrl, int *rec_no, char *buff, int *buff_size)
 
int fstr_ctrl_seek_header (int *ctrl, const char *header_name)
 
int fstr_ctrl_seek_next_header (int *ctrl)
 
int fstr_ctrl_get_c_h_name (int *ctrl, char *header_name, int *buff_size)
 
int fstr_ctrl_get_c_h_line_no (int *ctrl)
 
int fstr_ctrl_get_c_h_pos (int *ctrl)
 
int fstr_ctrl_get_param (int *ctrl, const char *param_name, const char *value_list, char *type, void *val)
 
int fstr_ctrl_get_param_ex (int *ctrl, const char *param_name, const char *value_list, int *necessity, char *type, void *val)
 
int fstr_ctrl_get_data_line_n (int *ctrl)
 
int fstr_ctrl_get_data_n_in_line (int *ctrl, int *line_no, const char *delim)
 
int fstr_ctrl_get_data_error_pos (void)
 
int fstr_ctrl_get_data_error_line (void)
 
int fstr_ctrl_get_data_v_f (fstr_ctrl_data *ctrl, int line_no, const char *format, va_list va)
 
int fstr_ctrl_get_data (int *ctrl, int *line_no, const char *format,...)
 
int fstr_ctrl_get_data_v10 (int *ctrl, int *line_no, const char *format, void *v1, void *v2, void *v3, void *v4, void *v5, void *v6, void *v7, void *v8, void *v9, void *v10)
 
int fstr_ctrl_get_data_ex_v_f (fstr_ctrl_data *ctrl, int line_no, const char *format, va_list va)
 
int fstr_ctrl_get_data_ex (int *ctrl, int *line_no, const char *format,...)
 
int fstr_ctrl_get_data_ex_v10 (int *ctrl, int *line_no, const char *format, void *v1, void *v2, void *v3, void *v4, void *v5, void *v6, void *v7, void *v8, void *v9, void *v10)
 
int fstr_ctrl_get_data_array_ex_v_f (fstr_ctrl_data *ctrl, const char *format, va_list va)
 
int fstr_ctrl_get_data_array_ex (int *ctrl, const char *format,...)
 
int fstr_ctrl_get_data_array_ex_v10 (int *ctrl, const char *format, void *v1, void *v2, void *v3, void *v4, void *v5, void *v6, void *v7, void *v8, void *v9, void *v10)
 
int fstr_ctrl_close (int *ctrl)
 
void fstr_ctrl_dump (int *ctrl)
 

Variables

char err_msg [buffsize]
 
int fg_fortran_get_data_array_v = 0
 
int line_no
 
int error_pos = -1
 
int error_line = -1
 
int is_first = 1
 

Macro Definition Documentation

◆ buffsize

#define buffsize   256

Definition at line 16 of file fstr_ctrl_util.c.

◆ FALSE

#define FALSE   0

Definition at line 13 of file fstr_ctrl_util.c.

◆ FILE_NAME_SIZE

#define FILE_NAME_SIZE   512

Definition at line 18 of file fstr_ctrl_util.c.

◆ fstr_ctrl_util_MAIN

#define fstr_ctrl_util_MAIN

Definition at line 6 of file fstr_ctrl_util.c.

◆ MAX_DATA_ARRAY_NUMBER

#define MAX_DATA_ARRAY_NUMBER   256

◆ STR_SIZE

#define STR_SIZE   buffsize

Definition at line 17 of file fstr_ctrl_util.c.

◆ TRUE

#define TRUE   1

Definition at line 12 of file fstr_ctrl_util.c.

Function Documentation

◆ c_fstr_ctrl_close()

int c_fstr_ctrl_close ( fstr_ctrl_data ctrl)

Closing fstr control file

Parameters
ctrlSpecify fstr_ctrl_data* pointer obtained from fstr_ctrl_open
Returns
0:success, -1:fail

Definition at line 1040 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ c_fstr_ctrl_copy_data_line()

int c_fstr_ctrl_copy_data_line ( fstr_ctrl_data ctrl,
int  line_no,
char *  data_line 
)

Definition at line 734 of file fstr_ctrl_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ c_fstr_ctrl_dump()

void c_fstr_ctrl_dump ( fstr_ctrl_data ctrl)

Definition at line 1047 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ c_fstr_ctrl_get_current_header_line_no()

int c_fstr_ctrl_get_current_header_line_no ( fstr_ctrl_data ctrl)

Obtaining line number of current header in fstr control file

Parameters
ctrlSpecify fstr_ctrl_data* pointer obtained from fstr_ctrl_open
Returns
line number or 0:not header seeking, -1:error

Definition at line 436 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ c_fstr_ctrl_get_current_header_name()

int c_fstr_ctrl_get_current_header_name ( fstr_ctrl_data ctrl,
char *  header_name 
)

Obtaining current header name

Parameters
ctrlSpecify fstr_ctrl_data* pointer obtained from fstr_ctrl_open
header_namebuffer for header name
Returns
0:success, -1:fail

Definition at line 408 of file fstr_ctrl_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ c_fstr_ctrl_get_current_header_pos()

int c_fstr_ctrl_get_current_header_pos ( fstr_ctrl_data ctrl)

Obtaining record line number of current header in fstr control file

Parameters
ctrlSpecify fstr_ctrl_data* pointer obtained from fstr_ctrl_open
Returns
line number or 0:not header seeking, -1:error

Definition at line 451 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ c_fstr_ctrl_get_data()

int c_fstr_ctrl_get_data ( fstr_ctrl_data ctrl,
int  line_no,
const char *  format,
  ... 
)

Definition at line 792 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ c_fstr_ctrl_get_data_array()

int c_fstr_ctrl_get_data_array ( fstr_ctrl_data ctrl,
const char *  format,
  ... 
)

Definition at line 1011 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ c_fstr_ctrl_get_data_array_ex()

int c_fstr_ctrl_get_data_array_ex ( fstr_ctrl_data ctrl,
const char *  format,
  ... 
)

Definition at line 1020 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ c_fstr_ctrl_get_data_array_v()

int c_fstr_ctrl_get_data_array_v ( fstr_ctrl_data ctrl,
const char *  format,
va_list  va 
)

Definition at line 926 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ c_fstr_ctrl_get_data_error_line()

int c_fstr_ctrl_get_data_error_line ( void  )

Definition at line 788 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ c_fstr_ctrl_get_data_error_pos()

int c_fstr_ctrl_get_data_error_pos ( void  )

Obtaining converting error position in previous fstr_ctrl_get_data execution

Returns
Position of error, 0: no error, or, -1 : non converting error

Definition at line 784 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ c_fstr_ctrl_get_data_ex()

int c_fstr_ctrl_get_data_ex ( fstr_ctrl_data ctrl,
int  line_no,
const char *  format,
  ... 
)

Definition at line 802 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ c_fstr_ctrl_get_data_line_n()

int c_fstr_ctrl_get_data_line_n ( fstr_ctrl_data ctrl)

Obtaining data line number of current header

Parameters
ctrlSpecify fstr_ctrl_data* pointer obtained from fstr_ctrl_open
Returns
Data line number or -1 (Error)

Definition at line 714 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ c_fstr_ctrl_get_data_n_in_line()

int c_fstr_ctrl_get_data_n_in_line ( fstr_ctrl_data ctrl,
int  line_no,
const char *  delim 
)

Definition at line 755 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ c_fstr_ctrl_get_data_v()

int c_fstr_ctrl_get_data_v ( fstr_ctrl_data ctrl,
int  line_no,
const char *  format,
va_list  va 
)

Definition at line 818 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ c_fstr_ctrl_get_err_msg()

void c_fstr_ctrl_get_err_msg ( char *  buff)

Get error message (for _ex function )

Parameters
buffbuffer for copied message

Definition at line 22 of file fstr_ctrl_util.c.

◆ c_fstr_ctrl_get_line()

int c_fstr_ctrl_get_line ( fstr_ctrl_data ctrl,
int  rec_no,
char *  buff 
)

Obtaining line

Parameters
ctrlSpecify fstr_ctrl_data* pointer obtained from fstr_ctrl_open
rec_noSpecify record no
buffPointer to copy the record string line
Returns
record number without comment and blank lines

Definition at line 334 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ c_fstr_ctrl_get_param()

int c_fstr_ctrl_get_param ( fstr_ctrl_data ctrl,
const char *  param_name,
const char *  value_list,
char  type,
void *  val 
)

Obtaining value of parameter in current header line

Parameters
ctrlSpecify fstr_ctrl_data* pointer obtained from fstr_ctrl_open
paran_nameSpecify parameter name
value_listSpecify value list by csv string
typeSpecify type of parameter's value as character 'I':integer(int), 'C' or 'S':string(char*), 'R':real(double), 'P':Pattern Input(first string in value_list is 0) (int) 'E':exist or not(int, 1 or 0)
valPut pointer to store the parameter's value
Returns
0:success, 1:nothing parameter, 2:nothing value of param., 3:type change error 4:value range error

Definition at line 571 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ c_fstr_ctrl_get_param_ex()

int c_fstr_ctrl_get_param_ex ( fstr_ctrl_data ctrl,
const char *  param_name,
const char *  value_list,
int  necessity,
char  type,
void *  val 
)

Obtaining value of parameter in current header line This function uses "fstr_ctrl_get_param" and prints message in error occurrence.

Parameters
ctrlSpecify fstr_ctrl_data* pointer obtained from fstr_ctrl_open
paran_nameSpecify parameter name
necessityNecessity of parameter (1 or 0)
typeSpecify type of parameter's value as character 'I':integer(int), 'C' or 'S':string(char*), 'R':real(double), 'P':Pattern Input(first string in value_list is 1) (int) 'E':exist or not(int, 1 or 0)
valPut pointer to store the parameter's value
Returns
0:success, 1:nothing parameter, 2:nothing value of param., 3:type change error 4:value range error

Definition at line 664 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ c_fstr_ctrl_get_rec_number()

int c_fstr_ctrl_get_rec_number ( fstr_ctrl_data ctrl)

Obtaining record number

Parameters
ctrlSpecify fstr_ctrl_data* pointer obtained from fstr_ctrl_open
Returns
record number without comment and blank lines

Definition at line 323 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ c_fstr_ctrl_open()

fstr_ctrl_data* c_fstr_ctrl_open ( const char *  filename)

Open FSTR control file

Parameters
filenameSpecify FSTR control file name (included path)
Returns
fstr_ctrl_data* pointer or NULL

Definition at line 240 of file fstr_ctrl_util.c.

◆ c_fstr_ctrl_seek_header()

int c_fstr_ctrl_seek_header ( fstr_ctrl_data ctrl,
const char *  header_name 
)

Seeking to specified header (current header)

Parameters
ctrlSpecify fstr_ctrl_data* pointer obtained from fstr_ctrl_open
header_nameSpecify header name or NULL pointer to seek next header When this function is called from fortran, use blank string instead of NULL
Returns
1:success, 0:fail ( REMARK! )

Definition at line 350 of file fstr_ctrl_util.c.

◆ c_fstr_ctrl_seek_next_header()

int c_fstr_ctrl_seek_next_header ( fstr_ctrl_data ctrl)

Seeking next header (current header)

Parameters
ctrlSpecify fstr_ctrl_data* pointer obtained from fstr_ctrl_open
Returns
1:success, 0:fail ( REMARK! )

Definition at line 390 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ fstr_ctrl_close()

int fstr_ctrl_close ( int *  ctrl)

Definition at line 1349 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ fstr_ctrl_dump()

void fstr_ctrl_dump ( int *  ctrl)

Definition at line 1358 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ fstr_ctrl_get_c_h_line_no()

int fstr_ctrl_get_c_h_line_no ( int *  ctrl)

Definition at line 1169 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ fstr_ctrl_get_c_h_name()

int fstr_ctrl_get_c_h_name ( int *  ctrl,
char *  header_name,
int *  buff_size 
)

Definition at line 1156 of file fstr_ctrl_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fstr_ctrl_get_c_h_pos()

int fstr_ctrl_get_c_h_pos ( int *  ctrl)

Definition at line 1175 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ fstr_ctrl_get_data()

int fstr_ctrl_get_data ( int *  ctrl,
int *  line_no,
const char *  format,
  ... 
)

Definition at line 1257 of file fstr_ctrl_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fstr_ctrl_get_data_array_ex()

int fstr_ctrl_get_data_array_ex ( int *  ctrl,
const char *  format,
  ... 
)

Definition at line 1329 of file fstr_ctrl_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fstr_ctrl_get_data_array_ex_v10()

int fstr_ctrl_get_data_array_ex_v10 ( int *  ctrl,
const char *  format,
void *  v1,
void *  v2,
void *  v3,
void *  v4,
void *  v5,
void *  v6,
void *  v7,
void *  v8,
void *  v9,
void *  v10 
)

Definition at line 1338 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ fstr_ctrl_get_data_array_ex_v_f()

int fstr_ctrl_get_data_array_ex_v_f ( fstr_ctrl_data ctrl,
const char *  format,
va_list  va 
)

Definition at line 1312 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ fstr_ctrl_get_data_error_line()

int fstr_ctrl_get_data_error_line ( void  )

Definition at line 1244 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ fstr_ctrl_get_data_error_pos()

int fstr_ctrl_get_data_error_pos ( void  )

Definition at line 1240 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ fstr_ctrl_get_data_ex()

int fstr_ctrl_get_data_ex ( int *  ctrl,
int *  line_no,
const char *  format,
  ... 
)

Definition at line 1292 of file fstr_ctrl_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fstr_ctrl_get_data_ex_v10()

int fstr_ctrl_get_data_ex_v10 ( int *  ctrl,
int *  line_no,
const char *  format,
void *  v1,
void *  v2,
void *  v3,
void *  v4,
void *  v5,
void *  v6,
void *  v7,
void *  v8,
void *  v9,
void *  v10 
)

Definition at line 1301 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ fstr_ctrl_get_data_ex_v_f()

int fstr_ctrl_get_data_ex_v_f ( fstr_ctrl_data ctrl,
int  line_no,
const char *  format,
va_list  va 
)

Definition at line 1277 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ fstr_ctrl_get_data_line_n()

int fstr_ctrl_get_data_line_n ( int *  ctrl)

Definition at line 1226 of file fstr_ctrl_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fstr_ctrl_get_data_n_in_line()

int fstr_ctrl_get_data_n_in_line ( int *  ctrl,
int *  line_no,
const char *  delim 
)

Definition at line 1232 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ fstr_ctrl_get_data_v10()

int fstr_ctrl_get_data_v10 ( int *  ctrl,
int *  line_no,
const char *  format,
void *  v1,
void *  v2,
void *  v3,
void *  v4,
void *  v5,
void *  v6,
void *  v7,
void *  v8,
void *  v9,
void *  v10 
)

Definition at line 1266 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ fstr_ctrl_get_data_v_f()

int fstr_ctrl_get_data_v_f ( fstr_ctrl_data ctrl,
int  line_no,
const char *  format,
va_list  va 
)

Definition at line 1250 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ fstr_ctrl_get_err_msg()

void fstr_ctrl_get_err_msg ( char *  f_buff,
int *  len 
)

Definition at line 1066 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ fstr_ctrl_get_line()

int fstr_ctrl_get_line ( int *  ctrl,
int *  rec_no,
char *  buff,
int *  buff_size 
)

Definition at line 1123 of file fstr_ctrl_util.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fstr_ctrl_get_param()

int fstr_ctrl_get_param ( int *  ctrl,
const char *  param_name,
const char *  value_list,
char *  type,
void *  val 
)

Definition at line 1181 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ fstr_ctrl_get_param_ex()

int fstr_ctrl_get_param_ex ( int *  ctrl,
const char *  param_name,
const char *  value_list,
int *  necessity,
char *  type,
void *  val 
)

Definition at line 1203 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ fstr_ctrl_get_rec_number()

int fstr_ctrl_get_rec_number ( int *  ctrl)

Definition at line 1117 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ fstr_ctrl_open()

int fstr_ctrl_open ( char *  filename)

Definition at line 1076 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ fstr_ctrl_rewind()

int fstr_ctrl_rewind ( int *  ctrl)

Definition at line 77 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ fstr_ctrl_seek_header()

int fstr_ctrl_seek_header ( int *  ctrl,
const char *  header_name 
)

Definition at line 1136 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

◆ fstr_ctrl_seek_next_header()

int fstr_ctrl_seek_next_header ( int *  ctrl)

Definition at line 1150 of file fstr_ctrl_util.c.

Here is the call graph for this function:

◆ fstr_ctrl_tmp_rewind()

int fstr_ctrl_tmp_rewind ( fstr_ctrl_data ctrl)

Definition at line 72 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

Variable Documentation

◆ err_msg

char err_msg[buffsize]

Definition at line 20 of file fstr_ctrl_util.c.

◆ error_line

int error_line = -1

Definition at line 786 of file fstr_ctrl_util.c.

◆ error_pos

int error_pos = -1

Definition at line 782 of file fstr_ctrl_util.c.

◆ fg_fortran_get_data_array_v

int fg_fortran_get_data_array_v = 0

Definition at line 42 of file fstr_ctrl_util.c.

◆ is_first

int is_first = 1

Definition at line 1074 of file fstr_ctrl_util.c.

◆ line_no

int line_no

Definition at line 83 of file fstr_ctrl_util.c.