Index: trunk/src_plugins/act_read/act_geo.c =================================================================== --- trunk/src_plugins/act_read/act_geo.c (revision 32735) +++ trunk/src_plugins/act_read/act_geo.c (revision 32736) @@ -38,6 +38,7 @@ static const char pcb_acth_IsPointOnLine[] = "Returns 1 if point x;y with radius r is on the line addressed by idpath, 0 else."; static fgw_error_t pcb_act_IsPointOnLine(fgw_arg_t *res, int argc, fgw_arg_t *argv) { + pcb_board_t *pcb = PCB_ACT_BOARD; rnd_coord_t x, y, r; pcb_idpath_t *idp; pcb_any_obj_t *obj; @@ -48,7 +49,7 @@ RND_ACT_CONVARG(4, FGW_IDPATH, IsPointOnLine, idp = fgw_idpath(&argv[4])); if ((idp == NULL) || !fgw_ptr_in_domain(&rnd_fgw, &argv[4], RND_PTR_DOMAIN_IDPATH)) return FGW_ERR_PTR_DOMAIN; - obj = pcb_idpath2obj(PCB, idp); + obj = pcb_idpath2obj(pcb, idp); if ((obj == NULL) || (obj->type != PCB_OBJ_LINE)) return FGW_ERR_ARG_CONV; @@ -61,6 +62,7 @@ static const char pcb_acth_IsPointOnArc[] = "Returns 1 if point x;y with radius r is on the arc addressed by idpath, 0 else."; static fgw_error_t pcb_act_IsPointOnArc(fgw_arg_t *res, int argc, fgw_arg_t *argv) { + pcb_board_t *pcb = PCB_ACT_BOARD; rnd_coord_t x, y, r; pcb_idpath_t *idp; pcb_any_obj_t *obj; @@ -71,7 +73,7 @@ RND_ACT_CONVARG(4, FGW_IDPATH, IsPointOnArc, idp = fgw_idpath(&argv[4])); if ((idp == NULL) || !fgw_ptr_in_domain(&rnd_fgw, &argv[4], RND_PTR_DOMAIN_IDPATH)) return FGW_ERR_PTR_DOMAIN; - obj = pcb_idpath2obj(PCB, idp); + obj = pcb_idpath2obj(pcb, idp); if ((obj == NULL) || (obj->type != PCB_OBJ_ARC)) return FGW_ERR_ARG_CONV; @@ -84,6 +86,7 @@ static const char pcb_acth_IntersectObjObj[] = "Returns 1 if point x;y with radius r is on the arc addressed by idpath, 0 else."; static fgw_error_t pcb_act_IntersectObjObj(fgw_arg_t *res, int argc, fgw_arg_t *argv) { + pcb_board_t *pcb = PCB_ACT_BOARD; pcb_idpath_t *idp1, *idp2; pcb_any_obj_t *obj1, *obj2; @@ -93,8 +96,8 @@ return FGW_ERR_PTR_DOMAIN; if ((idp2 == NULL) || !fgw_ptr_in_domain(&rnd_fgw, &argv[2], RND_PTR_DOMAIN_IDPATH)) return FGW_ERR_PTR_DOMAIN; - obj1 = pcb_idpath2obj(PCB, idp1); - obj2 = pcb_idpath2obj(PCB, idp2); + obj1 = pcb_idpath2obj(pcb, idp1); + obj2 = pcb_idpath2obj(pcb, idp2); if ((obj1 == NULL) || ((obj1->type & PCB_OBJ_CLASS_REAL) == 0) || (obj2 == NULL) || ((obj2->type & PCB_OBJ_CLASS_REAL) == 0)) return FGW_ERR_ARG_CONV; @@ -107,6 +110,7 @@ static const char pcb_acth_ObjCenter[] = "Returns the x or y coordinate of the center of an object"; static fgw_error_t pcb_act_ObjCenter(fgw_arg_t *res, int argc, fgw_arg_t *argv) { + pcb_board_t *pcb = PCB_ACT_BOARD; pcb_idpath_t *idp; pcb_any_obj_t *obj; const char *which; @@ -117,7 +121,7 @@ if ((idp == NULL) || !fgw_ptr_in_domain(&rnd_fgw, &argv[1], RND_PTR_DOMAIN_IDPATH)) return FGW_ERR_PTR_DOMAIN; - obj = pcb_idpath2obj(PCB, idp); + obj = pcb_idpath2obj(pcb, idp); if ((obj == NULL) || ((obj->type & PCB_OBJ_CLASS_REAL) == 0)) return FGW_ERR_ARG_CONV; Index: trunk/src_plugins/act_read/act_idpath.c =================================================================== --- trunk/src_plugins/act_read/act_idpath.c (revision 32735) +++ trunk/src_plugins/act_read/act_idpath.c (revision 32736) @@ -129,6 +129,7 @@ static const char pcb_acth_IDP[] = "Basic idpath manipulation."; static fgw_error_t pcb_act_IDP(fgw_arg_t *res, int argc, fgw_arg_t *argv) { + pcb_board_t *pcb = PCB_ACT_BOARD; const char *cmd; pcb_idpath_t *idp; pcb_any_obj_t *obj; @@ -148,7 +149,7 @@ return 0; case act_read_keywords_dup: - obj = pcb_idpath2obj(PCB, idp); + obj = pcb_idpath2obj(pcb, idp); idp = pcb_obj2idpath(obj); res->type = FGW_IDPATH; fgw_ptr_reg(&rnd_fgw, res, RND_PTR_DOMAIN_IDPATH, FGW_PTR | FGW_STRUCT, idp); @@ -167,8 +168,9 @@ static const char pcb_acth_GetParentData[] = "Return the closest upstream pcb_data_t * parent of an object"; static fgw_error_t pcb_act_GetParentData(fgw_arg_t *res, int argc, fgw_arg_t *argv) { + pcb_board_t *pcb = PCB_ACT_BOARD; pcb_idpath_t *idp; - pcb_data_t *root_data = PCB->Data; + pcb_data_t *root_data = pcb->Data; int iidx = 1; pcb_any_obj_t *obj; Index: trunk/src_plugins/act_read/act_read.c =================================================================== --- trunk/src_plugins/act_read/act_read.c (revision 32735) +++ trunk/src_plugins/act_read/act_read.c (revision 32736) @@ -37,11 +37,12 @@ #include "keywords_sphash.h" +#define PCB (do_not_use_PCB) + #include "act_idpath.c" #include "act_geo.c" #include "act_layer.c" - static const char pcb_acts_GetValue[] = "GetValue(input, units, relative, default_unit)"; static const char pcb_acth_GetValue[] = "Convert a coordinate value. Returns an unitless double or FGW_ERR_ARG_CONV. The 3rd parameter controls whether to require relative coordinates (+- prefix). Wraps rnd_get_value_ex()."; static fgw_error_t pcb_act_GetValue(fgw_arg_t *res, int argc, fgw_arg_t *argv)