FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
fstr_ctrl_util.h File Reference
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <hecmw_config.h>
#include <hecmw_comm.h>
Include dependency graph for fstr_ctrl_util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  st_ctrl_rec
 
struct  st_fstr_ctrl_data
 

Macros

#define FSTR_CTRL_RCODE_PARAM_SUCCESS   0
 
#define FSTR_CTRL_RCODE_PARAM_ERROR   -1
 
#define FSTR_CTRL_RCODE_PARAM_TYPE_ERROR   -2
 
#define FSTR_CTRL_RCODE_PARAM_RANGE_ERROR   -3
 
#define FSTR_CTRL_RCODE_PARAM_NOTHING   1
 
#define FSTR_CTRL_RCODE_PARAM_VALUE_NOTHING   2
 
#define FSTR_CTRL_RCODE_DATA_SUCCESS   0
 
#define FSTR_CTRL_RCODE_DATA_ERROR   -1
 
#define FSTR_CTRL_RCODE_DATA_TYPE_ERROR   -2
 
#define FSTR_CTRL_RCODE_DATA_RANGE_ERROR   -3
 
#define FSTR_CTRL_RCODE_DATA_NOTHING   1
 
#define FSTR_CTRL_RCODE_DATA_LINE_NOTHING   2
 
#define ctrl_list_size   20
 

Typedefs

typedef struct st_ctrl_rec ctrl_rec
 
typedef struct st_fstr_ctrl_data fstr_ctrl_data
 

Functions

void c_fstr_ctrl_get_err_msg (char *buff)
 
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_v (fstr_ctrl_data *ctrl, int line_no, const char *format, va_list va)
 
int c_fstr_ctrl_get_data_ex (fstr_ctrl_data *ctrl, int line_no, const char *format,...)
 
int c_fstr_ctrl_get_data_array (fstr_ctrl_data *ctrl, const char *format,...)
 
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_ex (fstr_ctrl_data *ctrl, const char *format,...)
 
int c_fstr_ctrl_close (fstr_ctrl_data *ctrl)
 

Variables

fstr_ctrl_datactrl_list [ctrl_list_size]
 

Detailed Description

Utility for open/close and parse of fstr control file caution: define parameter 'ctrl' as integer for call from fortran

Definition in file fstr_ctrl_util.h.

Macro Definition Documentation

◆ ctrl_list_size

#define ctrl_list_size   20

Definition at line 55 of file fstr_ctrl_util.h.

◆ FSTR_CTRL_RCODE_DATA_ERROR

#define FSTR_CTRL_RCODE_DATA_ERROR   -1

Definition at line 34 of file fstr_ctrl_util.h.

◆ FSTR_CTRL_RCODE_DATA_LINE_NOTHING

#define FSTR_CTRL_RCODE_DATA_LINE_NOTHING   2

Definition at line 38 of file fstr_ctrl_util.h.

◆ FSTR_CTRL_RCODE_DATA_NOTHING

#define FSTR_CTRL_RCODE_DATA_NOTHING   1

Definition at line 37 of file fstr_ctrl_util.h.

◆ FSTR_CTRL_RCODE_DATA_RANGE_ERROR

#define FSTR_CTRL_RCODE_DATA_RANGE_ERROR   -3

Definition at line 36 of file fstr_ctrl_util.h.

◆ FSTR_CTRL_RCODE_DATA_SUCCESS

#define FSTR_CTRL_RCODE_DATA_SUCCESS   0

Definition at line 33 of file fstr_ctrl_util.h.

◆ FSTR_CTRL_RCODE_DATA_TYPE_ERROR

#define FSTR_CTRL_RCODE_DATA_TYPE_ERROR   -2

Definition at line 35 of file fstr_ctrl_util.h.

◆ FSTR_CTRL_RCODE_PARAM_ERROR

#define FSTR_CTRL_RCODE_PARAM_ERROR   -1

Definition at line 27 of file fstr_ctrl_util.h.

◆ FSTR_CTRL_RCODE_PARAM_NOTHING

#define FSTR_CTRL_RCODE_PARAM_NOTHING   1

Definition at line 30 of file fstr_ctrl_util.h.

◆ FSTR_CTRL_RCODE_PARAM_RANGE_ERROR

#define FSTR_CTRL_RCODE_PARAM_RANGE_ERROR   -3

Definition at line 29 of file fstr_ctrl_util.h.

◆ FSTR_CTRL_RCODE_PARAM_SUCCESS

#define FSTR_CTRL_RCODE_PARAM_SUCCESS   0

Definition at line 26 of file fstr_ctrl_util.h.

◆ FSTR_CTRL_RCODE_PARAM_TYPE_ERROR

#define FSTR_CTRL_RCODE_PARAM_TYPE_ERROR   -2

Definition at line 28 of file fstr_ctrl_util.h.

◆ FSTR_CTRL_RCODE_PARAM_VALUE_NOTHING

#define FSTR_CTRL_RCODE_PARAM_VALUE_NOTHING   2

Definition at line 31 of file fstr_ctrl_util.h.

Typedef Documentation

◆ ctrl_rec

typedef struct st_ctrl_rec ctrl_rec

◆ fstr_ctrl_data

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 1050 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 744 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_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 446 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 418 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 461 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 802 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 1021 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 1030 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 936 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 798 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 794 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 812 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 724 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 765 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 828 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 344 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 581 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 674 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 333 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 250 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 360 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 400 of file fstr_ctrl_util.c.

Here is the caller graph for this function:

Variable Documentation

◆ ctrl_list