コード例 #1
0
ファイル: classexm.c プロジェクト: DrItanium/maya
/***************************************************
  NAME         : SlotPublicP
  DESCRIPTION  : Determines if a slot is public
  INPUTS       : 1) The class
                 2) The slot name
  RETURNS      : True if slot is public,
                 false otherwise
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
bool SlotPublicP(
  Defclass *theDefclass,
  const char *slotName)
  {
   SlotDescriptor *sd;
   Environment *theEnv = theDefclass->header.env;

   if ((sd = LookupSlot(theEnv,theDefclass,slotName,false)) == NULL)
     return false;
   return(sd->publicVisibility ? true : false);
  }
コード例 #2
0
ファイル: classexm.c プロジェクト: DrItanium/maya
/***************************************************
  NAME         : SlotInitableP
  DESCRIPTION  : Determines if a slot is initable
  INPUTS       : 1) The class
                 2) The slot name
  RETURNS      : True if slot is initable,
                 false otherwise
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
bool SlotInitableP(
  Defclass *theDefclass,
  const char *slotName)
  {
   SlotDescriptor *sd;
   Environment *theEnv = theDefclass->header.env;

   if ((sd = LookupSlot(theEnv,theDefclass,slotName,true)) == NULL)
     return false;
   return((sd->noWrite && (sd->initializeOnly == 0)) ? false : true);
  }
コード例 #3
0
ファイル: classexm.c プロジェクト: noxdafox/clips
/***************************************************
  NAME         : EnvSlotPublicP
  DESCRIPTION  : Determines if a slot is public
  INPUTS       : 1) The class
                 2) The slot name
  RETURNS      : TRUE if slot is public,
                 FALSE otherwise
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
globle intBool EnvSlotPublicP(
  void *theEnv,
  void *theDefclass,
  const char *slotName)
  {
   SLOT_DESC *sd;

   if ((sd = LookupSlot(theEnv,(DEFCLASS *) theDefclass,slotName,FALSE)) == NULL)
     return(FALSE);
   return(sd->publicVisibility ? TRUE : FALSE);
  }
コード例 #4
0
ファイル: classexm.c プロジェクト: noxdafox/clips
/***************************************************
  NAME         : EnvSlotInitableP
  DESCRIPTION  : Determines if a slot is initable
  INPUTS       : 1) The class
                 2) The slot name
  RETURNS      : TRUE if slot is initable,
                 FALSE otherwise
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
globle intBool EnvSlotInitableP(
  void *theEnv,
  void *theDefclass,
  const char *slotName)
  {
   SLOT_DESC *sd;

   if ((sd = LookupSlot(theEnv,(DEFCLASS *) theDefclass,slotName,TRUE)) == NULL)
     return(FALSE);
   return((sd->noWrite && (sd->initializeOnly == 0)) ? FALSE : TRUE);
  }
コード例 #5
0
ファイル: classexm.c プロジェクト: chrislong/clipsrules
/***************************************************
  NAME         : EnvSlotDirectAccessP
  DESCRIPTION  : Determines if a slot is directly
                 accessible from message-handlers
                 on class
  INPUTS       : 1) The class
                 2) The slot name
  RETURNS      : TRUE if slot is directly
                 accessible, FALSE otherwise
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
globle intBool EnvSlotDirectAccessP(
  void *theEnv,
  void *theDefclass,
  char *slotName)
  {
   SLOT_DESC *sd;

   if ((sd = LookupSlot(theEnv,(DEFCLASS *) theDefclass,slotName,TRUE)) == NULL)
     return(FALSE);
   return((sd->publicVisibility || (sd->cls == (DEFCLASS *) theDefclass)) ?
           TRUE : FALSE);
  }
コード例 #6
0
ファイル: classexm.c プロジェクト: DrItanium/maya
/***************************************************
  NAME         : SlotDirectAccessP
  DESCRIPTION  : Determines if a slot is directly
                 accessible from message-handlers
                 on class
  INPUTS       : 1) The class
                 2) The slot name
  RETURNS      : True if slot is directly
                 accessible, false otherwise
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
bool SlotDirectAccessP(
  Defclass *theDefclass,
  const char *slotName)
  {
   SlotDescriptor *sd;
   Environment *theEnv = theDefclass->header.env;

   if ((sd = LookupSlot(theEnv,theDefclass,slotName,true)) == NULL)
     return false;
   return((sd->publicVisibility || (sd->cls == theDefclass)) ?
           true : false);
  }
コード例 #7
0
ファイル: classexm.c プロジェクト: chrislong/clipsrules
/***************************************************
  NAME         : EnvSlotDefaultP
  DESCRIPTION  : Determines if a slot has a default value
  INPUTS       : 1) The class
                 2) The slot name
  RETURNS      : TRUE if slot is public,
                 FALSE otherwise
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
globle int EnvSlotDefaultP(
  void *theEnv,
  void *theDefclass,
  char *slotName)
  {
   SLOT_DESC *sd;

   if ((sd = LookupSlot(theEnv,(DEFCLASS *) theDefclass,slotName,FALSE)) == NULL)
     return(NO_DEFAULT);
     
   if (sd->noDefault)
     { return(NO_DEFAULT); }
   else if (sd->dynamicDefault)
     { return(DYNAMIC_DEFAULT); }
   
   return(STATIC_DEFAULT);
  }
コード例 #8
0
ファイル: classexm.c プロジェクト: DrItanium/maya
/***************************************************
  NAME         : SlotDefaultP
  DESCRIPTION  : Determines if a slot has a default value
  INPUTS       : 1) The class
                 2) The slot name
  RETURNS      : True if slot is public,
                 false otherwise
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
int SlotDefaultP(
  Environment *theEnv,
  Defclass *theDefclass,
  const char *slotName)
  {
   SlotDescriptor *sd;

   if ((sd = LookupSlot(theEnv,theDefclass,slotName,false)) == NULL)
     return(NO_DEFAULT);

   if (sd->noDefault)
     { return(NO_DEFAULT); }
   else if (sd->dynamicDefault)
     { return(DYNAMIC_DEFAULT); }

   return(STATIC_DEFAULT);
  }