Alien-Judy
view release on metacpan or search on metacpan
src/judy-1.0.5/src/JudyCommon/JudyPrintJP.c view on Meta::CPAN
char * value; // for getenv().
// CHECK FOR EXTERNAL ENABLING:
//
// If a parameter is set, report the value, even if it is null or otherwise
// evaluates to zero, in which case enable tracing immediately; otherwise wait
// for the value to be hit.
#define GETENV(Name,Value,Base) \
if ((value = getenv (Name)) != (char *) NULL) \
{ \
(Value) = strtoul (value, (char **) NULL, Base); \
enabled |= ((Value) == 0); /* see above */ \
\
(void) printf ("JudyPrintJP(\"%s\"): $%s = %lu\n", \
Desc, Name, Value); \
}
if (! checked) // only check once.
{
checked = TRUE;
GETENV ("STARTINDEX", startindex, 16);
GETENV ("STARTPOP", startpop, 10);
(void) printf ("JudyPrintJP(\"%s\"): Tracing present %s\n", Desc,
enabled ? "and immediately enabled" :
(startindex || startpop) ?
"but disabled until start condition met" :
"but not enabled by env parameter");
}
if (! enabled) // check repeatedly until latched enabled:
{
if (startindex && (startindex == j__udyIndex))
{
(void) printf ("=== TRACING ENABLED (\"%s\"), "
"startindex = 0x%lx\n", Desc, startindex);
enabled = TRUE;
}
else if (startpop && (startpop == j__udyPopulation))
{
(void) printf ("=== TRACING ENABLED (\"%s\"), "
"startpop = %lu\n", Desc, startpop);
enabled = TRUE;
}
else
{
return; // print nothing this time.
}
}
// SWITCH ON JP TYPE:
switch (JU_JPTYPE(Pjp))
{
// Note: The following COULD be merged more tightly between Judy1 and JudyL,
// but we decided that the output should say cJ1*/cJL*, not cJU*, to be more
// specific.
#ifdef JUDY1
case cJ1_JPNULL1: JPTYPE("cJ1_JPNULL1"); POP0; break;
case cJ1_JPNULL2: JPTYPE("cJ1_JPNULL2"); POP0; break;
case cJ1_JPNULL3: JPTYPE("cJ1_JPNULL3"); POP0; break;
#ifdef JU_64BIT
case cJ1_JPNULL4: JPTYPE("cJ1_JPNULL4"); POP0; break;
case cJ1_JPNULL5: JPTYPE("cJ1_JPNULL5"); POP0; break;
case cJ1_JPNULL6: JPTYPE("cJ1_JPNULL6"); POP0; break;
case cJ1_JPNULL7: JPTYPE("cJ1_JPNULL7"); POP0; break;
#endif
case cJ1_JPBRANCH_L2: JPTYPE("cJ1_JPBRANCH_L2"); POP2;NUMJPSL;break;
case cJ1_JPBRANCH_L3: JPTYPE("cJ1_JPBRANCH_L3"); POP3;NUMJPSL;break;
#ifdef JU_64BIT
case cJ1_JPBRANCH_L4: JPTYPE("cJ1_JPBRANCH_L4"); POP4;NUMJPSL;break;
case cJ1_JPBRANCH_L5: JPTYPE("cJ1_JPBRANCH_L5"); POP5;NUMJPSL;break;
case cJ1_JPBRANCH_L6: JPTYPE("cJ1_JPBRANCH_L6"); POP6;NUMJPSL;break;
case cJ1_JPBRANCH_L7: JPTYPE("cJ1_JPBRANCH_L7"); POP7;NUMJPSL;break;
#endif
case cJ1_JPBRANCH_L: JPTYPE("cJ1_JPBRANCH_L"); NUMJPSL;break;
case cJ1_JPBRANCH_B2: JPTYPE("cJ1_JPBRANCH_B2"); POP2;NUMJPSB;break;
case cJ1_JPBRANCH_B3: JPTYPE("cJ1_JPBRANCH_B3"); POP3;NUMJPSB;break;
#ifdef JU_64BIT
case cJ1_JPBRANCH_B4: JPTYPE("cJ1_JPBRANCH_B4"); POP4;NUMJPSB;break;
case cJ1_JPBRANCH_B5: JPTYPE("cJ1_JPBRANCH_B5"); POP5;NUMJPSB;break;
case cJ1_JPBRANCH_B6: JPTYPE("cJ1_JPBRANCH_B6"); POP6;NUMJPSB;break;
case cJ1_JPBRANCH_B7: JPTYPE("cJ1_JPBRANCH_B7"); POP7;NUMJPSB;break;
#endif
case cJ1_JPBRANCH_B: JPTYPE("cJ1_JPBRANCH_B"); NUMJPSB;break;
case cJ1_JPBRANCH_U2: JPTYPE("cJ1_JPBRANCH_U2"); POP2; break;
case cJ1_JPBRANCH_U3: JPTYPE("cJ1_JPBRANCH_U3"); POP3; break;
#ifdef JU_64BIT
case cJ1_JPBRANCH_U4: JPTYPE("cJ1_JPBRANCH_U4"); POP4; break;
case cJ1_JPBRANCH_U5: JPTYPE("cJ1_JPBRANCH_U5"); POP5; break;
case cJ1_JPBRANCH_U6: JPTYPE("cJ1_JPBRANCH_U6"); POP6; break;
case cJ1_JPBRANCH_U7: JPTYPE("cJ1_JPBRANCH_U7"); POP7; break;
#endif
case cJ1_JPBRANCH_U: JPTYPE("cJ1_JPBRANCH_U"); break;
#ifndef JU_64BIT
case cJ1_JPLEAF1: JPTYPE("cJ1_JPLEAF1"); POP1; break;
#endif
case cJ1_JPLEAF2: JPTYPE("cJ1_JPLEAF2"); POP2; break;
case cJ1_JPLEAF3: JPTYPE("cJ1_JPLEAF3"); POP3; break;
#ifdef JU_64BIT
case cJ1_JPLEAF4: JPTYPE("cJ1_JPLEAF4"); POP4; break;
case cJ1_JPLEAF5: JPTYPE("cJ1_JPLEAF5"); POP5; break;
case cJ1_JPLEAF6: JPTYPE("cJ1_JPLEAF6"); POP6; break;
case cJ1_JPLEAF7: JPTYPE("cJ1_JPLEAF7"); POP7; break;
#endif
case cJ1_JPLEAF_B1: JPTYPE("cJ1_JPLEAF_B1"); POP1; break;
case cJ1_JPFULLPOPU1: JPTYPE("cJ1_JPFULLPOPU1"); POP1; break;
case cJ1_JPIMMED_1_01: JPTYPE("cJ1_JPIMMED_1_01"); POP_1; break;
case cJ1_JPIMMED_2_01: JPTYPE("cJ1_JPIMMED_2_01"); POP_1; break;
( run in 0.400 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )