-
- fp = fopen(argv[1], "r");
- xbt_assert2(fp != NULL, "Cannot open %s: %s", argv[1],
- strerror(errno));
-
- // Read lines and execute them until I reach the end of file
- while ((read = getline(&line, &line_len, fp)) != -1) {
- // cleanup and split the string I just read
- if (paranoid_action_replayer) {
- comment = strchr(line, '#');
- if (comment != NULL)
- *comment = '\0';
- xbt_str_trim(line, NULL);
- }
- evt = xbt_str_split_quoted_in_place(line);
- if (xbt_dynar_length(evt)==0) {
- xbt_dynar_free(&evt);
- continue;
- }
-
- evtname = xbt_dynar_get_as(evt, 0, char *);
- if (!strcmp(argv[0], evtname)) {
- msg_action_fun function =
- xbt_dict_get(action_funs, xbt_dynar_get_as(evt, 1, char *));
+ xbt_replay_trace_reader_t reader = xbt_replay_trace_reader_new(argv[1]);
+ while ((evt=xbt_replay_trace_reader_get(reader))) {
+ if (!strcmp(argv[0],evt[0])) {
+ msg_action_fun function = xbt_dict_get(action_funs, evt[1]);