Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/madX/mad_macro.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #ifndef MAD_MACRO_H
0002 #define MAD_MACRO_H
0003 
0004 // types
0005 
0006 struct char_array;
0007 struct char_p_array;
0008 struct name_list;
0009 struct in_cmd;
0010 
0011 struct macro     /* stores one line or macro definition */
0012 {
0013   char name[NAME_L];
0014   int n_formal;                 /* no. of formal parameters */
0015   int dead;                     /* set to 1 to prevent line from expansion */
0016   struct char_p_array* formal;  /* list of formal parameters */
0017   struct char_p_array* tokens;  /* token pointers into body if split (line) */
0018   struct char_array* body;      /* contains all statements */
0019   int stamp;
0020   struct char_array* original;
0021 };
0022 
0023 struct macro_list
0024 {
0025   int stamp;
0026   char name[NAME_L];
0027   int  max,                     /* max. pointer array size */
0028        curr;                    /* current occupation */
0029   struct name_list* list;
0030   struct macro** macros;
0031 };
0032 
0033 // interface
0034 
0035 int           make_macro(char* statement);
0036 struct macro* new_macro(int n_formal, int length, int p_length);
0037 
0038 struct macro_list* new_macro_list(int length);
0039 void               add_to_macro_list(struct macro*, struct macro_list*);
0040 
0041 void  disable_line(char* name, struct macro_list*);
0042 void  replace_lines(struct macro*, int replace, char** reps);
0043 void  save_macros2file(const char *);
0044 void  exec_macro(struct in_cmd* cmd, int pos);
0045 #endif // MAD_MACRO_H
0046