- Rewrote roleInstance to cope with Arachne needs.
- Introduced some iterators for e.g. term leaves and roledefs. These are not used everywhere yet.
This commit is contained in:
17
src/role.c
17
src/role.c
@@ -193,6 +193,7 @@ roleCreate (Term name)
|
||||
r->nameterm = name;
|
||||
r->next = NULL;
|
||||
r->locals = NULL;
|
||||
r->variables = NULL;
|
||||
r->roledef = NULL;
|
||||
return r;
|
||||
}
|
||||
@@ -238,3 +239,19 @@ rolesPrint (Role r)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//! Iterate over the events in a roledef list
|
||||
/**
|
||||
* Function gets roledef pointer
|
||||
*/
|
||||
int
|
||||
roledef_iterate_events (Roledef rd, int (*func) ())
|
||||
{
|
||||
while (rd != NULL)
|
||||
{
|
||||
if (!func (rd))
|
||||
return 0;
|
||||
rd = rd->next;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user