File indexing completed on 2025-01-18 10:02:04
0001 #ifndef MAD_VAR_H
0002 #define MAD_VAR_H
0003
0004
0005
0006 struct in_cmd;
0007 struct name_list;
0008 struct command_list;
0009 struct expression;
0010
0011 struct constant
0012 {
0013 char name[NAME_L];
0014 struct expression* exp;
0015 double value;
0016 int stamp;
0017 };
0018
0019 struct variable
0020 {
0021 char name[NAME_L];
0022 int status;
0023 int type;
0024 int val_type;
0025 char* string;
0026 struct expression* expr;
0027 double value;
0028 int stamp;
0029 };
0030
0031 struct var_list
0032 {
0033 int stamp;
0034 char name[NAME_L];
0035 int max,
0036 curr;
0037 struct name_list* list;
0038 struct variable** vars;
0039 };
0040
0041
0042
0043 void enter_variable(struct in_cmd*);
0044 struct variable* new_variable(const char* name, double val, int val_type, int type, struct expression*, char* string);
0045 double variable_value(struct variable*);
0046
0047 struct var_list* new_var_list(int length);
0048 struct var_list* clone_var_list(struct var_list*);
0049 struct var_list* delete_var_list(struct var_list*);
0050 void add_to_var_list(struct variable*, struct var_list*, int flag);
0051 struct variable* find_variable(const char* name, struct var_list*);
0052
0053 char* make_string_variable(char* string);
0054 void write_vars(struct var_list*, struct command_list*, FILE*, int noexpr);
0055 void write_vars_8(struct var_list*, struct command_list*, FILE*);
0056 void set_variable(const char* name, double* value);
0057 void set_stringvar(const char* name, char* string);
0058 double get_variable(const char* name);
0059 char* get_varstring(const char* name);
0060 void get_defined_constants(void);
0061
0062 #endif
0063