source: PSPA/madxPSPA/src/mad_cmd.h @ 430

Last change on this file since 430 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 2.7 KB
Line 
1#ifndef MAD_CMD_H
2#define MAD_CMD_H
3
4// types
5
6struct name_list;
7struct command_parameter_list;
8
9struct command                     /* holds one command */
10{
11  char name[NAME_L];
12  char module[NAME_L];                 /* name of module it belongs to */
13  char group[NAME_L];                  /* command group it belongs to */
14  int stamp;
15  int link_type;                       /* 0 none, 1 start, 2 end of group */
16  int mad8_type;                       /* 0 none, else mad-8 element code */
17  int beam_def;                        /* beam commands: 1 if defined */
18  struct name_list* par_names;         /* names + input flag of parameters */
19  struct command_parameter_list* par;  /* parameter pointer list */
20};
21
22struct command_list /* contains list of command pointers sorted by name */
23{
24  char name[NAME_L];
25  int  max,                     /* max. pointer array size */
26       curr;                    /* current occupation */
27  struct name_list* list;       /* index list of names */
28  int stamp;
29  struct command** commands;    /* command pointer list */
30};
31
32struct command_list_list /* contains list of command lists */
33{
34  char name[NAME_L];
35  int  max,                     /* max. pointer array size */
36       curr;                    /* current occupation */
37  struct name_list* list;       /* index list of names */
38  struct command_list** command_lists;    /* command_list pointer list */
39  int stamp;
40};
41
42// interface
43
44struct command* new_command(char* name, int nl_length, int pl_length, char* module, char* group, int link, int mad_8);
45struct command* delete_command(struct command*);
46struct command* clone_command(struct command*);
47struct command* find_command(char* name, struct command_list*);
48
49struct command_list* new_command_list(char* l_name, int length);
50struct command_list* delete_command_list(struct command_list* cl);
51struct command_list* find_command_list(char* name, struct command_list_list*);
52void                 grow_command_list(struct command_list*);
53void                 add_to_command_list(char* label, struct command*, struct command_list*, int flag);
54
55struct command_list_list* new_command_list_list(int length);
56//struct command_list_list* delete_command_list_list(struct command_list_list*); // never used...
57void                      add_to_command_list_list(char* label, struct command_list*, struct command_list_list*);
58
59void    exec_command(void);
60int     decode_command(void);
61void    dump_command(struct command*); // for debugging
62void    print_command(struct command*);
63void    store_command_def(char* cmd_string);  /* processes command definition */
64int     make_line(char* statement);
65int     get_stmt(FILE* file, int supp_flag);
66void    get_defined_commands(void);
67void    remove_from_command_list(char* label, struct command_list*);
68
69#endif // MAD_CMD_H
Note: See TracBrowser for help on using the repository browser.