1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2025-04-21 12:27:27 +03:00

cameo/: new commands "remove" and "keep" for path filtering (untested)

This commit is contained in:
Werner Almesberger
2012-06-12 12:32:08 -03:00
parent 3ee5b1aa31
commit e69fa24133
7 changed files with 95 additions and 6 deletions

View File

@@ -75,7 +75,7 @@ static struct path *path_from(const struct path *old)
}
static struct point *clone_point(struct point *p)
static struct point *clone_point(const struct point *p)
{
struct point *n;
@@ -156,6 +156,25 @@ struct path *path_reverse(const struct path *path)
}
struct path *path_clone(const struct path *path)
{
struct path *new;
const struct point *p;
struct point *n;
new = path_from(path);
for (p = path->first; p; p = p->next) {
n = clone_point(p);
if (new->first)
new->last->next = n;
else
new->first = n;
new->last = n;
}
return new;
}
static void path_reverse_inplace(struct path *path)
{
struct point *points = NULL, *p, *next;