| 143 | /* *INDENT-ON* */ |
| 144 | |
| 145 | int |
| 146 | main(int argc, char **argv) |
| 147 | { |
| 148 | GListPtr lpc = NULL; |
| 149 | gboolean process = TRUE; |
| 150 | gboolean all_good = TRUE; |
| 151 | enum transition_status graph_rc = -1; |
| 152 | crm_graph_t *transition = NULL; |
| 153 | crm_time_t *a_date = NULL; |
| 154 | cib_t *cib_conn = NULL; |
| 155 | |
| 156 | xmlNode *cib_object = NULL; |
| 157 | int argerr = 0; |
| 158 | int flag; |
| 159 | |
| 160 | char *msg_buffer = NULL; |
| 161 | gboolean optional = FALSE; |
| 162 | pe_working_set_t data_set; |
| 163 | |
| 164 | const char *source = NULL; |
| 165 | const char *xml_file = NULL; |
| 166 | const char *dot_file = NULL; |
| 167 | const char *graph_file = NULL; |
| 168 | const char *input_file = NULL; |
| 169 | const char *input_xml = NULL; |
| 170 | |
| 171 | /* disable glib's fancy allocators that can't be free'd */ |
| 172 | GMemVTable vtable; |
| 173 | |
| 174 | vtable.malloc = malloc; |
| 175 | vtable.realloc = realloc; |
| 176 | vtable.free = free; |
| 177 | vtable.calloc = calloc; |
| 178 | vtable.try_malloc = malloc; |
| 179 | vtable.try_realloc = realloc; |
| 180 | |
| 181 | g_mem_set_vtable(&vtable); |
| 182 | |
| 183 | crm_log_cli_init("ptest"); |
| 184 | crm_set_options(NULL, "[-?Vv] -[Xxp] {other options}", long_options, |
| 185 | "Calculate the cluster's response to the supplied cluster state\n" |
| 186 | "\nSuperceeded by crm_simulate and likely to be removed in a future release\n\n"); |
| 187 | |
| 188 | while (1) { |
| 189 | int option_index = 0; |
| 190 | |
| 191 | flag = crm_get_option(argc, argv, &option_index); |
| 192 | if (flag == -1) |
| 193 | break; |
| 194 | |
| 195 | switch (flag) { |
| 196 | case 'S': |
| 197 | do_simulation = TRUE; |
| 198 | break; |
| 199 | case 'a': |
| 200 | all_actions = TRUE; |
| 201 | break; |
| 202 | case 'w': |
nothing calls this directly
no test coverage detected