diff options
| author | Ryan Chipman <rchipman@mit.edu> | 2015-06-27 14:02:57 -0400 |
|---|---|---|
| committer | Ryan Chipman <rchipman@mit.edu> | 2015-06-28 11:26:54 -0400 |
| commit | 08213bc63c98190d331d00fc7fce5f3f975d0e36 (patch) | |
| tree | afaa3cc8161acc62e0ed97650675ee3b9b2565f5 | |
| parent | be1fc07077f8fe3e18fdfbe48042d5a75e326de6 (diff) | |
| download | vis-08213bc63c98190d331d00fc7fce5f3f975d0e36.tar.gz vis-08213bc63c98190d331d00fc7fce5f3f975d0e36.tar.xz | |
Add seq field to Action struct
| -rw-r--r-- | text.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -99,6 +99,7 @@ struct Action { Action *earlier; /* the previous Action, chronologically */ Action *later; /* the next Action, chronologically */ time_t time; /* when the first change of this action was performed */ + size_t seq; /* a unique, strictly increasing identifier */ }; typedef struct { @@ -342,6 +343,13 @@ static Action *action_alloc(Text *txt) { return NULL; new->time = time(NULL); txt->current_action = new; + + /* set sequence number */ + if (!txt->last_action) + new->seq = 0; + else + new->seq = txt->last_action->seq + 1; + /* set earlier, later pointers */ if (txt->last_action) txt->last_action->later = new; |
