Exemplo n.º 1
0
static intBool JNSimpleCompareFunction3(
    void *theEnv,
    void *theValue,
    DATA_OBJECT *theResult)
{
    INSTANCE_TYPE *ins1,*ins2;
    struct multifieldMarker *theMarks;
    struct ObjectCmpJoinSingleSlotVars3 *hack;
    int rv;
    FIELD f1,f2;

    hack = (struct ObjectCmpJoinSingleSlotVars3 *) ValueToBitMap(theValue);
    GetPatternObjectAndMarks(theEnv,((int) hack->firstPattern),hack->firstPatternLHS,hack->firstPatternRHS,&ins1,&theMarks);
    GetInsMultiSlotField(&f1,ins1,(unsigned) hack->firstSlot,
                         (unsigned) hack->firstFromBeginning,
                         (unsigned) hack->firstOffset);
    GetPatternObjectAndMarks(theEnv,((int) hack->secondPattern),hack->secondPatternLHS,hack->secondPatternRHS,&ins2,&theMarks);
    GetInsMultiSlotField(&f2,ins2,(unsigned) hack->secondSlot,
                         (unsigned) hack->secondFromBeginning,
                         (unsigned) hack->secondOffset);
    if (f1.type != f2.type)
        rv = hack->fail;
    else if (f1.value != f2.value)
        rv = hack->fail;
    else
        rv = hack->pass;
    theResult->type = SYMBOL;
    theResult->value = rv ? EnvTrueSymbol(theEnv) : EnvFalseSymbol(theEnv);
    return(rv);
}
Exemplo n.º 2
0
static intBool JNSimpleCompareFunction1(
    void *theEnv,
    void *theValue,
    DATA_OBJECT *theResult)
{
    INSTANCE_TYPE *ins1,*ins2;
    struct multifieldMarker *theMarks;
    struct ObjectCmpJoinSingleSlotVars1 *hack;
    int rv;
    INSTANCE_SLOT *is1,*is2;

    hack = (struct ObjectCmpJoinSingleSlotVars1 *) ValueToBitMap(theValue);
    GetPatternObjectAndMarks(theEnv,((int) hack->firstPattern),hack->firstPatternLHS,hack->firstPatternRHS,&ins1,&theMarks);
    is1 = GetInsSlot(ins1,hack->firstSlot);
    GetPatternObjectAndMarks(theEnv,((int) hack->secondPattern),hack->secondPatternLHS,hack->secondPatternRHS,&ins2,&theMarks);
    is2 = GetInsSlot(ins2,hack->secondSlot);
    if (is1->type != is2->type)
        rv = hack->fail;
    else if (is1->value != is2->value)
        rv = hack->fail;
    else
        rv = hack->pass;
    theResult->type = SYMBOL;
    theResult->value = rv ? EnvTrueSymbol(theEnv) : EnvFalseSymbol(theEnv);
    return(rv);
}
Exemplo n.º 3
0
static CLIPS_BOOLEAN JNSimpleCompareFunction2(
  void *theEnv,
  void *theValue,
  DATA_OBJECT *theResult)
  {
   INSTANCE_TYPE *ins1,*ins2;
   struct multifieldMarker *theMarks;
   struct ObjectCmpJoinSingleSlotVars2 *hack;
   int rv;
   FIELD f1;
   INSTANCE_SLOT *is2;

   hack = (struct ObjectCmpJoinSingleSlotVars2 *) ValueToBitMap(theValue);
   GetPatternObjectAndMarks(theEnv,((int) hack->firstPattern) - 1,&ins1,&theMarks);
   GetInsMultiSlotField(&f1,ins1,(unsigned) hack->firstSlot,
                        (unsigned) hack->fromBeginning,(unsigned) hack->offset);
   GetPatternObjectAndMarks(theEnv,((int) hack->secondPattern) - 1,&ins2,&theMarks);
   is2 = GetInsSlot(ins2,hack->secondSlot);
   if (f1.type != is2->type)
     rv = hack->fail;
   else if (f1.value != is2->value)
     rv = hack->fail;
   else
     rv = hack->pass;
   theResult->type = SYMBOL;
   theResult->value = rv ? EnvTrueSymbol(theEnv) : EnvFalseSymbol(theEnv);
   return(rv);
  }
Exemplo n.º 4
0
static intBool ObjectGetVarJNFunction2(
    void *theEnv,
    void *theValue,
    DATA_OBJECT *theResult)
{
    struct ObjectMatchVar2 *hack;
    INSTANCE_TYPE *theInstance;
    struct multifieldMarker *theMarks;

    hack = (struct ObjectMatchVar2 *) ValueToBitMap(theValue);
    GetPatternObjectAndMarks(theEnv,((int) hack->whichPattern),hack->lhs,hack->rhs,&theInstance,&theMarks);
    GetObjectValueSimple(theEnv,theResult,theInstance,hack);
    return(TRUE);
}
Exemplo n.º 5
0
static CLIPS_BOOLEAN ObjectGetVarJNFunction1(
  void *theEnv,
  void *theValue,
  DATA_OBJECT *theResult)
  {
   struct ObjectMatchVar1 *hack;
   INSTANCE_TYPE *theInstance;
   struct multifieldMarker *theMarks;
   
   hack = (struct ObjectMatchVar1 *) ValueToBitMap(theValue);
   GetPatternObjectAndMarks(theEnv,((int) hack->whichPattern) - 1,&theInstance,&theMarks);
   GetObjectValueGeneral(theEnv,theResult,theInstance,theMarks,hack);
   return(TRUE);
  }