Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef MAD_CMD_H
0002 #define MAD_CMD_H
0003 
0004 // types
0005 
0006 struct name_list;
0007 struct command_parameter_list;
0008 
0009 struct command                     /* holds one command */
0010 {
0011   char name[NAME_L];
0012   char module[NAME_L];                 /* name of module it belongs to */
0013   char group[NAME_L];                  /* command group it belongs to */
0014   int stamp;
0015   int link_type;                       /* 0 none, 1 start, 2 end of group */
0016   int mad8_type;                       /* 0 none, else mad-8 element code */
0017   int beam_def;                        /* beam commands: 1 if defined */
0018   struct name_list* par_names;         /* names + input flag of parameters */
0019   struct command_parameter_list* par;  /* parameter pointer list */
0020 };
0021 
0022 struct command_list /* contains list of command pointers sorted by name */
0023 {
0024   char name[NAME_L];
0025   int  max,                     /* max. pointer array size */
0026        curr;                    /* current occupation */
0027   struct name_list* list;       /* index list of names */
0028   int stamp;
0029   struct command** commands;    /* command pointer list */
0030 };
0031 
0032 struct command_list_list /* contains list of command lists */
0033 {
0034   char name[NAME_L];
0035   int  max,                     /* max. pointer array size */
0036        curr;                    /* current occupation */
0037   struct name_list* list;       /* index list of names */
0038   struct command_list** command_lists;    /* command_list pointer list */
0039   int stamp;
0040 };
0041 
0042 // interface
0043 
0044 struct command* new_command(const char* name, int nl_length, int pl_length, const char* module, const char* group, int link, int mad_8);
0045 struct command* delete_command(struct command*);
0046 struct command* clone_command(struct command*);
0047 struct command* clone_command_flat(struct command*);
0048 struct command* find_command(const char* name, struct command_list*);
0049 
0050 struct command_list* new_command_list(const char* l_name, int length);
0051 struct command_list* delete_command_list(struct command_list* cl);
0052 struct command_list* find_command_list(const char* name, struct command_list_list*);
0053 void                 grow_command_list(struct command_list*);
0054 void                 add_to_command_list(const char* label, struct command*, struct command_list*, int flag);
0055 
0056 struct command_list_list* new_command_list_list(int length);
0057 //struct command_list_list* delete_command_list_list(struct command_list_list*); // never used...
0058 void                      add_to_command_list_list(char* label, struct command_list*, struct command_list_list*);
0059 
0060 void    exec_command(void);
0061 int     decode_command(void);
0062 void    dump_command(struct command*); // for debugging
0063 void    print_command(struct command*);
0064 void    store_command_def(char* cmd_string);  /* processes command definition */
0065 int     make_line(char* statement);
0066 int     get_stmt(FILE* file, int supp_flag);
0067 void    get_defined_commands(char *);
0068 void    remove_from_command_list(char* label, struct command_list*);
0069 void    exec_add_expression(struct in_cmd* cmd);
0070 
0071 #endif // MAD_CMD_H