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

Added debugging directives to the fped language. They're describe at the end

of README.

- fpd.l, fpd.y, README: added debugging directives %del, %move, %print, %dump,
  and %exit
- obj.h, fpd.y (find_obj, find_label, new_obj): objects can now be labeled
- obj.c (obj_anchors), inst.c (inst_anchors): gathering the list of anchors is 
  now a per-object function, not an instance "method". inst_anchors implements 
  the vector vs. object switch.
- inst.h, inst.c: removed all *_op_anchors functions
- expr.c (str_unit): in the past, we returned a malloc'ed string, but these 
  times are long gone. Thus, don't stralloc("").



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5919 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner
2010-04-19 14:39:57 +00:00
parent e302162a70
commit 6374b3a61a
9 changed files with 245 additions and 79 deletions

33
obj.c
View File

@@ -96,6 +96,39 @@ void search_inst(const struct inst *inst)
}
/* ----- Get the list of anchors of an object ------------------------------ */
int obj_anchors(struct obj *obj, struct vec ***anchors)
{
anchors[0] = &obj->base;
switch (obj->type) {
case ot_frame:
return 1;
case ot_rect:
case ot_line:
anchors[1] = &obj->u.rect.other;
return 2;
case ot_pad:
anchors[1] = &obj->u.pad.other;
return 2;
case ot_meas:
anchors[1] = &obj->u.meas.high;
return 2;
case ot_arc:
/*
* Put end point first so that this is what we grab if dragging
* a circle (thereby turning it into an arc).
*/
anchors[1] = &obj->u.arc.end;
anchors[2] = &obj->u.arc.start;
return 3;
default:
abort();
}
}
/* ----- Instantiation ----------------------------------------------------- */