File indexing completed on 2025-01-18 10:02:04
0001 #ifndef MAD_SEQ_H
0002 #define MAD_SEQ_H
0003
0004
0005
0006 struct el_list;
0007 struct name_list;
0008 struct vector_list;
0009 struct constraint_list;
0010 struct node;
0011 struct node_list;
0012 struct expression;
0013 struct command;
0014 struct table;
0015 struct in_cmd;
0016 struct element;
0017
0018 struct sequence
0019 {
0020
0021 char name[NAME_L];
0022 char export_name[NAME_L];
0023 char* refpos;
0024 char* next_sequ;
0025 int ref_flag;
0026 int share;
0027 int nested;
0028 int con_cnt;
0029 int stamp;
0030 int line;
0031 int add_pass;
0032 int num_interp;
0033 double length;
0034 struct expression* l_expr;
0035 struct node* start;
0036 struct node* end;
0037 struct node_list* nodes;
0038 struct el_list* cavities;
0039 struct el_list* crabcavities;
0040 struct command* beam;
0041
0042 int n_nodes;
0043 int start_node;
0044 int pass_count;
0045 struct node* ex_start;
0046 struct node* ex_end;
0047 struct node* range_start;
0048 struct node* range_end;
0049 struct node** all_nodes;
0050 struct node_list* ex_nodes;
0051 struct table* tw_table;
0052 int tw_valid;
0053 int tw_centre;
0054 struct constraint_list* cl;
0055 struct vector_list* orbits;
0056 };
0057
0058 struct sequence_list
0059 {
0060 char name[NAME_L];
0061 int max,
0062 curr;
0063 struct name_list* list;
0064 struct sequence** sequs;
0065 int stamp;
0066 };
0067
0068
0069
0070 struct node* new_sequ_node(struct sequence*, int occ_cnt);
0071 struct sequence* new_sequence(const char* name, int ref);
0072 void delete_sequence(struct sequence*);
0073 struct sequence_list* new_sequence_list(int length);
0074 struct sequence* find_sequence(const char* name, struct sequence_list*);
0075
0076 void use_sequ(struct in_cmd*);
0077 void remove_from_sequ_list(struct sequence*, struct sequence_list*);
0078 double sequence_length(struct sequence*);
0079 void enter_sequence(struct in_cmd*);
0080 int aperture_count(struct sequence*);
0081 void enter_sequ_reference(struct in_cmd*, struct sequence*);
0082 void exec_dumpsequ(struct in_cmd*);
0083 void exec_save(struct in_cmd*);
0084 void exec_extract(struct in_cmd*);
0085 void expand_curr_sequ(int flag);
0086 void add_to_sequ_list(struct sequence*, struct sequence_list*);
0087 void reset_errors(struct sequence*);
0088 void reset_sector(struct sequence*, int val);
0089 int restart_sequ(void);
0090 void seq_edit_main(struct in_cmd*);
0091 int set_enable(const char* type, struct in_cmd*);
0092 void set_sequence(char* name);
0093 int set_cont_sequence(void);
0094 int sequ_check_valid_twiss(struct sequence*);
0095 int get_nnodes(void);
0096 int get_ncavities(void);
0097
0098 #endif
0099