merk/include/action_list.h

34 lines
640 B
C

#ifndef ACTION_LIST_H
#define ACTION_LIST_H
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
typedef enum {
INSERT,
DELETE
} ActionType;
// Represents a deletion or insertion into the files text
typedef struct {
ActionType type;
size_t line_original;
size_t line_changed;
char* content;
} Action;
// Dynamic array of Actions
typedef struct {
Action* actions;
size_t capacity;
size_t len;
} ActionList;
ActionList* new_list();
void add_action(ActionList*, Action);
void append_list(ActionList*, ActionList*);
void free_action_list(ActionList*);
#endif // ACTION_LIST_H