Index: trunk/src/tool.c =================================================================== --- trunk/src/tool.c (revision 12112) +++ trunk/src/tool.c (revision 12113) @@ -50,10 +50,11 @@ vtp0_uninit(&pcb_tools); } -int pcb_tool_reg(const pcb_tool_t *tool) +int pcb_tool_reg(pcb_tool_t *tool, const char *cookie) { if (pcb_tool_lookup(tool->name) != PCB_TOOLID_INVALID) /* don't register two tools with the same name */ return -1; + tool->cookie = cookie; vtp0_append(&pcb_tools, (void *)tool); return 0; } @@ -154,7 +155,7 @@ #include "tool_thermal.h" #include "tool_via.h" -const char *cookie = "default tools"; +const char *pcb_tool_cookie = "default tools"; static void default_tool_reg(void) { @@ -163,6 +164,6 @@ static void default_tool_unreg(void) { - pcb_tool_unreg_by_cookie(cookie); + pcb_tool_unreg_by_cookie(pcb_tool_cookie); } Index: trunk/src/tool.h =================================================================== --- trunk/src/tool.h (revision 12112) +++ trunk/src/tool.h (revision 12113) @@ -44,7 +44,7 @@ void pcb_tool_uninit(void); /* Insert a new tool in pcb_tools; returns 0 on success */ -int pcb_tool_reg(const pcb_tool_t *tool); +int pcb_tool_reg(pcb_tool_t *tool, const char *cookie); /* Unregister all tools that has matching cookie */ void pcb_tool_unreg_by_cookie(const char *cookie); @@ -70,4 +70,8 @@ /* Get the tool pointer of a tool by id */ #define pcb_tool_get(id) ((const pcb_tool_t *)vtp0_get(&pcb_tools, id, 0)) +/**** temporary - will be moved out to a plugin ****/ +extern const char *pcb_tool_cookie; + + #endif