- Improved roledef printing by adding roledefPrintShort.

This commit is contained in:
ccremers 2004-10-28 12:56:13 +00:00
parent 61457b5f3d
commit 3673fc689d
3 changed files with 30 additions and 7 deletions

View File

@ -778,7 +778,7 @@ dotSemiState ()
eprintf ("shape=box,");
}
eprintf ("label=\"");
roledefPrint (rd);
roledefPrintShort (rd);
eprintf ("\"]");
eprintf (";\n");
@ -827,7 +827,7 @@ dotSemiState ()
}
// Draw the first box
// This used to be drawn only if done && send_before_read, now we always draw it.
eprintf ("\t\ts%i [label=\"Run %i ", run,run);
eprintf ("\t\ts%i [label=\"Run %i\\n", run,run);
agentsOfRunPrint (sys, run);
eprintf ("\", shape=diamond];\n");
eprintf ("\t\ts%i -> ", run);

View File

@ -27,8 +27,11 @@ makeRoledef ()
}
//! Print a role event.
/**
* If print_actor is true, the actor is included (OS version), otherwise it is left out (short stuff)
*/
void
roledefPrint (Roledef rd)
roledefPrintGeneric (Roledef rd, int print_actor)
{
if (rd == NULL)
{
@ -79,12 +82,18 @@ roledefPrint (Roledef rd)
eprintf ("(");
if (!(rd->from == NULL && rd->to == NULL))
{
termPrint (rd->from);
eprintf (",");
if (print_actor || rd->type == READ)
{
termPrint (rd->from);
eprintf (",");
}
if (rd->type == CLAIM)
eprintf (" ");
termPrint (rd->to);
eprintf (", ");
if (print_actor || rd->type != READ)
{
termPrint (rd->to);
eprintf (", ");
}
}
termPrint (rd->message);
eprintf (" )");
@ -92,6 +101,19 @@ roledefPrint (Roledef rd)
eprintf ("$");
}
void
roledefPrint (Roledef rd)
{
roledefPrintGeneric (rd, 1);
}
void
roledefPrintShort (Roledef rd)
{
roledefPrintGeneric (rd, 0);
}
//! Duplicate a single role event node.
/**
*\sa roledefDelete()

View File

@ -126,6 +126,7 @@ struct role
typedef struct role *Role;
void roledefPrint (Roledef rd);
void roledefPrintShort (Roledef rd);
Roledef roledefDuplicate1 (const Roledef rd);
Roledef roledefDuplicate (Roledef rd);
void roledefDelete (Roledef rd);