diff options
Diffstat (limited to 'push.c')
| -rw-r--r-- | push.c | 27 |
1 files changed, 0 insertions, 27 deletions
@@ -1,27 +0,0 @@ -#include "prv.h" -#include <stdlib.h> - -int push(const struct pos *pos, struct prv *p) -{ - size_t n = p->n + 1; - struct pos *npos = realloc(p->pos, n * sizeof *npos); - - if (!npos) - { - perror("realloc(3)"); - return -1; - } - else if (p->n) - { - struct pos *prev = &npos[p->n - 1]; - - prev->end = prev->seq->end; - prev->seq = prev->stseq; - prev->step = prev->seq->steps; - p->i++; - } - - npos[p->n++] = *pos; - p->pos = npos; - return 0; -} |
