history = realloc(history, (history_num + 1) * sizeof(*history));
history[history_num].type = type;
history[history_num].file = file;
history = realloc(history, (history_num + 1) * sizeof(*history));
history[history_num].type = type;
history[history_num].file = file;