FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
fstr_ctrl_util.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 *****************************************************************************/
11#ifndef fstr_ctrl_utilH
12#define fstr_ctrl_utilH
13
14#include <assert.h>
15#include <stdarg.h>
16#include <stdlib.h>
17#include <stdio.h>
18#include <string.h>
19#include <ctype.h>
20#include <hecmw_config.h>
21
22#ifndef HECMW_SERIAL
23#include <hecmw_comm.h>
24#endif
25
26#define FSTR_CTRL_RCODE_PARAM_SUCCESS 0
27#define FSTR_CTRL_RCODE_PARAM_ERROR -1
28#define FSTR_CTRL_RCODE_PARAM_TYPE_ERROR -2
29#define FSTR_CTRL_RCODE_PARAM_RANGE_ERROR -3
30#define FSTR_CTRL_RCODE_PARAM_NOTHING 1
31#define FSTR_CTRL_RCODE_PARAM_VALUE_NOTHING 2
32
33#define FSTR_CTRL_RCODE_DATA_SUCCESS 0
34#define FSTR_CTRL_RCODE_DATA_ERROR -1
35#define FSTR_CTRL_RCODE_DATA_TYPE_ERROR -2
36#define FSTR_CTRL_RCODE_DATA_RANGE_ERROR -3
37#define FSTR_CTRL_RCODE_DATA_NOTHING 1
38#define FSTR_CTRL_RCODE_DATA_LINE_NOTHING 2
39
40typedef struct st_ctrl_rec {
42 char* line;
44
45typedef struct st_fstr_ctrl_data {
47 int rec_n;
53
54/* ctrl list for fortran interface */
55#define ctrl_list_size 20
56#ifdef fstr_ctrl_util_MAIN
58#else
60#endif
61
62/* =================================================================================
63 */
69void c_fstr_ctrl_get_err_msg(char* buff);
70
71/* =================================================================================
72 */
79fstr_ctrl_data* c_fstr_ctrl_open(const char* filename);
80
81/* =================================================================================
82 */
90
91/* =================================================================================
92 */
101int c_fstr_ctrl_get_line(fstr_ctrl_data* ctrl, int rec_no, char* buff);
102
103/* =================================================================================
104 */
114int c_fstr_ctrl_seek_header(fstr_ctrl_data* ctrl, const char* header_name);
115
116/* =================================================================================
117 */
125
126/* =================================================================================
127 */
136 char* header_name);
137
138/* =================================================================================
139 */
147
148/* =================================================================================
149 */
157
158/* =================================================================================
159 */
175int c_fstr_ctrl_get_param(fstr_ctrl_data* ctrl, const char* param_name,
176 const char* value_list, char type, void* val);
177
178/* =================================================================================
179 */
197int c_fstr_ctrl_get_param_ex(fstr_ctrl_data* ctrl, const char* param_name,
198 const char* value_list, int necessity, char type,
199 void* val);
200
201/* =================================================================================
202 */
210
211/* =================================================================================
212 */
213/* JP-0 */
214
216 char* data_line);
217
218/* =================================================================================
219 */
220/* JP-1 */
221
223 const char* delim);
224
225/* =================================================================================
226 */
233
235
236/* =================================================================================
237 */
238/* JP-2 */
239
240int c_fstr_ctrl_get_data(fstr_ctrl_data* ctrl, int line_no, const char* format,
241 ...);
243 const char* format, va_list va);
245 const char* format, ...);
246
247int c_fstr_ctrl_get_data_array(fstr_ctrl_data* ctrl, const char* format, ...);
248int c_fstr_ctrl_get_data_array_v(fstr_ctrl_data* ctrl, const char* format,
249 va_list va);
250int c_fstr_ctrl_get_data_array_ex(fstr_ctrl_data* ctrl, const char* format,
251 ...);
252
253/* =================================================================================
254 */
262
263#endif
int line_no
struct st_fstr_ctrl_data fstr_ctrl_data
int c_fstr_ctrl_seek_next_header(fstr_ctrl_data *ctrl)
void c_fstr_ctrl_get_err_msg(char *buff)
struct st_ctrl_rec ctrl_rec
int c_fstr_ctrl_get_rec_number(fstr_ctrl_data *ctrl)
int c_fstr_ctrl_get_current_header_name(fstr_ctrl_data *ctrl, char *header_name)
fstr_ctrl_data * ctrl_list[ctrl_list_size]
int c_fstr_ctrl_get_data_array_v(fstr_ctrl_data *ctrl, const char *format, va_list va)
int c_fstr_ctrl_close(fstr_ctrl_data *ctrl)
int c_fstr_ctrl_get_data_array(fstr_ctrl_data *ctrl, const char *format,...)
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_seek_header(fstr_ctrl_data *ctrl, const char *header_name)
int c_fstr_ctrl_get_data_array_ex(fstr_ctrl_data *ctrl, const char *format,...)
#define ctrl_list_size
int c_fstr_ctrl_get_data_line_n(fstr_ctrl_data *ctrl)
int c_fstr_ctrl_get_data_error_pos(void)
int c_fstr_ctrl_get_current_header_pos(fstr_ctrl_data *ctrl)
int c_fstr_ctrl_get_data_ex(fstr_ctrl_data *ctrl, int line_no, const char *format,...)
int c_fstr_ctrl_get_data_n_in_line(fstr_ctrl_data *ctrl, int line_no, const char *delim)
int c_fstr_ctrl_get_current_header_line_no(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(fstr_ctrl_data *ctrl, int line_no, const char *format,...)
int c_fstr_ctrl_get_line(fstr_ctrl_data *ctrl, int rec_no, char *buff)
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_data_v(fstr_ctrl_data *ctrl, int line_no, const char *format, va_list va)
fstr_ctrl_data * c_fstr_ctrl_open(const char *filename)
int c_fstr_ctrl_get_data_error_line(void)