1 | #ifndef MAD_CMDPAR_H |
---|
2 | #define MAD_CMDPAR_H |
---|
3 | |
---|
4 | // types |
---|
5 | |
---|
6 | struct command; |
---|
7 | struct element; |
---|
8 | struct expression; |
---|
9 | struct expr_list; |
---|
10 | struct double_array; |
---|
11 | struct char_p_array; |
---|
12 | struct el_list; |
---|
13 | struct var_list; |
---|
14 | |
---|
15 | struct command_parameter /* holds one command parameter */ |
---|
16 | { |
---|
17 | char name[NAME_L]; |
---|
18 | int type; /* 0 logical 1 integer 2 double |
---|
19 | 3 string 4 constraint */ |
---|
20 | /* 11 int array 12 double array |
---|
21 | 13 string array */ |
---|
22 | int c_type; /* for type 4: |
---|
23 | 1 min, 2 max, 3 both, 4 value */ |
---|
24 | double double_value; /* type 0, 1, 2, 4 */ |
---|
25 | double c_min; /* type 4 */ |
---|
26 | double c_max; /* type 4 */ |
---|
27 | struct expression* expr; /* type 1, 2, 4 */ |
---|
28 | struct expression* min_expr; /* type 4 */ |
---|
29 | struct expression* max_expr; /* type 4 */ |
---|
30 | char* string; /* type 3 */ |
---|
31 | int stamp; |
---|
32 | struct double_array* double_array; /* type 11, 12 */ |
---|
33 | struct expr_list* expr_list; /* type 11, 12 */ |
---|
34 | struct char_p_array* m_string; /* type 13 */ |
---|
35 | struct command_parameter* call_def; /* contains definitions for "bare" |
---|
36 | parameter input, e.g. option,echo */ |
---|
37 | }; |
---|
38 | |
---|
39 | struct command_parameter_list /* contains list of command parameter pointers */ |
---|
40 | { |
---|
41 | int stamp; |
---|
42 | char name[NAME_L]; |
---|
43 | int max, /* max. pointer array size */ |
---|
44 | curr; /* current occupation */ |
---|
45 | struct command_parameter** parameters; /* command_parameter pointer list */ |
---|
46 | }; |
---|
47 | |
---|
48 | // interface |
---|
49 | |
---|
50 | struct command_parameter* new_command_parameter(char* name, int type); |
---|
51 | struct command_parameter_list* new_command_parameter_list(int length); |
---|
52 | struct command_parameter* clone_command_parameter(struct command_parameter*); |
---|
53 | struct command_parameter* delete_command_parameter(struct command_parameter*); |
---|
54 | struct command_parameter_list* delete_command_parameter_list(struct command_parameter_list*); |
---|
55 | struct command_parameter* store_comm_par_def(char* toks[], int start, int end); |
---|
56 | |
---|
57 | struct expression* command_par_expr(const char* parameter, struct command*); |
---|
58 | double command_par_special(const char* parameter, struct element*); |
---|
59 | char* command_par_string(const char* parameter, struct command*); |
---|
60 | double command_par_value(const char* parameter, struct command*); |
---|
61 | int command_par_value2(const char* parameter, struct command*, double* val); |
---|
62 | struct double_array* command_par_array(const char* parameter, struct command*); |
---|
63 | int command_par_vector(const char* parameter, struct command*, double* vector); |
---|
64 | void set_command_par_value(const char* parameter, struct command*, double val); |
---|
65 | void store_comm_par_value(const char* parameter, double val, struct command*); |
---|
66 | char* alias(char* par_string); |
---|
67 | void fill_par_var_list(struct el_list*, struct command_parameter*, struct var_list*); |
---|
68 | int decode_par(struct in_cmd* cmd, int start, int number, int pos, int log); |
---|
69 | void store_set(struct command*, int flag); |
---|
70 | void dump_command_parameter(struct command_parameter*); |
---|
71 | void export_comm_par(struct command_parameter*, char* string); |
---|
72 | void grow_command_parameter_list(struct command_parameter_list*); |
---|
73 | void print_command_parameter(struct command_parameter*); |
---|
74 | int par_present(char* par, struct command*, struct command_list*); |
---|
75 | void store_comm_par_vector(const char* parameter, double* val, struct command*); |
---|
76 | void add_cmd_parameter_clone(struct command*, struct command_parameter*,char* par_name,int inf); |
---|
77 | void add_cmd_parameter_new(struct command*,double par_value,char* par_name,int inf); |
---|
78 | void comm_para(char* name, int* n_int, int* n_double, int* n_string, int* int_array, double* double_array, char* strings, int* string_lengths); |
---|
79 | int log_val(char* name, struct command*); |
---|
80 | |
---|
81 | // void set_command_par_string(char* parameter, struct command*, char* val); // not used... |
---|
82 | |
---|
83 | // used by Fortran |
---|
84 | double get_value (char* name, char* par); |
---|
85 | int get_string(char* name, char* par, char* string); |
---|
86 | int get_vector(char* name, char* par, double* vector); |
---|
87 | void set_value (char* name, char* par, double* value); |
---|
88 | |
---|
89 | #endif // MAD_CMDPAR_H |
---|
90 | |
---|