Commit a1dc0441 authored by Bernhard Link's avatar Bernhard Link

rredtool: Merge new differences with old and write to new index file

parent 15160b74
......@@ -61,6 +61,28 @@ void modification_freelist(struct modification *p) {
}
}
struct modification *modification_dup(const struct modification *p) {
struct modification *first = NULL, *last = NULL;
for( ; p != NULL ; p = p->next ) {
struct modification *m = malloc(sizeof(struct modification));
if( FAILEDTOALLOC(m) ) {
modification_freelist(first);
return NULL;
}
*m = *p;
m->next = NULL;
m->previous = last;
if( last == NULL )
first = m;
else
m->previous->next = m;
last = m;
}
return first;
}
struct modification *patch_getmodifications(struct rred_patch *p) {
struct modification *m;
......
......@@ -9,6 +9,7 @@ retvalue patch_loadfd(const char *, int, off_t, /*@out@*/struct rred_patch **);
void patch_free(/*@only@*/struct rred_patch *);
/*@only@*//*@null@*/struct modification *patch_getmodifications(struct rred_patch *);
/*@null@*/const struct modification *patch_getconstmodifications(struct rred_patch *);
struct modification *modification_dup(const struct modification *);
void modification_freelist(/*@only@*/struct modification *);
retvalue combine_patches(/*@out@*/struct modification **, /*@only@*/struct modification *, /*@only@*/struct modification *);
void modification_printaspatch(FILE *, const struct modification *);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment