Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:03

0001 #ifndef MAD_CMDPAR_H
0002 #define MAD_CMDPAR_H
0003 
0004 // types
0005 
0006 struct command;
0007 struct element;
0008 struct expression;
0009 struct expr_list;
0010 struct double_array;
0011 struct char_p_array;
0012 struct el_list;
0013 struct var_list;
0014 
0015 struct command_parameter        /* holds one command parameter */
0016 {
0017   char name[NAME_L];
0018   int type;                           /* 0 logical 1 integer 2 double
0019                                          3 string 4 constraint */
0020                                       /* 11 int array 12 double array
0021                                          13 string array */
0022   int c_type;                         /* for type 4:
0023                                          1 min, 2 max, 3 both, 4 value */
0024   double double_value;                /* type 0, 1, 2, 4 */
0025   double c_min;                       /* type 4 */
0026   double c_max;                       /* type 4 */
0027   struct expression* expr;            /* type 1, 2, 4 */
0028   struct expression* min_expr;        /* type 4 */
0029   struct expression* max_expr;        /* type 4 */
0030   char* string;                       /* type 3 */
0031   int stamp;
0032   struct double_array* double_array;  /* type 11, 12 */
0033   struct expr_list* expr_list;        /* type 11, 12 */
0034   struct char_p_array* m_string;      /* type 13 */
0035   struct command_parameter* call_def; /* contains definitions for "bare"
0036                                          parameter input, e.g. option,echo */
0037 };
0038 
0039 struct command_parameter_list /* contains list of command parameter pointers */
0040 {
0041   int stamp;
0042   char name[NAME_L];
0043   int  max,                               /* max. pointer array size */
0044        curr;                              /* current occupation */
0045   struct command_parameter** parameters;  /* command_parameter pointer list */
0046 };
0047 
0048 // interface
0049 
0050 struct command_parameter*       new_command_parameter(const char* name, int type);
0051 struct command_parameter_list*  new_command_parameter_list(int length);
0052 struct command_parameter*       clone_command_parameter(const struct command_parameter*);
0053 struct command_parameter*       renew_command_parameter(struct command* cmd, const char* par);
0054 struct command_parameter*       delete_command_parameter(struct command_parameter*);
0055 struct command_parameter_list*  delete_command_parameter_list(struct command_parameter_list*);
0056 struct command_parameter*       store_comm_par_def(char* toks[], int start, int end);
0057 
0058 struct expression* command_par_expr(const char* parameter, struct command*);
0059 int     command_par(const char* parameter, const struct command*, struct command_parameter**);
0060 double  command_par_special(const char* parameter, const struct element*);
0061 char*   command_par_string(const char* parameter, const struct command*);
0062 char*   command_par_string_user(const char* parameter, const struct command*);
0063 int     command_par_string_user2(const char* parameter, const struct command*, char**);
0064 int     command_par_value_user2(const char* parameter, const struct command*, double* val);
0065 int     command_par_string_or_calldef(const char* par, const struct command*, char**);
0066 double  command_par_value(const char* parameter, const struct command*);
0067 int     command_par_value2(const char* parameter, const struct command*, double* val);
0068 struct double_array* command_par_array(const char* parameter, struct command*);
0069 int     command_par_vector(const char* parameter, struct command*, double* vector);
0070 void    set_command_par_value(const char* parameter, struct command*, double val);
0071 void    store_comm_par_value(const char* parameter, double val, struct command*);
0072 const char*   alias(char* par_string);
0073 void    fill_par_var_list(struct el_list*, struct command_parameter*, struct var_list*);
0074 int     decode_par(struct in_cmd* cmd, int start, int number, int pos, int log);
0075 void    store_set(struct command*, int flag);
0076 void    dump_command_parameter(struct command_parameter*);
0077 void    export_comm_par(struct command_parameter*, char* string, int noexpr);
0078 void    grow_command_parameter_list(struct command_parameter_list*);
0079 void    print_command_parameter(struct command_parameter*);
0080 int     par_present(const char* par, struct command*);
0081 int     par_present_list(const char* par, struct command_list*);
0082 void    store_comm_par_vector(const char* parameter, double* val, struct command*);
0083 void    add_cmd_parameter_clone(struct command*, const struct command_parameter*, const char* par_name, int inf);
0084 void    add_cmd_parameter_new(struct command*,double par_value, const char* par_name, int inf);
0085 void    comm_para(const char* name, int* n_int, int* n_double, int* n_string, int* int_array, double* double_array, char* strings, int* string_lengths);
0086 int     log_val(const char* name, struct command*);
0087 
0088 // void    set_command_par_string(char* parameter, struct command*, char* val); // not used...
0089 
0090 // used by Fortran
0091 double  get_value (const char* name, const char* par);
0092 int     get_string(const char* name, const char* par, char* string);
0093 int     get_vector(const char* name, const char* par, double* vector);
0094 void    set_value (const char* name, const char* par, double* value);
0095 
0096 #endif // MAD_CMDPAR_H
0097